Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //MW3 SCRIPTS (C++)
- //http://www.nextgenupdate.com/forums/modern-warfare-3-mods-patches-tutorials/755639-1-24-c-script-thread.html
- /*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.
- */
- TOC = 0x0072DCE8 //thanks to seb
- SV_GameSendServerCommand
- opd_s SV = { 0x228FA8, TOC };void(*SV_GSSC)(int client, int type, char* cmd) = (void(*)(int, int, char*))&SV;
- //Some useful SV_GSSC functions
- void iPrintlnBold(int client, char* text)
- {
- char buf[100];
- strcpy(buf, "c \"");
- strcat(buf, text);
- SV_GSSC(client, 0, buf);
- }
- void iPrintln(int client, char* text)
- {
- char buf[100];
- strcpy(buf, "f \"");
- strcat(buf, text);
- SV_GSSC(client, 0, buf);
- }
- void SetVision(int client, char* Vision)
- {
- char buf[100];
- strcpy(buf, "j \"");
- strcat(buf, Vision);
- SV_GSSC(client, 0, buf);
- }
- void SetFOV(int client, char* fov)
- {
- char buf[100];
- strcpy(buf, "q cg_fov \"");
- strcat(buf, fov);
- SV_GSSC(client, 0, buf);
- }
- void KickWithMessage(int client, char* Message)
- {
- char buf[100];
- strcpy(buf, "r \"");
- strcat(buf, Message);
- SV_GSSC(client, 0, buf);
- }
- //cl_InGame
- bool InGame()
- {
- if (*(char*)0x018d4c64 != 1)
- return false;
- return true;
- }
- //sprintf
- opd_s Com_sprintf_t = { 0x00298874, TOC };
- int(*Com_sprintf)(char *dest, int size, const char *fmt, ...) = (int(*)(char *, int, char const *, ...))&Com_sprintf_t;
- //G_Client
- int G_Client(int clientIndex, int Mod = 0x00)
- {
- return 0x110A280 + (0x3980 * clientIndex) + Mod;
- }
- //Keyboard
- char* KeyBoard(char* Title)
- {
- opd_s key = { 0x026F5BC, TOC };
- void(*Run)(int, char*, char*, int, int, int) = (void(*)(int, char*, char*, int, int, int))&key;
- Run(0, Title, "", 40, 0x72DCE8, 0x7239A0);
- while (PS3::ReadInt32(0x73145C) != 0)
- {
- continue;
- }
- return PS3::ReadString(0x2380E22);
- }//I know you can use the one in the cell but it crashes the game for me :Fa:
- //Spawn solid models
- opd_s G_SetModel_t = { 0x01BEF5C, TOC };
- void(*G_SetModel)(int clientIndex, const char* Model) = (void(*)(int, const char*))&G_SetModel_t;
- opd_s G_Spawn_t = { 0x01C058C, TOC };
- int(* G_Spawn)() = (int(*)())&G_Spawn_t;
- opd_s SV_SetBrushModel_t = { 0x0022925C, TOC };
- void(*SV_SetBrushModel)(int Entity) = (void(*)(int))&SV_SetBrushModel_t;
- opd_s SP_Script_Model_t = { 0x01B6F68, TOC };
- void(*SP_Script_Model)(int Entity) = (void(*)(int))&SP_Script_Model_t;
- opd_s SV_UnlinkEntity_t = { 0x002377B8, TOC };
- void(*SV_UnlinkEntity)(int Entity) = (void(*)(int))&SV_UnlinkEntity_t;
- opd_s SV_linkEntity_t = { 0x00237848, TOC };
- void(*SV_linkEntity)(int Entity) = (void(*)(int))&SV_linkEntity_t;
- int SpawnEntity( float* Origin, float* Angles, const char* Model = "com_plasticcase_friendly", int Index = 2)
- {
- int Entity = (int)G_Spawn();
- PS3::WriteFloat(Entity + 0x138, Origin, 3);
- PS3::WriteFloat(Entity + 0x144, Angles, 3);
- G_SetModel(Entity, Model);
- SP_Script_Model(Entity);
- SV_UnlinkEntity(Entity);
- *(char*)(Entity + 0x101) = 4;
- *(int*)(Entity + 0x8C) = Index;
- SV_SetBrushModel(Entity);
- SV_linkEntity(Entity);
- return Entity;
- }
- //FreezeClient
- void FreezeClient(int clientIndex)
- {
- if(!Client[clientIndex].Frozen)
- {
- *(char*)((clientIndex * 0x3980) + Offsets::FreezeClient) = 0x3F;
- iPrintlnBold(clientIndex, "Freeze bitch!");
- Client[Client[clientIndex].ClientSelected].Frozen = true;
- }
- else
- {
- *(char*)((clientIndex * 0x3980) + Offsets::FreezeClient) = 0x00;
- iPrintlnBold(clientIndex, "Move along ******!");
- Client[Client[clientIndex].ClientSelected].Frozen = false;
- }
- }
- //kick with message
- void KickWithMessage(int client, const char* Message)
- {
- opd_s kick = { 0x00223BD0, TOC };
- int(*kickwmessage)(int client, const char* message) = (int(*)(int, const char*))&kick;
- kickwmessage(client, Message);
- }
- //Set Model
- void SetModel(int client, const char* Model)
- {
- opd_s setmodel = {0x1BEF5C, TOC};
- void(*G_SetModel)(int client, const char* model) = (void(*)(int, const char*))&setmodel;
- G_SetModel((0xFCA280 + (client * 0x280)), Model);
- }
- //No clip
- void NoClip(int client)
- {
- if(!Client[client].NoClip)
- {
- *(char*)(0x0110D87F + (0x3980 * client)) = 0x02;
- iPrintln(client, "NoClip: [ ^2Enabled ^7]");
- Client[client].NoClip = true;
- }
- else
- {
- *(char*)(0x0110D87F + (0x3980 * client)) = 0x00;
- iPrintln(client, "NoClip: [ ^1Disabled ^7]");
- Client[client].NoClip = false;
- }
- }
- //GodMode
- void GodMode(int client)
- {
- if(!Client[client].GodMode)
- {
- *(char*)(0x0FCA41E + (0x280 * client)) = 0xFF;
- iPrintln(client, "Godmode: [ ^2Enabled ^7]");
- Client[client].GodMode = true;
- }
- else
- {
- *(char*)(0x0FCA41E + (0x280 * client)) = 0x00;
- iPrintln(client, "Godmode: [ ^1Disabled ^7]");
- Client[client].GodMode = false;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement