[saco] Implement GameGetWeaponModelIDFromWeaponID

This commit is contained in:
RD42 2024-03-16 23:29:52 +08:00
parent b6d8c9c215
commit d32fb4e22f
3 changed files with 188 additions and 0 deletions

View File

@ -138,6 +138,52 @@ typedef struct _VEHICLE_TYPE
#define WEAPON_DROWN 53 #define WEAPON_DROWN 53
#define WEAPON_COLLISION 54 #define WEAPON_COLLISION 54
//---- weapon model defines ----
#define WEAPON_MODEL_BRASSKNUCKLE 331 // was 332
#define WEAPON_MODEL_GOLFCLUB 333
#define WEAPON_MODEL_NITESTICK 334
#define WEAPON_MODEL_KNIFE 335
#define WEAPON_MODEL_BAT 336
#define WEAPON_MODEL_SHOVEL 337
#define WEAPON_MODEL_POOLSTICK 338
#define WEAPON_MODEL_KATANA 339
#define WEAPON_MODEL_CHAINSAW 341
#define WEAPON_MODEL_DILDO 321
#define WEAPON_MODEL_DILDO2 322
#define WEAPON_MODEL_VIBRATOR 323
#define WEAPON_MODEL_VIBRATOR2 324
#define WEAPON_MODEL_FLOWER 325
#define WEAPON_MODEL_CANE 326
#define WEAPON_MODEL_GRENADE 342 // was 327
#define WEAPON_MODEL_TEARGAS 343 // was 328
#define WEAPON_MODEL_MOLTOV 344 // was 329
#define WEAPON_MODEL_COLT45 346
#define WEAPON_MODEL_SILENCED 347
#define WEAPON_MODEL_DEAGLE 348
#define WEAPON_MODEL_SHOTGUN 349
#define WEAPON_MODEL_SAWEDOFF 350
#define WEAPON_MODEL_SHOTGSPA 351
#define WEAPON_MODEL_UZI 352
#define WEAPON_MODEL_MP5 353
#define WEAPON_MODEL_AK47 355
#define WEAPON_MODEL_M4 356
#define WEAPON_MODEL_TEC9 372
#define WEAPON_MODEL_RIFLE 357
#define WEAPON_MODEL_SNIPER 358
#define WEAPON_MODEL_ROCKETLAUNCHER 359
#define WEAPON_MODEL_HEATSEEKER 360
#define WEAPON_MODEL_FLAMETHROWER 361
#define WEAPON_MODEL_MINIGUN 362
#define WEAPON_MODEL_SATCHEL 363
#define WEAPON_MODEL_BOMB 364
#define WEAPON_MODEL_SPRAYCAN 365
#define WEAPON_MODEL_FIREEXTINGUISHER 366
#define WEAPON_MODEL_CAMERA 367
#define WEAPON_MODEL_NIGHTVISION 368 // newly added
#define WEAPON_MODEL_INFRARED 369 // newly added
#define WEAPON_MODEL_JETPACK 370 // newly added
#define WEAPON_MODEL_PARACHUTE 371
//----------------------------------------------------------- //-----------------------------------------------------------
#define MAPICON_LOCAL 0 #define MAPICON_LOCAL 0

View File

@ -1145,6 +1145,147 @@ PED_TYPE * __stdcall GamePool_FindPlayerPed()
return *(PED_TYPE **)(0xB7CD98); return *(PED_TYPE **)(0xB7CD98);
} }
//-----------------------------------------------------------
// Translate Weapon model ID into actual weapon ID.
int __stdcall GameGetWeaponModelIDFromWeaponID(int iWeaponID)
{
switch(iWeaponID)
{
case WEAPON_BRASSKNUCKLE:
return WEAPON_MODEL_BRASSKNUCKLE;
case WEAPON_GOLFCLUB:
return WEAPON_MODEL_GOLFCLUB;
case WEAPON_NITESTICK:
return WEAPON_MODEL_NITESTICK;
case WEAPON_KNIFE:
return WEAPON_MODEL_KNIFE;
case WEAPON_BAT:
return WEAPON_MODEL_BAT;
case WEAPON_SHOVEL:
return WEAPON_MODEL_SHOVEL;
case WEAPON_POOLSTICK:
return WEAPON_MODEL_POOLSTICK;
case WEAPON_KATANA:
return WEAPON_MODEL_KATANA;
case WEAPON_CHAINSAW:
return WEAPON_MODEL_CHAINSAW;
case WEAPON_DILDO:
return WEAPON_MODEL_DILDO;
case WEAPON_DILDO2:
return WEAPON_MODEL_DILDO2;
case WEAPON_VIBRATOR:
return WEAPON_MODEL_VIBRATOR;
case WEAPON_VIBRATOR2:
return WEAPON_MODEL_VIBRATOR2;
case WEAPON_FLOWER:
return WEAPON_MODEL_FLOWER;
case WEAPON_CANE:
return WEAPON_MODEL_CANE;
case WEAPON_GRENADE:
return WEAPON_MODEL_GRENADE;
case WEAPON_TEARGAS:
return WEAPON_MODEL_TEARGAS;
case WEAPON_MOLTOV:
return WEAPON_MODEL_MOLTOV;
case WEAPON_COLT45:
return WEAPON_MODEL_COLT45;
case WEAPON_SILENCED:
return WEAPON_MODEL_SILENCED;
case WEAPON_DEAGLE:
return WEAPON_MODEL_DEAGLE;
case WEAPON_SHOTGUN:
return WEAPON_MODEL_SHOTGUN;
case WEAPON_SAWEDOFF:
return WEAPON_MODEL_SAWEDOFF;
case WEAPON_SHOTGSPA:
return WEAPON_MODEL_SHOTGSPA;
case WEAPON_UZI:
return WEAPON_MODEL_UZI;
case WEAPON_MP5:
return WEAPON_MODEL_MP5;
case WEAPON_AK47:
return WEAPON_MODEL_AK47;
case WEAPON_M4:
return WEAPON_MODEL_M4;
case WEAPON_TEC9:
return WEAPON_MODEL_TEC9;
case WEAPON_RIFLE:
return WEAPON_MODEL_RIFLE;
case WEAPON_SNIPER:
return WEAPON_MODEL_SNIPER;
case WEAPON_ROCKETLAUNCHER:
return WEAPON_MODEL_ROCKETLAUNCHER;
case WEAPON_HEATSEEKER:
return WEAPON_MODEL_HEATSEEKER;
case WEAPON_FLAMETHROWER:
return WEAPON_MODEL_FLAMETHROWER;
case WEAPON_MINIGUN:
return WEAPON_MODEL_MINIGUN;
case WEAPON_SATCHEL:
return WEAPON_MODEL_SATCHEL;
case WEAPON_BOMB:
return WEAPON_MODEL_BOMB;
case WEAPON_SPRAYCAN:
return WEAPON_MODEL_SPRAYCAN;
case WEAPON_FIREEXTINGUISHER:
return WEAPON_MODEL_FIREEXTINGUISHER;
case WEAPON_CAMERA:
return WEAPON_MODEL_CAMERA;
case WEAPON_NIGHTVISION:
return WEAPON_MODEL_NIGHTVISION;
case WEAPON_INFRARED:
return WEAPON_MODEL_INFRARED;
case WEAPON_PARACHUTE:
return WEAPON_MODEL_PARACHUTE;
}
return -1;
}
//----------------------------------------------------------- //-----------------------------------------------------------
void __stdcall SetRadarColor(int nIndex,DWORD dwColor) void __stdcall SetRadarColor(int nIndex,DWORD dwColor)

View File

@ -11,6 +11,7 @@ void __stdcall SetRadarColor(int nIndex,DWORD dwColor);
void __stdcall WorldRemoveEntity(DWORD *dwEnt); void __stdcall WorldRemoveEntity(DWORD *dwEnt);
void __stdcall WorldAddEntity(DWORD *dwEnt); void __stdcall WorldAddEntity(DWORD *dwEnt);
int __stdcall GameGetWeaponModelIDFromWeaponID(int iWeaponID);
void __stdcall GameDisableCheatCodes(); void __stdcall GameDisableCheatCodes();
PED_TYPE * __stdcall GamePool_Ped_GetAt(int iID); PED_TYPE * __stdcall GamePool_Ped_GetAt(int iID);