Advertisement
iProgeny

GSC FUNCTION REVERSED BY IPROGENY

Sep 3rd, 2017
517
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 2.63 KB | None | 0 0
  1. void G_SelectWeaponIndex(int clientNum, int iWeaponIndex)
  2. {
  3.     SV_GameSendServerCommand(clientNum, 0, va("%c %i", 'a', iWeaponIndex));
  4. }
  5.  
  6. void G_SetModel(int entity, const char * modelName)
  7. {
  8.     *(short*)(G_Entity(entity) + 0x168) = G_ModelIndex(modelName);
  9. }
  10.  
  11. void SetMiniMap(int client, char * material, float ULX, float ULY, float LRX, float LRY)
  12. {
  13.     SV_GetConfigstring(0x422, va("\"%s\" %f %f %f %f", material, ULX, ULY, LRX, LRY));
  14. }
  15.  
  16. void iPrintln(int client, const char* text, ...)
  17. {
  18.     SV_GameSendServerCommand(client, 0, va("%c \"%s\"", 'f', text));
  19. }
  20.  
  21. void iPrintlnBold(int client, const char* text, ...)
  22. {
  23.     SV_GameSendServerCommand(client, 0, va("%c \"%s\"", 'c', text));
  24. }
  25.  
  26. void Scr_SetNumParam(int numOfParms)
  27. {
  28.     *(int*)0x835C49F0 = numOfParms;
  29. }
  30.  
  31. void switchToWeapon(int client, char * weapon)
  32. {
  33.     G_SelectWeaponIndex(client, G_GetWeaponIndexForName(weapon));
  34. }
  35.  
  36. void giveMaxAmmo(int client, char * weapon)
  37. {
  38.     Add_Ammo((int*)G_Entity(client), G_GetWeaponIndexForName(weapon), 0, BG_GetAmmoPlayerMax((int*)G_Client(client), G_GetWeaponIndexForName(weapon), 0), 1);
  39. }
  40.  
  41. int WeaponClipSize(char * weapon)
  42. {
  43.     return BG_GetWeaponDef(G_GetWeaponIndexForName(weapon));
  44. }
  45.  
  46. void giveStartAmmo(int client, char * weapon)
  47. {
  48.     G_InitializeAmmo((int)G_Entity(client), G_GetWeaponIndexForName(weapon), 0, 0);
  49. }
  50.  
  51. void giveWeapon(int client, char * weapon, int akimbo = 0, int camo = 0)
  52. {
  53.     G_GivePlayerWeapon((int)G_Client(client), G_GetWeaponIndexForName(weapon), akimbo, camo);
  54.     G_InitializeAmmo((int)G_Entity(client), G_GetWeaponIndexForName(weapon), akimbo, camo);
  55. }
  56.  
  57. void SetActionSlot(int client, int slot, char * optionName, const char * weapon = "")
  58. {
  59.     if (slot < 1 || slot > 4)
  60.         return;
  61.  
  62.     slot -= 1;
  63.     if (!stricmp(optionName, "weapon"))
  64.     {
  65.         _821F2D88(weapon);
  66.         *(int*)(G_Client(client) + ((slot + 0x114) * 4)) = 1;
  67.         *(int*)(G_Client(client) + ((slot + 0x114) * 4)) = BG_FindWeaponIndexForName(weapon);
  68.     }
  69.     else if (!stricmp(optionName, "altmode"))
  70.     {
  71.         *(int*)(G_Client(client) + ((slot + 0x114) * 4)) = 2;
  72.     }
  73.     else if (!stricmp(optionName, "nightvision"))
  74.     {
  75.         *(int*)(G_Client(client) + ((slot + 0x114) * 4)) = 3;
  76.     }
  77. }
  78.  
  79. void setOrigin(int client, float x, float y, float z)
  80. {
  81.     *(float*)(G_Client(client) + 0x1C) = x; //x
  82.     *(float*)(G_Client(client) + 0x20) = y; //y
  83.     *(float*)(G_Client(client) + 0x24) = z; //z
  84. }
  85.  
  86. void SetClientDvar(int client, char * dvar, char * value)
  87. {
  88.     SV_GameSendServerCommand(client, 0, va("%c %s \"%s\"", 's', dvar, value));
  89. }
  90.  
  91. void Hide(int client)
  92. {
  93.     *(char*)(G_Client(client) + 0xB3) = 0x20;
  94. }
  95.  
  96. void Show(int client)
  97. {
  98.     *(char*)(G_Client(client) + 0xB3) = 0x00;
  99. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement