Advertisement
Dayrion

lapd

May 14th, 2016
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 3.41 KB | None | 0 0
  1. #include <foreach>
  2.  
  3. stock duty(playerid)
  4. {
  5.     return (IsOnDuty[playerid] ? true : false);
  6. }
  7.  
  8. //------------------------------------------------------------------------------------------------
  9. // ==============================================================================================
  10. //                            Los Angeles Police Department | Commands
  11. // ==============================================================================================
  12. //------------------------------------------------------------------------------------------------
  13. new bool:IsOnDuty[MAX_PLAYERS] = false;
  14.  
  15. CMD:duty(playerid,params[])
  16. {
  17.     //if(!IsPlayerInRangeOfPoint(playerid, range, x, y, z)) return SendClientMessage(playerid, -1, "[{82CAFF}Infomation{FFFFFF}] You must be at the comico'");;
  18.     if(IsOnDuty[playerid] == false)
  19.     {
  20.         new str[128];
  21.         IsOnDuty[playerid] = true;
  22.         SendClientMessage(playerid, -1, "[{82CAFF}Infomation{FFFFFF}] You are now on duty");
  23.         format(str, sizeof(str), "* %s take his badge, weapon and radio.", GetName(playerid));
  24.         ProxDetector(15, playerid, str, 0xCC56CCFF);
  25.         SetPlayerArmour(playerid, 100.0);
  26.         GivePlayerWeapon(playerid, WEAPON_DEAGLE, 100);
  27.         GivePlayerWeapon(playerid, WEAPON_NITESTICK, 1);
  28.         GivePlayerWeapon(playerid, WEAPON_SPRAYCAN, 1000);
  29.         return 1;
  30.     }
  31.     else
  32.     {
  33.         new str[128];
  34.         IsOnDuty[playerid] = false;
  35.         SendClientMessage(playerid, -1, "[{82CAFF}Infomation{FFFFFF}] You are no longer on duty");
  36.         format(str, sizeof(str), "* %s put his badge, weapon, radio into his locker.", GetName(playerid));
  37.         ProxDetector(15, playerid, str, 0xCC56CCFF);
  38.         SetPlayerArmour(playerid, 0.0);
  39.         ResetPlayerWeapons(playerid);
  40.         return 1;
  41.     }
  42. }
  43.  
  44.  
  45. //------------------------------------------------------------------------------------------------
  46.  
  47. CMD:m(playerid, params[])
  48. {
  49.     if(!duty(playerid)) return SendClientMessage(playerid, -1, "[{82CAFF}Error{FFFFFF}] You aren't allowed to use this command");
  50.     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");
  51.     new text[150];
  52.     if(sscanf(params, "s[149]", text)) return SendClientMessage(playerid, -1, "[{82CAFF}Use{FFFFFF}] /m [Message]");
  53.     format(text, sizeof(text), "{ff0000}((%s | %s)) {FFFFFF}%s", GetName(playerid), Factions[U_Stats[playerid][pFaction]-1][fShortName], text);
  54.     ProxDetector(30, playerid, text, -1);
  55.     return 1;
  56. }
  57.  
  58.  
  59. //------------------------------------------------------------------------------------------------
  60.  
  61. CMD:r(playerid, params[])
  62. {
  63.     if(!duty(playerid)) return SendClientMessage(playerid, -1, "[{82CAFF}Error{FFFFFF}] You need be on duty");
  64.     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");
  65.     new text[150];
  66.     if(sscanf(params, "s[149]", text)) return SendClientMessage(playerid, -1, "[{82CAFF}Use{FFFFFF}] /r [Message]");
  67.     foreach(new i : Player)
  68.     {
  69.         if(U_Stats[playerid][pFaction] != U_Stats[i][pFaction]) continue;
  70.         format(text, sizeof(text), "(Radio) %s : %s", GetName(playerid), text);
  71.         SendClientMessage(i, 0x336BA3FF, text);
  72.     }
  73.     return 1;
  74. }
  75.  
  76. //------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement