Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <foreach>
- stock duty(playerid)
- {
- return (IsOnDuty[playerid] ? true : false);
- }
- //------------------------------------------------------------------------------------------------
- // ==============================================================================================
- // Los Angeles Police Department | Commands
- // ==============================================================================================
- //------------------------------------------------------------------------------------------------
- new bool:IsOnDuty[MAX_PLAYERS] = false;
- CMD:duty(playerid,params[])
- {
- //if(!IsPlayerInRangeOfPoint(playerid, range, x, y, z)) return SendClientMessage(playerid, -1, "[{82CAFF}Infomation{FFFFFF}] You must be at the comico'");;
- if(IsOnDuty[playerid] == false)
- {
- new str[128];
- IsOnDuty[playerid] = true;
- SendClientMessage(playerid, -1, "[{82CAFF}Infomation{FFFFFF}] You are now on duty");
- format(str, sizeof(str), "* %s take his badge, weapon and radio.", GetName(playerid));
- ProxDetector(15, playerid, str, 0xCC56CCFF);
- SetPlayerArmour(playerid, 100.0);
- GivePlayerWeapon(playerid, WEAPON_DEAGLE, 100);
- GivePlayerWeapon(playerid, WEAPON_NITESTICK, 1);
- GivePlayerWeapon(playerid, WEAPON_SPRAYCAN, 1000);
- return 1;
- }
- else
- {
- new str[128];
- IsOnDuty[playerid] = false;
- SendClientMessage(playerid, -1, "[{82CAFF}Infomation{FFFFFF}] You are no longer on duty");
- format(str, sizeof(str), "* %s put his badge, weapon, radio into his locker.", GetName(playerid));
- ProxDetector(15, playerid, str, 0xCC56CCFF);
- SetPlayerArmour(playerid, 0.0);
- ResetPlayerWeapons(playerid);
- return 1;
- }
- }
- //------------------------------------------------------------------------------------------------
- CMD:m(playerid, params[])
- {
- if(!duty(playerid)) return SendClientMessage(playerid, -1, "[{82CAFF}Error{FFFFFF}] You aren't allowed to use this command");
- if(U_Stats[playerid][pFaction] != 1 && U_Stats[playerid][pFaction] != 2) return SendClientMessage(playerid, -1, "[{82CAFF}Error{FFFFFF}] You aren't allowed to use this command");
- new text[150];
- if(sscanf(params, "s[149]", text)) return SendClientMessage(playerid, -1, "[{82CAFF}Use{FFFFFF}] /m [Message]");
- format(text, sizeof(text), "{ff0000}((%s | %s)) {FFFFFF}%s", GetName(playerid), Factions[U_Stats[playerid][pFaction]-1][fShortName], text);
- ProxDetector(30, playerid, text, -1);
- return 1;
- }
- //------------------------------------------------------------------------------------------------
- CMD:r(playerid, params[])
- {
- if(!duty(playerid)) return SendClientMessage(playerid, -1, "[{82CAFF}Error{FFFFFF}] You need be on duty");
- if(U_Stats[playerid][pFaction] != 1 && U_Stats[playerid][pFaction] != 2) return SendClientMessage(playerid, -1, "[{82CAFF}Error{FFFFFF}] You aren't allowed to use this command");
- new text[150];
- if(sscanf(params, "s[149]", text)) return SendClientMessage(playerid, -1, "[{82CAFF}Use{FFFFFF}] /r [Message]");
- foreach(new i : Player)
- {
- if(U_Stats[playerid][pFaction] != U_Stats[i][pFaction]) continue;
- format(text, sizeof(text), "(Radio) %s : %s", GetName(playerid), text);
- SendClientMessage(i, 0x336BA3FF, text);
- }
- return 1;
- }
- //------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement