Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Feel free to do anything you want with the gamemode! - Cantbehudson
- #include <a_samp>
- #include <fixes>
- #include <zcmd>
- #include <sscanf2>
- #include <foreach>
- #define COLOR_YELLOW 0xE3FF2EFF
- #define COLOR_FADE1 0xE6E6E6E6
- #define COLOR_FADE2 0xC8C8C8C8
- #define COLOR_FADE3 0xAAAAAAAA
- #define COLOR_FADE4 0x8C8C8C8C
- #define COLOR_FADE5 0x6E6E6E6E
- #define COLOR_FADE 0xC8C8C8C8
- #define COLOR_WHITE 0xFFFFFFAA
- #define COLOR_GRAD2 0xBFC0C2FF
- #define COLOR_DARKRED 0x8B0000AA
- #define COLOR_RED 0xFF0000AA
- #define COLOR_LIGHTBLUE 0x33CCFFAA
- #define COLOR_GREY 0xAFAFAFAA
- #define COLOR_PINK 0xDC00DDAA
- #define COLOR_BLUE 0x007ED13F
- #define COLOR_GREEN 0x7ED13FFF
- #define COLOR_DARKGREEN 0x00A800AA
- #define COLOR_ORANGE 0xFF8000AA
- #define COLOR_CYAN 0x7BDDA5AA
- #define COLOR_WHITE 0xFFFFFFAA
- #define COLOR_DARKBLUE 0x0000A0AA
- #define COLOR_BLACK 0x000000AA
- #define COLOR_DARKGOLD 0x808000AA
- #define COLOR_PURPLE 0xC2A2DAAA
- #define COLOR_BROWN 0x804000AA
- #define COLOR_BLACK2 0x000000ff
- #define COLOR_LIGHTRED 0xFF6347AA
- /*#define BODY_PART_TORSO 3
- #define BODY_PART_GROIN 4
- #define BODY_PART_RIGHT_ARM 5
- #define BODY_PART_LEFT_ARM 6
- #define BODY_PART_RIGHT_LEG 7
- #define BODY_PART_LEFT_LEG 8
- #define BODY_PART_HEAD 9*/
- #define DAMAGE_COLT 35
- #define DAMAGE_SILENCER 100
- #define DAMAGE_DEAGLE 60
- #define DAMAGE_SHOTGUN 60
- #define DAMAGE_SAWNOFF 40
- #define DAMAGE_UZI 35
- #define DAMAGE_MP5 35
- #define DAMAGE_AK47 35
- #define DAMAGE_RIFLE 100
- #define DAMAGE_TEC9 35
- #define DAMAGE_M4 35
- #define DAMAGE_SNIPER 350
- #define DCOLOR_LIGHTRED "{FF6347}"
- #define DCOLOR_GREY "{AFAFAF}"
- #define DCOLOR_BLUE "{007ED1}"
- #define DCOLOR_RED "{FF0000}"
- #define DCOLOR_WHITE "{FFFFFF}"
- #define DCOLOR_BLACK "{000000}"
- #define DCOLOR_CYAN "{7BDDA5}"
- #define DCOLOR_GOLD "{808000}"
- #define DCOLOR_YELLOW "{E3FF2E}"
- #define DCOLOR_GREEN "{7ED13F}"
- #define DCOLOR_DGREEN "{027A02}"
- #define DIALOG_SHOW_HELP 400
- #define DIALOG_SHOW_DAMAGES 400
- main()
- {
- print(" LSPD METRO TRAINING BY CANTBEHUDSON");
- }
- enum pplayerInfo
- {
- Float:posX,
- Float:posY,
- Float:posZ,
- Float:posF,
- cInterior,
- cVirtualWorld,
- };
- new PlayerInfo[MAX_PLAYERS][pplayerInfo];
- enum admincarInfo
- {
- Created,
- Owner[MAX_PLAYER_NAME],
- };
- new acarInfo[MAX_VEHICLES][admincarInfo];
- enum damageInfo
- {
- hit[20],
- bbodypart[20],
- tdamage[20],
- kevlar[20],
- };
- new pdamage[MAX_PLAYERS][damageInfo];
- new Float:markx, Float:marky, Float:markz;
- new markvw, markint;
- new Float:markx2, Float:marky2, Float:markz2;
- new markvw2, markint2;
- new masked[MAX_PLAYERS];
- new taserer[MAX_PLAYERS];
- stock AddHit(playerid, ddweapon, ddbodypart, dddamage, ddkevlar)
- {
- new look;
- for(look = 0; look < 20; ++look)
- {
- if(pdamage[playerid][hit][look] == 0)
- {
- pdamage[playerid][hit][look] = ddweapon;
- pdamage[playerid][bbodypart][look] = ddbodypart;
- pdamage[playerid][tdamage][look] = dddamage;
- pdamage[playerid][kevlar][look] = ddkevlar;
- break;
- }
- }
- return 1;
- }
- stock ClearHits(playerid)
- {
- new look;
- for(look = 0; look < 20; ++look)
- {
- pdamage[playerid][hit][look] = 0;
- pdamage[playerid][bbodypart][look] = 0;
- pdamage[playerid][tdamage][look] = 0;
- pdamage[playerid][kevlar][look] = 0;
- }
- return 1;
- }
- stock SendAdminMessage(color,aststring[])
- {
- foreach(Player,i)
- {
- if(IsPlayerAdmin(i))
- {
- SendSplitClientMessage(i, color, aststring);
- }
- }
- return 1;
- }
- stock SendOOCMessage(Float:radi, playerid, string[])
- {
- new Float:posx, Float:posy, Float:posz;
- GetPlayerPos(playerid, posx, posy, posz);
- foreach (Player, i)
- {
- if(GetPlayerVirtualWorld(i) == GetPlayerVirtualWorld(playerid))
- {
- if(IsPlayerInRangeOfPoint(i,radi,posx, posy, posz))
- {
- new Float:radius, feet;
- radius = GetDistanceBetweenPlayerToPoint(i,posx, posy, posz);
- feet = floatround(radius);
- switch(feet)
- {
- case 0 .. 10: SendSplitClientMessage(i,0xF0F0F096,string);
- case 11 .. 15: SendSplitClientMessage(i,0xC9C9C996,string);
- case 16 .. 20: SendSplitClientMessage(i,0xB5B5B596,string);
- case 21 .. 25: SendSplitClientMessage(i,0xA3A3A396,string);
- case 26 .. 31: SendSplitClientMessage(i,0x79797996,string);
- }
- }
- }
- }
- return 1;
- }
- stock PlayerToPlayer(playerid,targetid,Float:distance)
- {
- new Float:bbx, Float:bby, Float:bbz;
- GetPlayerPos(playerid,bbx,bby,bbz);
- if(IsPlayerConnected(targetid)&&IsPlayerInRangeOfPoint(targetid,distance,bbx,bby,bbz)&&IsPlayerStreamedIn(targetid, playerid)) return true;
- return false;
- }
- stock GetPlayerID(checkname[])
- {
- for(new i = 0; i < MAX_PLAYERS; i++)
- {
- if(IsPlayerConnected(i))
- {
- if(!strcmp(checkname, PlayerName(i)))
- {
- return i;
- }
- }
- }
- return -1;
- }
- stock GiveNameSpace(str[])
- {
- new strl;
- strl=strlen(str);
- while(strl--) {
- if(str[strl]=='_') str[strl]=' ';
- }
- return 0;
- }
- stock PlayerNameEx(playerid)
- {
- new name[MAX_PLAYER_NAME];
- GetPlayerName(playerid, name, sizeof(name));
- GiveNameSpace(name);
- return name;
- }
- stock PlayerName(playerid)
- {
- new name[MAX_PLAYER_NAME];
- GetPlayerName(playerid, name, sizeof(name));
- if(GetPVarInt(playerid, "hiddenaduty") == 1) format(name, sizeof(name), "Hidden Admin");
- return name;
- }
- stock split(const strsrc[], strdest[][], delimiter = '|')
- {
- new i, li, aNum, len, srclen = strlen(strsrc);
- while(i <= srclen)
- {
- if (strsrc[i] == delimiter || i == srclen)
- {
- len = strmid(strdest[aNum], strsrc, li, i, 128);
- strdest[aNum][len] = 0;
- li = i + 1;
- aNum++;
- }
- i++;
- }
- return 1;
- }
- stock SendSplitClientMessage(playerid, color, text[], minlen = 110, maxlen = 120)
- {
- new str[256];
- if(strlen(text) > maxlen)
- {
- new pos = maxlen;
- while(text[--pos] > ' ') {}
- if(pos < minlen) pos = maxlen;
- format(str, sizeof(str), "%.*s ...", pos, text);
- SendClientMessage(playerid,color,str);
- format(str, sizeof(str), "... %s", text[pos+1]);
- SendClientMessage(playerid,color,str);
- }
- else format(str, sizeof(str), "%s", text), SendClientMessage(playerid,color,str);
- return true;
- }
- forward Welcome(playerid);
- public Welcome(playerid)
- {
- SetPlayerColor(playerid, COLOR_BLUE);
- SendClientMessage(playerid, COLOR_WHITE, "");
- SendClientMessage(playerid, COLOR_WHITE, "");
- SendClientMessage(playerid, COLOR_WHITE, "");
- SendClientMessage(playerid, COLOR_WHITE, "");
- SendClientMessage(playerid, COLOR_WHITE, "");
- SendClientMessage(playerid, COLOR_WHITE, "");
- SendClientMessage(playerid, COLOR_WHITE, "");
- SendClientMessage(playerid, COLOR_WHITE, "");
- SendClientMessage(playerid, COLOR_WHITE, "");
- SendClientMessage(playerid, COLOR_WHITE, "Welcome to the LSPD Metropolitan Division's Training Server");
- SendClientMessage(playerid, COLOR_WHITE, "Use /help to check the command list");
- new i;
- for(i = 0; i < MAX_PLAYERS; ++i)
- {
- if(IsPlayerConnected(i))
- {
- SetPlayerMarkerForPlayer( i, playerid, GetPlayerColor( playerid ) & 0xFFFFFF00);
- }
- }
- }
- forward ProxDetector(Float:radi, playerid, string[], color);
- public ProxDetector(Float:radi, playerid, string[], color)
- {
- new Float:posx, Float:posy, Float:posz;
- GetPlayerPos(playerid, posx, posy, posz);
- if(color == COLOR_PURPLE) SetPlayerChatBubble(playerid, string, COLOR_PURPLE, radi, 5000);
- foreach (Player, i)
- {
- if(GetPlayerVirtualWorld(i) == GetPlayerVirtualWorld(playerid))
- {
- if(IsPlayerInRangeOfPoint(i,radi,posx, posy, posz))
- {
- if(color == COLOR_FADE)
- {
- new Float:radius, feet;
- radius = GetDistanceBetweenPlayerToPoint(i,posx, posy, posz);
- feet = floatround(radius);
- switch(feet)
- {
- case 0 .. 10: SendSplitClientMessage(i,0xF0F0F096,string);
- case 11 .. 15: SendSplitClientMessage(i,0xC9C9C996,string);
- case 16 .. 20: SendSplitClientMessage(i,0xB5B5B596,string);
- case 21 .. 25: SendSplitClientMessage(i,0xA3A3A396,string);
- case 26 .. 100: SendSplitClientMessage(i,0x79797996,string);
- }
- }
- else SendSplitClientMessage(i, color, string);
- }
- }
- }
- return 1;
- }
- forward ProxDetectorRadio(Float:radi, playerid, string[], color);
- public ProxDetectorRadio(Float:radi, playerid, string[], color)
- {
- new Float:posx, Float:posy, Float:posz;
- GetPlayerPos(playerid, posx, posy, posz);
- if(color == COLOR_PURPLE) SetPlayerChatBubble(playerid, string, COLOR_PURPLE, radi, 5000);
- foreach (Player, i)
- {
- if(playerid != i)
- if(GetPlayerVirtualWorld(i) == GetPlayerVirtualWorld(playerid))
- {
- if(IsPlayerInRangeOfPoint(i,radi,posx, posy, posz))
- {
- if(color == COLOR_FADE)
- {
- new Float:radius, feet;
- radius = GetDistanceBetweenPlayerToPoint(i,posx, posy, posz);
- feet = floatround(radius);
- switch(feet)
- {
- case 0 .. 10: SendSplitClientMessage(i,0xF0F0F096,string);
- case 11 .. 15: SendSplitClientMessage(i,0xC9C9C996,string);
- case 16 .. 20: SendSplitClientMessage(i,0xB5B5B596,string);
- case 21 .. 25: SendSplitClientMessage(i,0xA3A3A396,string);
- case 26 .. 100: SendSplitClientMessage(i,0x79797996,string);
- }
- }
- else SendSplitClientMessage(i, color, string);
- }
- }
- }
- return 1;
- }
- public OnGameModeInit()
- {
- SetNameTagDrawDistance(20.0);
- new maskfor;
- for(maskfor = 0; maskfor < MAX_PLAYERS; ++maskfor)
- {
- masked[maskfor] = false;
- taserer[maskfor] = false;
- }
- DisableInteriorEnterExits();
- ShowPlayerMarkers(1);
- SetGameModeText("LSPD");
- AddPlayerClass(280,1529.2416,-1676.9371,5.8906,176.5846, 29, 500, 24, 140, 25, 500);
- return 1;
- }
- public OnGameModeExit()
- {
- return 1;
- }
- public OnPlayerRequestClass(playerid, classid)
- {
- SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
- SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
- SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
- return 1;
- }
- public OnPlayerConnect(playerid)
- {
- ClearHits(playerid);
- SetTimerEx("Welcome", 5000, false, "i", playerid);
- ApplyAnimation(playerid, "CRACK", "crckdeth2", 4.1, 1, 1, 1, 0, 10000, 1);
- foreach(Player, U)
- {
- SetPlayerMarkerForPlayer(U, playerid, 0xFFFFFF00);
- }
- return 1;
- }
- public OnPlayerDisconnect(playerid, reason)
- {
- new
- szString[128],
- playerName[MAX_PLAYER_NAME];
- GetPlayerName(playerid, playerName, MAX_PLAYER_NAME);
- new szDisconnectReason[3][] =
- {
- "Timeout/Crash",
- "Quit",
- "Kick/Ban"
- };
- format(szString, sizeof szString, "Server: %s has disconnected. (%s)", playerName, szDisconnectReason[reason]);
- SendClientMessageToAll(COLOR_FADE4, szString);
- return 1;
- }
- public OnPlayerSpawn(playerid)
- {
- foreach(Player, U)
- {
- SetPlayerMarkerForPlayer(U, playerid, 0xFFFFFF00);
- }
- if(GetPVarInt(playerid, "dead") == 1)
- {
- SetCameraBehindPlayer(playerid);
- if(PlayerInfo[playerid][cInterior] != 0)
- {
- SetPlayerInterior(playerid, PlayerInfo[playerid][cInterior]);
- SetPlayerVirtualWorld(playerid, PlayerInfo[playerid][cVirtualWorld]);
- SetTimerEx("Unfreeze", 3400, false, "i", playerid);
- }
- new rand = random(5)+1;
- switch(rand)
- {
- case 1: ApplyAnimation(playerid, "ped", "FLOOR_hit", 4.0, 0, 1, 1, 1, -1);
- case 2: ApplyAnimation(playerid, "ped", "FLOOR_hit_f", 4.0, 0, 1, 1, 1, -1);
- case 3: ApplyAnimation(playerid, "ped", "KO_shot_front", 4.0, 0, 1, 1, 1, -1);
- case 4: ApplyAnimation(playerid, "ped", "KO_shot_stom", 4.0, 0, 1, 1, 1, -1);
- case 5: ApplyAnimation(playerid, "ped", "BIKE_fall_off", 4.0, 0, 1, 1, 1, -1);
- default: ApplyAnimation(playerid, "FINALE", "FIN_Land_Die", 4.0, 0, 1, 1, 1, -1);
- }
- SendClientMessage(playerid, COLOR_WHITE, "Server: You can use /respawn if noone's roleplaying with your body.");
- SetPVarInt(playerid, "dead", 0);
- SetSpawnInfo(playerid, 0, GetPlayerSkin(playerid), 1529.2416,-1676.9371,5.8906,176.5846, 29, 500, 24, 140, 25, 500);
- }
- else
- {
- SetCameraBehindPlayer(playerid);
- TogglePlayerControllable(playerid, 1);
- ClearAnimations(playerid);
- ClearHits(playerid);
- }
- return 1;
- }
- public OnPlayerDeath(playerid, killerid, reason)
- {
- PlayerInfo[playerid][cInterior] = GetPlayerInterior(playerid);
- PlayerInfo[playerid][cVirtualWorld] = GetPlayerVirtualWorld(playerid);
- GetPlayerPos(playerid, PlayerInfo[playerid][posX], PlayerInfo[playerid][posY], PlayerInfo[playerid][posZ]);
- GetPlayerFacingAngle(playerid, PlayerInfo[playerid][posF]);
- SetSpawnInfo(playerid, 0, GetPlayerSkin(playerid), PlayerInfo[playerid][posX], PlayerInfo[playerid][posY], PlayerInfo[playerid][posZ], PlayerInfo[playerid][posF], 0, 0, 0, 0, 0, 0 );
- TogglePlayerControllable(playerid, 0);
- SetPVarInt(playerid, "dead", 1);
- return 1;
- }
- public OnVehicleSpawn(vehicleid)
- {
- return 1;
- }
- public OnVehicleDeath(vehicleid, killerid)
- {
- return 1;
- }
- public OnPlayerText(playerid, text[])
- {
- new string[256], pText[128];
- format(pText, sizeof (pText), "%s", text);
- format(string, sizeof(string), "%s says: %s", PlayerNameEx(playerid), pText);
- ProxDetector(30.0, playerid, string, COLOR_FADE);
- return 0;
- }
- public OnPlayerCommandText(playerid, cmdtext[])
- {
- return 0;
- }
- public OnPlayerCommandPerformed(playerid, cmdtext[], success)
- {
- if (!success)
- {
- SendClientMessage(playerid ,COLOR_RED, "Error: Invalid command. Use /help to access the list.");
- }
- return 1;
- }
- public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
- {
- return 1;
- }
- public OnPlayerExitVehicle(playerid, vehicleid)
- {
- return 1;
- }
- public OnPlayerStateChange(playerid, newstate, oldstate)
- {
- return 1;
- }
- public OnPlayerEnterCheckpoint(playerid)
- {
- return 1;
- }
- public OnPlayerLeaveCheckpoint(playerid)
- {
- return 1;
- }
- public OnPlayerEnterRaceCheckpoint(playerid)
- {
- return 1;
- }
- public OnPlayerLeaveRaceCheckpoint(playerid)
- {
- return 1;
- }
- public OnRconCommand(cmd[])
- {
- return 1;
- }
- public OnPlayerRequestSpawn(playerid)
- {
- return 1;
- }
- public OnObjectMoved(objectid)
- {
- return 1;
- }
- public OnPlayerObjectMoved(playerid, objectid)
- {
- return 1;
- }
- public OnPlayerPickUpPickup(playerid, pickupid)
- {
- return 1;
- }
- public OnVehicleMod(playerid, vehicleid, componentid)
- {
- return 1;
- }
- public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
- {
- return 1;
- }
- public OnVehicleRespray(playerid, vehicleid, color1, color2)
- {
- return 1;
- }
- public OnPlayerSelectedMenuRow(playerid, row)
- {
- return 1;
- }
- public OnPlayerExitedMenu(playerid)
- {
- return 1;
- }
- public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
- {
- return 1;
- }
- public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
- {
- return 1;
- }
- public OnRconLoginAttempt(ip[], password[], success)
- {
- return 1;
- }
- public OnPlayerUpdate(playerid)
- {
- return 1;
- }
- public OnPlayerStreamIn(playerid, forplayerid)
- {
- if(masked[playerid])
- ShowPlayerNameTagForPlayer(forplayerid, playerid, 0);
- return 1;
- }
- public OnPlayerStreamOut(playerid, forplayerid)
- {
- return 1;
- }
- public OnVehicleStreamIn(vehicleid, forplayerid)
- {
- return 1;
- }
- public OnVehicleStreamOut(vehicleid, forplayerid)
- {
- return 1;
- }
- public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
- {
- return 1;
- }
- public OnPlayerClickPlayer(playerid, clickedplayerid, source)
- {
- return 1;
- }
- public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid, bodypart)
- {
- new string[128];
- if(issuerid != INVALID_PLAYER_ID)
- {
- new Float:x, Float:y, Float:z, Float:amoun, Float:distance = 0.9, Float:health, Float:armour;
- GetPlayerPos(playerid,x,y,z), GetPlayerHealth(playerid,health), GetPlayerArmour(playerid,armour);
- if(weaponid == 23)
- {
- format(string, sizeof(string), "*** %s has been tased by %s.", PlayerNameEx(playerid), PlayerNameEx(issuerid));
- SendClientMessage(playerid, COLOR_PURPLE, string);
- SetPlayerChatBubble(playerid, string, COLOR_PURPLE, 20.0, 5000);
- SetPlayerDrunkLevel(playerid, 10);
- ApplyAnimation(playerid, "CRACK", "crckdeth2", 4.1, 1, 1, 1, 0, 10000, 1);
- GameTextForPlayer(playerid, "Tased", 5000, 1);
- }
- else if(weaponid > 21 && weaponid < 35)
- {
- new damage = 0;
- switch(weaponid)
- {
- case 22: damage = DAMAGE_COLT;
- case 23: damage = DAMAGE_SILENCER;
- case 24: damage = DAMAGE_DEAGLE;
- case 25: damage = DAMAGE_SHOTGUN;
- case 26: damage = DAMAGE_SAWNOFF;
- case 27: damage = DAMAGE_SHOTGUN;
- case 28: damage = DAMAGE_UZI;
- case 29: damage = DAMAGE_MP5;
- case 30: damage = DAMAGE_AK47;
- case 31: damage = DAMAGE_M4;
- case 32: damage = DAMAGE_TEC9;
- case 33: damage = DAMAGE_RIFLE;
- case 34: damage = DAMAGE_SNIPER;
- }
- if(damage != 0 && !IsPlayerInRangeOfPoint(issuerid,distance,x,y,z))
- {
- if(armour > 0)
- {
- amoun = armour - damage;
- if(amoun <= 0)
- {
- SetPlayerHealth(playerid,health-damage+armour);
- SetPlayerArmour(playerid, 0);
- AddHit(playerid, weaponid, bodypart, damage, 0);
- }
- else
- {
- AddHit(playerid, weaponid, bodypart, damage, 1);
- SetPlayerArmour(playerid,armour-damage);
- }
- }
- else
- {
- SetPlayerHealth(playerid,health-damage);
- AddHit(playerid, weaponid, bodypart, damage, 0);
- }
- }
- }
- }
- return 1;
- }
- forward Float:GetDistanceBetweenPlayerToPoint(p1,Float:px,Float:py,Float:pz);
- public Float:GetDistanceBetweenPlayerToPoint(p1,Float:px,Float:py,Float:pz)
- {
- new Float:x1,Float:y1,Float:z1,Float:x2,Float:y2,Float:z2;
- if(!IsPlayerConnected(p1)) return -1.00;
- GetPlayerPos(p1,x1,y1,z1);
- x2 = px;
- y2 = py;
- z2 = pz;
- return floatsqroot(floatpower(floatabs(floatsub(x2,x1)),2)+floatpower(floatabs(floatsub(y2,y1)),2)+floatpower(floatabs(floatsub(z2,z1)),2));
- }
- forward KickPublic(playerid);
- public KickPublic(playerid)
- {
- Kick(playerid);
- }
- stock KickWithMessage(playerid, color, message[])
- {
- SendClientMessage(playerid, color, message);
- SetTimerEx("KickPublic", 1000, false, "d", playerid);
- }
- #define ALTCOMMAND:%1->%2; \
- COMMAND:%1(playerid, params[]) \
- return cmd_%2(playerid, params);
- COMMAND:spec(playerid, params[])
- {
- if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, COLOR_RED, "Error: You must be an admin to use this command.");
- new specid;
- if(sscanf(params, "u", specid)) return SendClientMessage(playerid, COLOR_WHITE, ""DCOLOR_BLUE"Syntax: "DCOLOR_WHITE"/spec [Player ID/Name]");
- else
- {
- TogglePlayerSpectating(playerid, 1);
- PlayerSpectatePlayer(playerid, specid);
- SetPlayerInterior(playerid, GetPlayerInterior(specid));
- SetPlayerVirtualWorld(playerid, GetPlayerVirtualWorld(specid));
- if(IsPlayerInAnyVehicle(specid))
- PlayerSpectateVehicle(playerid, GetPlayerVehicleID(specid));
- }
- return 1;
- }
- COMMAND:unspec(playerid)
- {
- if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, COLOR_RED, "Error: You must be an admin to use this command.");
- TogglePlayerSpectating(playerid, 0);
- return 1;
- }
- COMMAND:help(playerid)
- {
- new str[1024] = "";
- strcat(str, "Roleplay: /me, /do, /low, /(s)hout, /(w)hisper, /r\n");
- strcat(str, "OOC: /pm, /b, /f, /mask\n");
- strcat(str, "Game: /skin, /hp, /kevlar\n");
- strcat(str, "Game: /duty, /offduty, /criminal, /swat\n");
- strcat(str, "Game: /taser, /gun, /damages\n");
- strcat(str, "Teleport: /respawn, /pdhq, /training\n");
- strcat(str, "Teleport: /goto, /gotomark, gotomark2\n");
- strcat(str, "Vehicles: /acar, /delcar, /fix\n");
- strcat(str, "Interiors: /int, /intlist\n");
- if(IsPlayerAdmin(playerid))
- {
- strcat(str, "Admin: /get, /setskin, /givegun, /debug\n");
- strcat(str, "Admin: /sethp, /setkevlar, /a, /slap, /unslap\n");
- strcat(str, "Admin: /mark, /mark2n");
- strcat(str, "Admin: /spec, /unspec, /kick\n");
- }
- strcat(str, "\nCredits: Cantbehudson (scripting), Limex (interiors)");
- ShowPlayerDialog(playerid, DIALOG_SHOW_HELP, DIALOG_STYLE_MSGBOX, "Help menu", str, "Close", "");
- return 1;
- }
- COMMAND:a(playerid, params[])
- {
- if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, COLOR_RED, "Error: You must be an admin to use this command.");
- new adminstring[256];
- if(sscanf(params, "s[256]", adminstring)) return SendClientMessage(playerid, COLOR_WHITE, ""DCOLOR_BLUE"Syntax: "DCOLOR_WHITE"/a [message to admins]");
- else
- {
- format(adminstring, sizeof(adminstring), "*[Admin] (ID:%i) %s: %s", playerid, PlayerNameEx(playerid), adminstring);
- SendAdminMessage(COLOR_CYAN, adminstring);
- }
- return 1;
- }
- COMMAND:b(playerid, params[])
- {
- new text[256],stringorr[256],sendername[MAX_PLAYER_NAME];
- if(sscanf(params, "s[256]", text)) SendClientMessage(playerid, COLOR_WHITE, ""DCOLOR_BLUE"Syntax: "DCOLOR_WHITE"/b [OOC message]");
- else
- {
- format(sendername, sizeof(sendername), "%s", PlayerNameEx(playerid));
- GiveNameSpace(sendername);
- format(stringorr, sizeof(stringorr), "(( (ID:%i) %s: %s ))", playerid, PlayerNameEx(playerid), text);
- SendOOCMessage(20.0, playerid, stringorr);
- }
- return 1;
- }
- COMMAND:hp(playerid, params[])
- {
- new Float:ammun;
- if(sscanf(params, "f", ammun)) return SendClientMessage(playerid, COLOR_WHITE, ""DCOLOR_BLUE"Syntax: "DCOLOR_WHITE"/hp [Health points]");
- else
- {
- SetPlayerHealth(playerid, ammun);
- }
- return 1;
- }
- COMMAND:sethp(playerid, params[])
- {
- if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, COLOR_RED, "Error: You must be an admin to use this command.");
- new target, Float:ammun;
- if(sscanf(params, "uf", target, ammun)) return SendClientMessage(playerid, COLOR_WHITE, ""DCOLOR_BLUE"Syntax: "DCOLOR_WHITE"/sethp [Player ID/Name] [Health points]");
- else
- {
- SetPlayerHealth(target, ammun);
- }
- return 1;
- }
- COMMAND:kevlar(playerid, params[])
- {
- new Float:aammun;
- if(sscanf(params, "f", aammun)) return SendClientMessage(playerid, COLOR_WHITE, ""DCOLOR_BLUE"Syntax: "DCOLOR_WHITE"/kevlar [Kevlar points]");
- else
- {
- SetPlayerArmour(playerid, aammun);
- }
- return 1;
- }
- COMMAND:setkevlar(playerid, params[])
- {
- if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, COLOR_RED, "Error: You must be an admin to use this command.");
- new target, Float:aammun;
- if(sscanf(params, "uf", target, aammun)) return SendClientMessage(playerid, COLOR_WHITE, ""DCOLOR_BLUE"Syntax: "DCOLOR_WHITE"/setkevlar [Player ID/Name] [Kevlar points]");
- else
- {
- SetPlayerArmour(target, aammun);
- }
- return 1;
- }
- COMMAND:setskin(playerid, params[])
- {
- if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, COLOR_RED, "Error: You must be an admin to use this command.");
- new id, skinid, string[142];
- if(sscanf(params, "ui", id, skinid)) return SendClientMessage(playerid, COLOR_WHITE, ""DCOLOR_BLUE"Syntax: "DCOLOR_WHITE"/setskin [Player ID/Name] [Skin ID]");
- else
- {
- if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_RED, "Error: Invalid player ID.");
- if(skinid > 312 || skinid < 0) return SendClientMessage(playerid, COLOR_RED, "Error: Invalid skin ID.");
- SetPlayerSkin(id, skinid);
- format(string, 142, "Admin: (ID:%i) %s has set your skin to ID %i.", playerid, PlayerName(playerid), skinid);
- SendClientMessage(id, COLOR_LIGHTBLUE, string);
- if(playerid != id)
- {
- format(string, 142, "Admin: You've set (ID:%i) %s's skin to ID %i.", id, PlayerName(id), skinid);
- SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
- }
- }
- return 1;
- }
- COMMAND:skin(playerid, params[])
- {
- new skinid;
- if(sscanf(params, "i", skinid)) return SendClientMessage(playerid, COLOR_WHITE, ""DCOLOR_BLUE"Syntax: "DCOLOR_WHITE"/skin [Skin ID]");
- else
- {
- if(skinid > 312 || skinid < 0) return SendClientMessage(playerid, COLOR_RED, "Error: Invalid skin ID.");
- else
- SetPlayerSkin(playerid, skinid);
- }
- return 1;
- }
- COMMAND:givegun(playerid, params[])
- {
- if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, COLOR_RED, "Error: You must be an admin to use this command.");
- new target, gun, gstring[128];
- if(sscanf(params, "ud", target, gun)) return SendClientMessage(playerid, COLOR_WHITE, ""DCOLOR_BLUE"Syntax: "DCOLOR_WHITE"/givegun [Player ID/Name] [Weapon ID]");
- if(gun < 1 || gun > 47) { SendClientMessage(playerid, COLOR_RED, "Error: Use a weapon ID from 1 to 47."); return 1; }
- if(IsPlayerConnected(target))
- {
- if(target != INVALID_PLAYER_ID && gun <= 20 || gun >= 22)
- {
- GivePlayerWeapon(target, gun, 1200);
- format(gstring, sizeof(gstring), "Admin: (ID:%i) %s got a weapon ID:%i from you.", target, PlayerName(target), gun);
- SendClientMessage(playerid, COLOR_LIGHTBLUE, gstring);
- format(gstring, sizeof(gstring), "Admin: %s gave you a weapon ID:%i.", PlayerName(playerid), gun);
- SendClientMessage(target, COLOR_LIGHTBLUE, gstring);
- }
- }
- else
- SendClientMessage(playerid, COLOR_RED, "Error: Invalid player ID.");
- return 1;
- }
- COMMAND:gun(playerid, params[])
- {
- new gun;
- if(sscanf(params, "d", gun)) return SendClientMessage(playerid, COLOR_WHITE, ""DCOLOR_BLUE"Syntax: "DCOLOR_WHITE"/gun [Weapon ID]");
- if(gun < 1 || gun > 47) { SendClientMessage(playerid, COLOR_RED, "Error: Use a weapon ID from 1 to 47."); return 1; }
- if(gun <= 20 || gun >= 22)
- {
- GivePlayerWeapon(playerid, gun, 500);
- }
- return 1;
- }
- COMMAND:goto(playerid, params[])
- {
- //if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, COLOR_RED, "Error: You must be an admin to use this command.");
- new id, string[128], sendername[MAX_PLAYER_NAME];
- if(sscanf(params, "u", id)) return SendClientMessage(playerid, COLOR_WHITE, ""DCOLOR_BLUE"Syntax: "DCOLOR_WHITE"/goto [Player ID/Name]");
- if(!IsPlayerConnected(id)) return SendClientMessage(playerid, COLOR_RED, "Error: Invalid player ID.");
- else if(playerid != id)
- {
- new Float:x, Float:y, Float:z, place;
- place = random(5);
- GetPlayerPos(id, x, y, z);
- SetPlayerVirtualWorld(playerid, GetPlayerVirtualWorld(id));
- SetPlayerInterior(playerid, GetPlayerInterior(id));
- switch(place)
- {
- case 0: SetPlayerPos(playerid, x+1, y, z);
- case 1: SetPlayerPos(playerid, x+1, y+1, z);
- case 2: SetPlayerPos(playerid, x-1, y, z);
- case 3: SetPlayerPos(playerid, x-1, y-1, z);
- case 4: SetPlayerPos(playerid, x-1, y+1, z);
- case 5: SetPlayerPos(playerid, x+1, y-1, z);
- }
- }
- format(sendername, sizeof(sendername), "%s", PlayerNameEx(id));
- GiveNameSpace(sendername);
- format(string, sizeof(string), "Server: You've teleported to (ID:%i) %s.", id, sendername);
- SendClientMessage(playerid, COLOR_WHITE, string);
- return 1;
- }
- COMMAND:get(playerid, params[])
- {
- if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, COLOR_RED, "Error: You must be an admin to use this command.");
- new id, string[128], sendername[MAX_PLAYER_NAME];
- if(sscanf(params, "u", id)) return SendClientMessage(playerid, COLOR_WHITE, ""DCOLOR_BLUE"Syntax: "DCOLOR_WHITE"/get [Player ID/Name]");
- if(!IsPlayerConnected(id)) return SendClientMessage(playerid, COLOR_RED, "Error: Invalid player ID.");
- else if(playerid != id)
- {
- new Float:x, Float:y, Float:z;
- GetPlayerPos(playerid, x, y, z);
- SetPlayerVirtualWorld(id, GetPlayerVirtualWorld(id));
- SetPlayerInterior(id, GetPlayerInterior(playerid));
- SetPlayerPos(id, x, y, z);
- }
- format(sendername, sizeof(sendername), "%s", PlayerName(id));
- GiveNameSpace(sendername);
- format(string, sizeof(string), "Admin: You've teleported (ID:%i) %s to yourself.", id, sendername);
- SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
- format(sendername, sizeof(sendername), "%s", PlayerName(playerid));
- GiveNameSpace(sendername);
- format(string, sizeof(string), "Admin: You've been teleported to (ID:%i) %s.", playerid, sendername);
- SendClientMessage(id, COLOR_LIGHTBLUE, string);
- return 1;
- }
- COMMAND:me(playerid, params[])
- {
- new text[256], string[256], sendername[MAX_PLAYER_NAME];
- if(sscanf(params, "s[256]", text)) SendClientMessage(playerid, COLOR_WHITE, ""DCOLOR_BLUE"Syntax: "DCOLOR_WHITE"/me [action]");
- else
- {
- format(sendername, sizeof(sendername), "%s", PlayerNameEx(playerid));
- GiveNameSpace(sendername);
- format(string, sizeof(string), "* %s %s", sendername, text);
- ProxDetector(30.0, playerid, string, COLOR_PURPLE);
- //SetPlayerChatBubble(playerid, string, COLOR_PURPLE, 30.0, 10000);
- }
- return 1;
- }
- COMMAND:shout(playerid, params[])
- {
- new text[128], string[256], sendername[MAX_PLAYER_NAME];
- if(sscanf(params, "s[128]", text)) SendClientMessage(playerid, COLOR_GREY, ""DCOLOR_BLUE"Syntax: "DCOLOR_WHITE"/shout [text]");
- else
- {
- format(sendername, sizeof(sendername), "%s", PlayerNameEx(playerid));
- GiveNameSpace(sendername);
- format(string, sizeof(string), "%s shouts: %s", sendername, text);
- ProxDetector(50.0, playerid, string, COLOR_FADE);
- SetPlayerChatBubble(playerid, string, COLOR_FADE, 30.0, strlen(text)*100);
- }
- return 1;
- }
- ALTCOMMAND:s->shout;
- COMMAND:low(playerid, params[])
- {
- new text[128], string[256], sendername[MAX_PLAYER_NAME];
- if(sscanf(params, "s[128]", text)) SendClientMessage(playerid, COLOR_GREY, ""DCOLOR_BLUE"Syntax: "DCOLOR_WHITE"/low [text]");
- else
- {
- format(sendername, sizeof(sendername), "%s", PlayerNameEx(playerid));
- GiveNameSpace(sendername);
- format(string, sizeof(string), "%s says [LOW]: %s", sendername, text);
- ProxDetector(5.0, playerid, string, COLOR_GREY);
- }
- return 1;
- }
- COMMAND:do(playerid, params[])
- {
- new text[256], string[256], sendername[MAX_PLAYER_NAME];
- if(sscanf(params, "s[256]", text)) SendClientMessage(playerid, COLOR_WHITE, ""DCOLOR_BLUE"Syntax: "DCOLOR_WHITE" /do [text]");
- else
- {
- format(sendername, sizeof(sendername), "%s", PlayerNameEx(playerid));
- GiveNameSpace(sendername);
- format(string, sizeof(string), "* %s (( %s ))", text, sendername);
- ProxDetector(30.0, playerid, string, COLOR_PURPLE);
- }
- return 1;
- }
- COMMAND:whisper(playerid, params[])
- {
- new text[128], targetid,string[128], sendername[MAX_PLAYER_NAME], giveplayer[MAX_PLAYER_NAME];
- if(sscanf(params, "us[128]", targetid, text)) SendClientMessage(playerid, COLOR_WHITE, ""DCOLOR_BLUE"Syntax: "DCOLOR_WHITE"/w [Player ID/Name] [message]");
- else
- {
- if (playerid == targetid) return SendClientMessage(playerid, COLOR_RED, "Error: You can not whisper to yourself.");
- if(IsPlayerConnected(targetid))
- {
- if(PlayerToPlayer(playerid,targetid,5.0))
- {
- format(sendername, sizeof(sendername), "%s", PlayerNameEx(playerid));
- format(giveplayer, sizeof(giveplayer), "%s", PlayerNameEx(targetid));
- GiveNameSpace(sendername);
- GiveNameSpace(giveplayer);
- format(string, sizeof(string), "*** %s whispers something to %s.", sendername, giveplayer);
- SetPlayerChatBubble(playerid, string, COLOR_PURPLE, 30.0, 10000);
- format(string, sizeof(string), "%s whispers: %s", sendername, text);
- SendSplitClientMessage(targetid, COLOR_YELLOW, string);
- SendSplitClientMessage(playerid, COLOR_YELLOW, string);
- }
- else
- {
- SendClientMessage(playerid,COLOR_RED,"Error: You are too far away from that player.");
- }
- }
- }
- return 1;
- }
- ALTCOMMAND:w->whisper;
- COMMAND:pm(playerid, params[])
- {
- new text[256], targetid, string[256];
- if(sscanf(params, "us[128]", targetid, text)) SendClientMessage(playerid, COLOR_WHITE, ""DCOLOR_BLUE"Syntax: "DCOLOR_WHITE"/pm [Player ID/Name] [message]");
- else
- {
- if (playerid == targetid) return SendClientMessage(playerid, COLOR_RED, "Error: You may not PM yourself.");
- if(IsPlayerConnected(targetid))
- {
- format(string, sizeof(string), "(( PM from %s (ID:%i): %s ))", PlayerName(playerid), playerid, text);
- SendSplitClientMessage(targetid, COLOR_YELLOW, string);
- format(string, sizeof(string), "(( PM sent to %s (ID:%i): %s ))", PlayerName(targetid), targetid, text);
- SendSplitClientMessage(playerid, COLOR_YELLOW, string);
- }
- else SendClientMessage(playerid, COLOR_RED, "Error: Player is offline.");
- }
- return 1;
- }
- COMMAND:debug(playerid, params[])
- {
- if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, COLOR_RED, "Error: You must be an admin to use this command.");
- new id, tpstring[128];
- if(sscanf(params, "u", id)) return SendClientMessage(playerid, COLOR_WHITE, ""DCOLOR_BLUE"Syntax: "DCOLOR_WHITE"/debug [Player ID/Name]");
- if(!IsPlayerConnected(id)) return SendClientMessage(playerid, COLOR_RED, "Error: Invalid player ID.");
- format(tpstring, sizeof(tpstring), "Admin: You've debugged (ID:%i) %s and teleported him/her to Los Santos.", id, PlayerName(id));
- SendClientMessage(playerid, COLOR_LIGHTBLUE, tpstring);
- if(IsPlayerInAnyVehicle(playerid))
- {
- SetVehiclePos(GetPlayerVehicleID(id), 1513.2799,-1658.9572,13.5392);
- }
- else
- {
- SetPlayerPos(id,1513.2799,-1658.9572,13.5392);
- SetPlayerFacingAngle(id, 268.7108);
- }
- SetPlayerInterior(id, 0);
- SetPlayerVirtualWorld(id, 0);
- return 1;
- }
- COMMAND:acar(playerid, params[])
- {
- new carid, carcolor1, carcolor2;
- if(!sscanf(params, "iii", carid, carcolor1, carcolor2))
- {
- new sendername[MAX_PLAYER_NAME];
- GetPlayerName(playerid, sendername, sizeof(sendername));
- if(carid >= 400 && carid <= 611)
- {
- if(carcolor1 >= 0 && carcolor1 <= 252)
- {
- if(carcolor2 >= 0 && carcolor2 <= 252)
- {
- new veh;
- new Float:XZ, Float:YZ, Float:ZZ, Float:angle;
- GetPlayerFacingAngle(playerid, angle);
- GetPlayerPos(playerid, XZ, YZ, ZZ);
- veh = CreateVehicle(carid, XZ, YZ, ZZ, angle, carcolor1, carcolor2, 0);
- SetVehicleVirtualWorld( veh , GetPlayerVirtualWorld(playerid));
- LinkVehicleToInterior(veh, GetPlayerInterior(playerid));
- acarInfo[veh][Created] = 1;
- strmid(acarInfo[veh][Owner], sendername, 0, strlen(sendername), 255);
- SendClientMessage(playerid,COLOR_LIGHTBLUE,"Admin: Vehicle created. Use /delcar to delete your last spawned vehicle.");
- PutPlayerInVehicle(playerid, veh, 0);
- return 1;
- }
- else return SendClientMessage(playerid, COLOR_RED, "Error: Use color IDs between 0 and 252.");
- }
- else return SendClientMessage(playerid, COLOR_RED, "Error: Use color IDs between 0 and 252.");
- }
- else return SendClientMessage(playerid, COLOR_RED, "Error: Use vehicle IDs from 400 too 611.");
- }
- else return SendClientMessage(playerid, COLOR_WHITE, ""DCOLOR_BLUE"Syntax: "DCOLOR_WHITE"/acar [Vehicle ID] [Color 1] [Color 2]");
- }
- COMMAND:delcar(playerid, params[])
- {
- new sendername[MAX_PLAYER_NAME];
- GetPlayerName(playerid, sendername, sizeof(sendername));
- for(new car = 0; car < MAX_VEHICLES; car++)
- if(acarInfo[car][Created] == 1)
- {
- if(strcmp(acarInfo[car][Owner], sendername, true) == 0)
- {
- SendClientMessage(playerid, COLOR_LIGHTBLUE, "Admin: Vehicle has been despawned.");
- DestroyVehicle(car);
- acarInfo[car][Created] = 0;
- return 1;
- }
- }
- return 1;
- }
- COMMAND:kick(playerid, params[])
- {
- if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, COLOR_RED, "Error: You must be an admin to use this command.");
- new gocha, reason[128];
- if(sscanf(params, "us[128]", gocha, reason)) return SendClientMessage(playerid, COLOR_WHITE, ""DCOLOR_BLUE"Syntax: "DCOLOR_WHITE"/kick [Player ID/Name] [Reason]");
- else
- {
- KickWithMessage(gocha, COLOR_LIGHTRED, reason);
- }
- return 1;
- }
- COMMAND:slap(playerid, params[])
- {
- if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, COLOR_RED, "Error: You must be an admin to use this command.");
- new kkid;
- if(sscanf(params, "u", kkid)) return SendClientMessage(playerid, COLOR_WHITE, ""DCOLOR_BLUE"Syntax: "DCOLOR_WHITE"/slap [Player ID/Name]");
- else
- {
- if (!IsPlayerConnected(kkid)) return SendClientMessage(playerid, COLOR_RED, "Error: Player ID offline.");
- else
- {
- new Float:ppx, Float:ppy, Float:ppz;
- GetPlayerPos(kkid, ppx, ppy, ppz);
- SetPlayerPos(kkid, ppx, ppy, ppz+5.0);
- }
- }
- return 1;
- }
- COMMAND:unslap(playerid, params[])
- {
- if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, COLOR_RED, "Error: You must be an admin to use this command.");
- new kkid;
- if(sscanf(params, "u", kkid)) return SendClientMessage(playerid, COLOR_WHITE, ""DCOLOR_BLUE"Syntax: "DCOLOR_WHITE"/slap [Player ID/Name]");
- else
- {
- if (!IsPlayerConnected(kkid)) return SendClientMessage(playerid, COLOR_RED, "Error: Player ID offline.");
- else
- {
- new Float:ppx, Float:ppy, Float:ppz;
- GetPlayerPos(kkid, ppx, ppy, ppz);
- SetPlayerPos(kkid, ppx, ppy, ppz-2.0);
- }
- }
- return 1;
- }
- ALTCOMMAND:down->unslap;
- COMMAND:f(playerid, params[])
- {
- new text[256], sendername[MAX_PLAYER_NAME], string[256];
- if(sscanf(params, "s[256]", text)) SendClientMessage(playerid, COLOR_WHITE, ""DCOLOR_BLUE"Syntax: "DCOLOR_WHITE"/f [faction message]");
- else
- {
- GetPlayerName(playerid, sendername, MAX_PLAYER_NAME);
- GiveNameSpace(sendername);
- format(string, sizeof(string), "**(( Officer %s: %s ))**", sendername, text);
- foreach(Player, i)
- {
- SendSplitClientMessage(i,COLOR_BLUE,string);
- }
- }
- return 1;
- }
- COMMAND:fix(playerid)
- {
- if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, 0xFFFFFFFF, "You are not in a vehicle!");
- else
- {
- RepairVehicle(GetPlayerVehicleID(playerid));
- SendClientMessage(playerid, 0xFFFFFFFF, "Your vehicle has been repaired!");
- }
- return 1;
- }
- COMMAND:r(playerid, params[])
- {
- new text[256], sendername[MAX_PLAYER_NAME], string[256];
- if(sscanf(params, "s[256]", text)) SendClientMessage(playerid, COLOR_WHITE, ""DCOLOR_BLUE"Syntax: "DCOLOR_WHITE"/f [faction message]");
- else
- {
- GetPlayerName(playerid, sendername, MAX_PLAYER_NAME);
- GiveNameSpace(sendername);
- format(string, sizeof(string), "**[Radio] %s: %s **", sendername, text);
- foreach(Player, i)
- {
- SendSplitClientMessage(i,COLOR_BLUE,string);
- }
- }
- return 1;
- }
- COMMAND:mark(playerid)
- {
- if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, COLOR_RED, "Error: You must be an admin to use this command.");
- else
- {
- GetPlayerPos(playerid, markx, marky, markz);
- markvw = GetPlayerVirtualWorld(playerid);
- markint = GetPlayerInterior(playerid);
- SendClientMessage(playerid, COLOR_LIGHTBLUE, "Admin: Position has been marked.");
- }
- return 1;
- }
- COMMAND:mark2(playerid)
- {
- if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, COLOR_RED, "Error: You must be an admin to use this command.");
- else
- {
- GetPlayerPos(playerid, markx2, marky2, markz2);
- markvw2 = GetPlayerVirtualWorld(playerid);
- markint2 = GetPlayerInterior(playerid);
- SendClientMessage(playerid, COLOR_LIGHTBLUE, "Admin: 2nd position has been marked.");
- }
- return 1;
- }
- COMMAND:gotomark(playerid)
- {
- SetPlayerPos(playerid, markx, marky, markz);
- SetPlayerVirtualWorld(playerid, markvw);
- SetPlayerInterior(playerid, markint);
- return 1;
- }
- COMMAND:gotomark2(playerid)
- {
- SetPlayerPos(playerid, markx2, marky2, markz2);
- SetPlayerVirtualWorld(playerid, markvw2);
- SetPlayerInterior(playerid, markint2);
- return 1;
- }
- COMMAND:pdhq(playerid)
- {
- SetPlayerPos(playerid, 1529.2416, -1676.9371, 5.8906);
- SetPlayerVirtualWorld(playerid, 0);
- SetPlayerInterior(playerid, 0);
- return 1;
- }
- COMMAND:training(playerid)
- {
- SetPlayerPos(playerid, 1924.1031, 704.3874, 11.1328);
- SetPlayerVirtualWorld(playerid, 0);
- SetPlayerInterior(playerid, 0);
- return 1;
- }
- COMMAND:mask(playerid)
- {
- if(masked[playerid])
- {
- foreach(Player, hideme)
- {
- ShowPlayerNameTagForPlayer(hideme, playerid, 1);
- }
- masked[playerid] = false;
- GameTextForPlayer(playerid, "~w~Mask ~r~OFF", 5000, 6);
- }
- else
- {
- foreach(Player, hideme)
- {
- ShowPlayerNameTagForPlayer(hideme, playerid, 0);
- }
- masked[playerid] = true;
- GameTextForPlayer(playerid, "~w~Mask ~g~ON", 5000, 6);
- }
- return 1;
- }
- COMMAND:duty(playerid)
- {
- new dutystring[128];
- format(dutystring, sizeof(dutystring), "HQ: %s has gone on duty.", PlayerNameEx(playerid));
- SendClientMessageToAll(COLOR_BLUE, dutystring);
- SetPlayerHealth(playerid, 150.0);
- SetPlayerArmour(playerid, 100.0);
- SetPlayerColor(playerid, COLOR_BLUE);
- GivePlayerWeapon(playerid, 31, 500);
- GivePlayerWeapon(playerid, 29, 500);
- GivePlayerWeapon(playerid, 25, 500);
- GivePlayerWeapon(playerid, 24, 500);
- new i;
- for(i = 0; i < MAX_PLAYERS; ++i)
- {
- if(IsPlayerConnected(i))
- {
- SetPlayerMarkerForPlayer( i, playerid, GetPlayerColor( playerid ) & 0xFFFFFF00);
- }
- }
- return 1;
- }
- COMMAND:offduty(playerid)
- {
- new dutystring[128];
- format(dutystring, sizeof(dutystring), "HQ: %s has gone off duty.", PlayerNameEx(playerid));
- SendClientMessageToAll(COLOR_BLUE, dutystring);
- SetPlayerHealth(playerid, 150.0);
- SetPlayerArmour(playerid, 0.0);
- SetPlayerColor(playerid, COLOR_WHITE);
- new i;
- for(i = 0; i < MAX_PLAYERS; ++i)
- {
- if(IsPlayerConnected(i))
- {
- SetPlayerMarkerForPlayer( i, playerid, GetPlayerColor( playerid ) & 0xFFFFFF00);
- }
- }
- return 1;
- }
- COMMAND:swat(playerid)
- {
- new dutystring[128];
- format(dutystring, sizeof(dutystring), "HQ: %s SWAT Operator is ready for orders!", PlayerNameEx(playerid));
- SendClientMessageToAll(COLOR_BLUE, dutystring);
- SetPlayerHealth(playerid, 150.0);
- SetPlayerArmour(playerid, 200.0);
- SetPlayerColor(playerid, COLOR_BLUE);
- GivePlayerWeapon(playerid, 31, 500);
- GivePlayerWeapon(playerid, 27, 500);
- GivePlayerWeapon(playerid, 34, 500);
- GivePlayerWeapon(playerid, 24, 500);
- SetPlayerSkin(playerid, 285);
- new i;
- for(i = 0; i < MAX_PLAYERS; ++i)
- {
- if(IsPlayerConnected(i))
- {
- SetPlayerMarkerForPlayer( i, playerid, GetPlayerColor( playerid ) & 0xFFFFFF00);
- }
- }
- return 1;
- }
- COMMAND:criminal(playerid)
- {
- new dutystring[128];
- format(dutystring, sizeof(dutystring), "HQ: %s has gone on criminal duty.", PlayerNameEx(playerid));
- SendClientMessageToAll(COLOR_BLUE, dutystring);
- SetPlayerHealth(playerid, 150.0);
- SetPlayerArmour(playerid, 0.0);
- SetPlayerColor(playerid, COLOR_WHITE);
- SetPlayerSkin(playerid, 29);
- GivePlayerWeapon(playerid, 30, 500);
- GivePlayerWeapon(playerid, 29, 500);
- GivePlayerWeapon(playerid, 25, 500);
- new i;
- for(i = 0; i < MAX_PLAYERS; ++i)
- {
- if(IsPlayerConnected(i))
- {
- SetPlayerMarkerForPlayer( i, playerid, GetPlayerColor( playerid ) & 0xFFFFFF00);
- }
- }
- return 1;
- }
- COMMAND:taser(playerid)
- {
- new string[128];
- if(taserer[playerid])
- {
- GivePlayerWeapon(playerid, 24, 140);
- SetPlayerArmedWeapon(playerid, 24);
- taserer[playerid] = false;
- format(string, sizeof(string), "*** %s holsters their taser.", PlayerNameEx(playerid));
- SendClientMessage(playerid, COLOR_PURPLE, string);
- SetPlayerChatBubble(playerid, string, COLOR_PURPLE, 20.0, 5000);
- }
- else
- {
- GivePlayerWeapon(playerid, 23, 10);
- SetPlayerArmedWeapon(playerid, 23);
- taserer[playerid] = true;
- format(string, sizeof(string), "*** %s unholsters their taser.", PlayerNameEx(playerid));
- SendClientMessage(playerid, COLOR_PURPLE, string);
- SetPlayerChatBubble(playerid, string, COLOR_PURPLE, 20.0, 5000);
- }
- return 1;
- }
- COMMAND:respawn(playerid)
- {
- SpawnPlayer(playerid);
- return 1;
- }
- stock Bodyname(abodypart)
- {
- new bname[16];
- switch(abodypart)
- {
- case 3: format(bname, sizeof(bname), "CHEST");
- case 4: format(bname, sizeof(bname), "GROIN");
- case 5: format(bname, sizeof(bname), "L ARM");
- case 6: format(bname, sizeof(bname), "R ARM");
- case 7: format(bname, sizeof(bname), "L LEG");
- case 8: format(bname, sizeof(bname), "R LEG");
- case 9: format(bname, sizeof(bname), "HEAD");
- default: format(bname, sizeof(bname), "UNKNOWN");
- }
- return bname;
- }
- stock GunNameEx(weaponid)
- {
- new string[25];
- switch (weaponid)
- {
- case 0: format(string, sizeof(string), "Knuckle");
- case 1: format(string, sizeof(string), "Boxer");
- case 2: format(string, sizeof(string), "Golf bat");
- case 3: format(string, sizeof(string), "Baton");
- case 4: format(string, sizeof(string), "Knife");
- case 5: format(string, sizeof(string), "Baseball bat");
- case 6: format(string, sizeof(string), "Shovel");
- case 7: format(string, sizeof(string), "Pool cue");
- case 8: format(string, sizeof(string), "Katana");
- case 9: format(string, sizeof(string), "Chainsaw");
- case 10: format(string, sizeof(string), "Purple vibrator");
- case 11: format(string, sizeof(string), "Dildo");
- case 12: format(string, sizeof(string), "Vibrator");
- case 13: format(string, sizeof(string), "Vibrator");
- case 14: format(string, sizeof(string), "Flowers");
- case 15: format(string, sizeof(string), "Cane");
- case 16: format(string, sizeof(string), "Grenade");
- case 17: format(string, sizeof(string), "Smoke Grenade");
- case 18: format(string, sizeof(string), "Molotov Cocktail");
- case 19: format(string, sizeof(string), "(?) Vehicle Rocker");
- case 20: format(string, sizeof(string), "(?)Hydra Flare");
- case 21: format(string, sizeof(string), "(?)Jetpack");
- case 22: format(string, sizeof(string), "Glock");
- case 23: format(string, sizeof(string), "TASER");
- case 24: format(string, sizeof(string), "DEAGLE");
- case 25: format(string, sizeof(string), "SHOTGUN");
- case 26: format(string, sizeof(string), "SAWNOFF");
- case 27: format(string, sizeof(string), "SPAS12");
- case 28: format(string, sizeof(string), "UZI");
- case 29: format(string, sizeof(string), "MP5");
- case 30: format(string, sizeof(string), "AK47");
- case 31: format(string, sizeof(string), "M4");
- case 32: format(string, sizeof(string), "TEC9");
- case 33: format(string, sizeof(string), "RIFLE");
- case 34: format(string, sizeof(string), "SNIPER");
- case 35: format(string, sizeof(string), "Rocket Launcher");
- case 36: format(string, sizeof(string), "HS Rocket Launcher");
- case 37: format(string, sizeof(string), "Flamethrower");
- case 38: format(string, sizeof(string), "Minigun");
- case 39: format(string, sizeof(string), "C4");
- case 40: format(string, sizeof(string), "Detonator");
- case 41: format(string, sizeof(string), "Pepper Spray");
- case 42: format(string, sizeof(string), "Fire Extinguisher");
- case 43: format(string, sizeof(string), "Camera");
- }
- return string;
- }
- COMMAND:damages(playerid, params[])
- {
- new cdead;
- if(sscanf(params, "u", cdead)) return SendClientMessage(playerid, COLOR_WHITE, ""DCOLOR_BLUE"Syntax: "DCOLOR_WHITE"/damages [Player ID/Name]");
- else
- {
- new dmgstring[1280], dtitle[64], line[256], injured = false;
- new dee;
- strcat(dmgstring, "Bodypart\tWeapon\tDamage\tWound\n");
- for(dee = 0; dee < 20; ++dee)
- {
- if(pdamage[cdead][hit][dee] > 0)
- {
- injured = true;
- if(pdamage[cdead][kevlar] == 1)
- format(line, sizeof(line), "%s\t%s\tDMG:%d\tKEVLAR\n", Bodyname(pdamage[cdead][hit][dee]), GunNameEx(pdamage[cdead][hit][dee]), pdamage[cdead][tdamage][dee]);
- else
- format(line, sizeof(line), "%s\t%s\tDMG:%d\tFLESH\n", Bodyname(pdamage[cdead][hit][dee]), GunNameEx(pdamage[cdead][hit][dee]), pdamage[cdead][tdamage][dee]);
- strcat(dmgstring, line);
- }
- }
- format(dtitle, sizeof(dtitle), "Damages of %s", PlayerNameEx(cdead));
- if(injured)
- ShowPlayerDialog(playerid, DIALOG_SHOW_HELP, DIALOG_STYLE_TABLIST_HEADERS, dtitle, dmgstring, "Close", "");
- else
- SendClientMessage(playerid, COLOR_RED, "Error: The selected player has no injuries or he has already respawned.");
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement