Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- COMMAND:arrest(playerid, params[])
- {
- if(!IsPlayerLeo(playerid))
- return COMMAND_FOR_LEO;
- if(IsPlayerRestricted(playerid))
- return COMMAND_NO_SPECIAL;
- if(IsPlayerInJail(playerid))
- return COMMAND_NO_JAIL;
- if(IsPlayerInAnyVehicle(playerid))
- return Message(playerid, COLOR_RED, "You can't use this command while inside vehicle");
- if(pData[playerid][Event])
- return COMMAND_NO_EVENT;
- new id;
- if(sscanf(params, "u", id))
- return Usage(playerid, "arrest [playerid]");
- if(!IsPlayerConnected(id))
- return COMMAND_NO_PLAYER;
- if(IsPlayerInJail(id))
- return COMMAND_JAIL_PLAYER;
- new Float:x, Float:y, Float:z;
- GetPlayerPos(id, x, y, z);
- if(GetPlayerInterior(playerid) != GetPlayerInterior(id) || GetPlayerVirtualWorld(playerid) != GetPlayerVirtualWorld(id) || !IsPlayerInRangeOfPoint(playerid, 2.0, x, y, z))
- return ShowNotification(playerid, "Arrest", "You are not near that player");
- if(!IsPlayerCuffed(id))
- return ShowNotification(playerid, "Arrest", "That player is not cuffed, use /cuff to cuff him");
- new wanted = GetPlayerWantedLevel(id);
- if(wanted < 6)
- {
- if(wanted > 0)
- return Message(playerid, COLOR_RED, "You can't arrest low wanted criminal, use /ticket instead");
- else
- return Message(playerid, COLOR_RED, "The player you're trying to arrest, is not a criminal");
- }
- if(IsPlayerInAnyVehicle(id))
- return Message(playerid, COLOR_RED, "That player is inside vehicle");
- new money = (wanted * 110);
- if(pData[id][CuffedBy] != playerid)
- {
- if(IsPlayerConnected(pData[id][CuffedBy]) && IsPlayerLeo(pData[id][CuffedBy]))
- {
- money /= 2;
- GivePlayerMoney(pData[id][CuffedBy], money);
- Message(pData[id][CuffedBy], COLOR_GREEN, "You received $%m for helping your team arresting a criminal", money);
- }
- }
- Message(playerid, COLOR_GREEN, "You have received $%m for arresting %P", money, id);
- GivePlayerMoney(playerid, money);
- GivePlayerGold(playerid, 1);
- Message(id, COLOR_RED, "You have been arrested by %P", playerid);
- new jailtime = wanted * 3;
- MessageAll(COLOR_CYAN, "%P{FFFFFF} has been arrested by %P{FFFFFF} for %d seconds", id, playerid, jailtime);
- SetPlayerCuffed(id, false);
- stop pData[id][CuffedTimer];
- pData[id][CuffedBy] = -1;
- JailPlayer(id, jailtime);
- SetPlayerWantedLevel(id, 0);
- GivePlayerXP(playerid, 15);
- GivePlayerScore(playerid, 1);
- pData[playerid][Arrest]++;
- switch(pData[playerid][Arrest])
- {
- case 1:
- ShowPlayerAchievement(playerid, 27);
- case 20:
- ShowPlayerAchievement(playerid, 28);
- case 50:
- ShowPlayerAchievement(playerid, 29);
- case 100:
- ShowPlayerAchievement(playerid, 30);
- }
- return 1;
- }
Add Comment
Please, Sign In to add comment