07.08.2014, 11:13
Heyy.. who can give me command /take for PD ? /take [ mats , drugs , license , gun ]?
CMD:take(playerid, params[]) { if(IsACop(playerid) || (PlayerInfo[playerid][pFaction] == 5 && PlayerInfo[playerid][pDivision] == 5) || PlayerInfo[playerid][pFaction] == 5 && PlayerInfo[playerid][pDivision] == 2) { if(PlayerInfo[playerid][pRank] < 1 && PlayerInfo[playerid][pFaction] != 2) { SendClientMessage(playerid, COLOR_GREY, " You need to be rank 2 or higher for this action!"); return 1; } new string[128], choice[32], giveplayerid; if(sscanf(params, "s[32]u", choice, giveplayerid)) { SendClientMessage(playerid, COLOR_WHITE, "USAGE: /take [name] [playerid/partofname]"); SendClientMessage(playerid, COLOR_GREY, "Available names: Weapons, Pot, Crack, Cellphone, Radio."); return 1; } if(strcmp(choice,"radio",true) == 0) { if(IsPlayerConnected(giveplayerid)) { if(ProxDetectorS(8.0, playerid, giveplayerid)) { format(string, sizeof(string), "* You have taken away %s's radio.", GetPlayerNameEx(giveplayerid)); SendClientMessage(playerid, COLOR_LIGHTBLUE, string); format(string, sizeof(string), "* Officer %s has taken away your radio.", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid)); SendClientMessage(giveplayerid, COLOR_LIGHTBLUE, string); format(string, sizeof(string), "* Officer %s has taken away %s's radio.", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid)); ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE); PlayerInfo[giveplayerid][pRadio] = 0; PlayerInfo[giveplayerid][pRadioFreq] = 0; } else { SendClientMessage(playerid, COLOR_GREY, "That player isn't near you."); return 1; } } else { SendClientMessage(playerid, COLOR_GREY, "Invalid player specified."); return 1; } } if(strcmp(choice,"cellphone",true) == 0) { if(IsPlayerConnected(giveplayerid)) { if(ProxDetectorS(8.0, playerid, giveplayerid)) { format(string, sizeof(string), "* You have taken away %s's cellphone.", GetPlayerNameEx(giveplayerid)); SendClientMessage(playerid, COLOR_LIGHTBLUE, string); format(string, sizeof(string), "* Officer %s has taken away your cellphone.", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid)); SendClientMessage(giveplayerid, COLOR_LIGHTBLUE, string); format(string, sizeof(string), "* Officer %s has taken away %s's cellphone.", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid)); ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE); PlayerInfo[giveplayerid][pNumber] = 0; } else { SendClientMessage(playerid, COLOR_GREY, "That player isn't near you."); return 1; } } else { SendClientMessage(playerid, COLOR_GREY, "Invalid player specified."); return 1; } } else if(strcmp(choice,"weapons",true) == 0) { if(IsPlayerConnected(giveplayerid)) { if(ProxDetectorS(8.0, playerid, giveplayerid)) { format(string, sizeof(string), "* You have taken away %s's weapons.", GetPlayerNameEx(giveplayerid)); SendClientMessage(playerid, COLOR_LIGHTBLUE, string); format(string, sizeof(string), "* Officer %s has taken away your weapons.", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid)); SendClientMessage(giveplayerid, COLOR_LIGHTBLUE, string); format(string, sizeof(string), "* Officer %s has taken away %s's weapons.", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid)); ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE); ResetPlayerWeaponsEx(giveplayerid); } else { SendClientMessage(playerid, COLOR_GREY, "That player isn't near you."); return 1; } } else { SendClientMessage(playerid, COLOR_GREY, "Invalid player specified."); return 1; } } else if(strcmp(choice,"pot",true) == 0) { if(IsPlayerConnected(giveplayerid)) { if(ProxDetectorS(8.0, playerid, giveplayerid)) { format(string, sizeof(string), "* You have taken away %s's pot.", GetPlayerNameEx(giveplayerid)); SendClientMessage(playerid, COLOR_LIGHTBLUE, string); format(string, sizeof(string), "* Officer %s has taken away your pot.", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid)); SendClientMessage(giveplayerid, COLOR_LIGHTBLUE, string); format(string, sizeof(string), "* Officer %s has taken away %s's pot.", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid)); ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE); PlayerInfo[giveplayerid][pPot] = 0; } else { SendClientMessage(playerid, COLOR_GREY, "That player isn't near you."); return 1; } } else { SendClientMessage(playerid, COLOR_GREY, "Invalid player specified."); return 1; } } else if(strcmp(choice,"crack",true) == 0) { if(IsPlayerConnected(giveplayerid)) { if(ProxDetectorS(8.0, playerid, giveplayerid)) { format(string, sizeof(string), "* You have taken away %s's crack.", GetPlayerNameEx(giveplayerid)); SendClientMessage(playerid, COLOR_LIGHTBLUE, string); format(string, sizeof(string), "* Officer %s has taken away your crack.", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid)); SendClientMessage(giveplayerid, COLOR_LIGHTBLUE, string); format(string, sizeof(string), "* Officer %s has taken away %s's crack.", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid)); ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE); PlayerInfo[giveplayerid][pCrack] = 0; } else { SendClientMessage(playerid, COLOR_GREY, "That player isn't near you."); return 1; } } else { SendClientMessage(playerid, COLOR_GREY, "Invalid player specified."); return 1; } } /*else if(strcmp(choice,"materials",true) == 0) { if(IsPlayerConnected(giveplayerid)) { if(ProxDetectorS(8.0, playerid, giveplayerid)) { format(string, sizeof(string), "* You have taken away %s's materials.", GetPlayerNameEx(giveplayerid)); SendClientMessage(playerid, COLOR_LIGHTBLUE, string); format(string, sizeof(string), "* Officer %s as taken away your materials.", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid)); SendClientMessage(giveplayerid, COLOR_LIGHTBLUE, string); format(string, sizeof(string), "* Officer %s has taken away %s's materials.", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid)); ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE); PlayerInfo[giveplayerid][pMats] = 0; } else { SendClientMessage(playerid, COLOR_GREY, "That player isn't near you."); return 1; } } else { SendClientMessage(playerid, COLOR_GREY, "Invalid player specified."); return 1; } }*/ else { SendClientMessage(playerid, COLOR_GREY, " Invalid item specified."); return 1; } } else { SendClientMessage(playerid, COLOR_GREY, " You're not a law enforcement officer."); return 1; } return 1; }