Advertisement
BaSs_HaXoR

MW3 Scripts (C++)

Sep 23rd, 2014
1,458
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 4.96 KB | None | 0 0
  1. //MW3 SCRIPTS (C++)
  2. //http://www.nextgenupdate.com/forums/modern-warfare-3-mods-patches-tutorials/755639-1-24-c-script-thread.html
  3.  
  4. /*It seems no one else is gonna do it so I will take the pleasure  Hopefully this gets some things in motion, I will try my best to update this if you want anything added post it below.
  5. */
  6.  
  7. TOC = 0x0072DCE8 //thanks to seb
  8.  
  9. SV_GameSendServerCommand
  10. opd_s SV = { 0x228FA8, TOC };void(*SV_GSSC)(int client, int type, char* cmd) = (void(*)(int, int, char*))&SV;
  11.  
  12.  
  13. //Some useful SV_GSSC functions
  14.  
  15. void iPrintlnBold(int client, char* text)
  16.     {
  17.         char buf[100];
  18.         strcpy(buf, "c \"");
  19.         strcat(buf, text);
  20.         SV_GSSC(client, 0, buf);
  21.     }
  22.  
  23.     void iPrintln(int client, char* text)
  24.     {
  25.         char buf[100];
  26.         strcpy(buf, "f \"");
  27.         strcat(buf, text);
  28.         SV_GSSC(client, 0, buf);
  29.     }
  30.  
  31.     void SetVision(int client, char* Vision)
  32.     {
  33.         char buf[100];
  34.         strcpy(buf, "j \"");
  35.         strcat(buf, Vision);
  36.         SV_GSSC(client, 0, buf);
  37.     }
  38.  
  39.     void SetFOV(int client, char* fov)
  40.     {
  41.         char buf[100];
  42.         strcpy(buf, "q  cg_fov \"");
  43.         strcat(buf, fov);
  44.         SV_GSSC(client, 0, buf);
  45.     }
  46.  
  47.     void KickWithMessage(int client, char* Message)
  48.     {
  49.         char buf[100];
  50.         strcpy(buf, "r \"");
  51.         strcat(buf, Message);
  52.         SV_GSSC(client, 0, buf);
  53.     }
  54.  
  55.  
  56. //cl_InGame
  57. bool InGame()
  58.     {
  59.         if (*(char*)0x018d4c64 != 1)
  60.             return false;
  61.         return true;
  62.     }
  63.  
  64.  
  65. //sprintf
  66. opd_s Com_sprintf_t = { 0x00298874, TOC };
  67. int(*Com_sprintf)(char *dest, int size, const char *fmt, ...) = (int(*)(char *, int, char const *, ...))&Com_sprintf_t;
  68.  
  69.  
  70.  
  71. //G_Client
  72. int G_Client(int clientIndex, int Mod = 0x00)
  73.     {
  74.         return 0x110A280 + (0x3980 * clientIndex) + Mod;
  75.     }
  76.  
  77.  
  78.  
  79. //Keyboard
  80. char* KeyBoard(char* Title)
  81.     {
  82.         opd_s key = { 0x026F5BC, TOC };
  83.         void(*Run)(int, char*, char*, int, int, int) = (void(*)(int, char*, char*, int, int, int))&key;
  84.         Run(0, Title, "", 40, 0x72DCE8, 0x7239A0);
  85.         while (PS3::ReadInt32(0x73145C) != 0)
  86.         {
  87.             continue;
  88.         }
  89.         return PS3::ReadString(0x2380E22);
  90.     }//I know you can use the one in the cell but it crashes the game for me :Fa:
  91.  
  92.  
  93. //Spawn solid models
  94. opd_s G_SetModel_t = { 0x01BEF5C, TOC };
  95.     void(*G_SetModel)(int clientIndex, const char* Model) = (void(*)(int, const char*))&G_SetModel_t;
  96.  
  97.     opd_s G_Spawn_t = { 0x01C058C, TOC };
  98.     int(* G_Spawn)() = (int(*)())&G_Spawn_t;
  99.  
  100.     opd_s SV_SetBrushModel_t = { 0x0022925C, TOC };
  101.     void(*SV_SetBrushModel)(int Entity) = (void(*)(int))&SV_SetBrushModel_t;
  102.  
  103.     opd_s SP_Script_Model_t = { 0x01B6F68, TOC };
  104.     void(*SP_Script_Model)(int Entity) = (void(*)(int))&SP_Script_Model_t;
  105.  
  106.     opd_s SV_UnlinkEntity_t = { 0x002377B8, TOC };
  107.     void(*SV_UnlinkEntity)(int Entity) = (void(*)(int))&SV_UnlinkEntity_t;
  108.  
  109.     opd_s SV_linkEntity_t = { 0x00237848, TOC };
  110.     void(*SV_linkEntity)(int Entity) = (void(*)(int))&SV_linkEntity_t;
  111.  
  112.     int SpawnEntity( float* Origin, float* Angles, const char* Model = "com_plasticcase_friendly", int Index = 2)
  113.     {
  114.         int Entity = (int)G_Spawn();
  115.         PS3::WriteFloat(Entity + 0x138, Origin, 3);
  116.         PS3::WriteFloat(Entity + 0x144, Angles, 3);
  117.         G_SetModel(Entity, Model);
  118.         SP_Script_Model(Entity);
  119.         SV_UnlinkEntity(Entity);
  120.         *(char*)(Entity + 0x101) = 4;
  121.         *(int*)(Entity + 0x8C) = Index;
  122.         SV_SetBrushModel(Entity);
  123.         SV_linkEntity(Entity);
  124.         return Entity;
  125.     }
  126.  
  127.  
  128. //FreezeClient
  129. void FreezeClient(int clientIndex)
  130.     {
  131.         if(!Client[clientIndex].Frozen)
  132.         {
  133.             *(char*)((clientIndex * 0x3980) + Offsets::FreezeClient) = 0x3F;
  134.             iPrintlnBold(clientIndex, "Freeze bitch!");
  135.             Client[Client[clientIndex].ClientSelected].Frozen = true;
  136.         }
  137.         else
  138.         {
  139.             *(char*)((clientIndex * 0x3980) + Offsets::FreezeClient) = 0x00;
  140.             iPrintlnBold(clientIndex, "Move along ******!");
  141.             Client[Client[clientIndex].ClientSelected].Frozen = false;
  142.         }
  143.     }
  144.  
  145.  
  146. //kick with message
  147. void KickWithMessage(int client, const char* Message)
  148.     {
  149.         opd_s kick = { 0x00223BD0, TOC };
  150.         int(*kickwmessage)(int client, const char* message) = (int(*)(int, const char*))&kick;
  151.         kickwmessage(client, Message);
  152.     }
  153.  
  154.  
  155. //Set Model
  156. void SetModel(int client, const char* Model)
  157.     {
  158.         opd_s setmodel = {0x1BEF5C, TOC};
  159.         void(*G_SetModel)(int client, const char* model) = (void(*)(int, const char*))&setmodel;
  160.         G_SetModel((0xFCA280 + (client * 0x280)), Model);
  161.     }
  162.  
  163.  
  164. //No clip
  165. void NoClip(int client)
  166.     {
  167.         if(!Client[client].NoClip)
  168.         {
  169.             *(char*)(0x0110D87F + (0x3980 * client)) = 0x02;
  170.             iPrintln(client, "NoClip: [ ^2Enabled ^7]");
  171.             Client[client].NoClip = true;
  172.         }
  173.         else
  174.         {
  175.             *(char*)(0x0110D87F + (0x3980 * client)) = 0x00;
  176.             iPrintln(client, "NoClip: [ ^1Disabled ^7]");
  177.             Client[client].NoClip = false;
  178.         }
  179.     }
  180.  
  181.  
  182. //GodMode
  183. void GodMode(int client)
  184.     {
  185.         if(!Client[client].GodMode)
  186.         {
  187.             *(char*)(0x0FCA41E + (0x280 * client)) = 0xFF;
  188.             iPrintln(client, "Godmode: [ ^2Enabled ^7]");
  189.             Client[client].GodMode = true;
  190.         }
  191.         else
  192.         {
  193.             *(char*)(0x0FCA41E + (0x280 * client)) = 0x00;
  194.             iPrintln(client, "Godmode: [ ^1Disabled ^7]");
  195.             Client[client].GodMode = false;
  196.         }
  197.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement