command(ar, playerid, params[])
{
new ID; new pname[24]; new opname[24]; GetPlayerName(playerid, pname, 24); new string[200];
if(gTeam[playerid] ==Team_Civi || gTeam[playerid] == Team_Rape || gTeam[playerid] == Team_Terror || gTeam[playerid] == Team_Steal || gTeam[playerid] == Team_PrvtMed)
{
return SendClientMessage(playerid, COLOR_ERROR, "You are not a Law Enforcement officer.");
}
if(IsPlayerInAnyVehicle(playerid))
{
return SendClientMessage(playerid, COLOR_ERROR, "You cannot be in a vehicle to use this command.");
}
if(sscanf(params, "u", ID))
{
return SendClientMessage(playerid, COLOR_ERROR, "Usage: /ar (ID)");
}
if(!IsPlayerConnected(ID))
{
return SendClientMessage(playerid, COLOR_ERROR, "Invalid ID.");
}
GetPlayerName(ID, opname, 24);
if(ID == playerid)
{
return SendClientMessage(playerid, COLOR_ERROR, "You cannot arrest yourself.");
}
if(IsPlayerInAnyVehicle(ID))
{
return SendClientMessage(playerid, COLOR_ERROR, "You cannot arrest a player inside a vehicle.");
}
if(GetPVarInt(ID, "Jailed") == 1)
{
return SendClientMessage(playerid, COLOR_ERROR, "You cannot arrest a jailed person.");
}
if(GetPVarInt(ID, "Cuffed") ==0)
{
return SendClientMessage(playerid, COLOR_ERROR, "You must cuff the player before arresting.");
}
if(GetDistanceBetweenPlayers(playerid, ID) > 3)
{
return SendClientMessage(playerid, COLOR_ERROR, "That player is too far away to arrest.");
}
if(GetPlayerWantedLevel(ID) <= 1)
{
return SendClientMessage(playerid, COLOR_ERROR, "The player must have a warrant before you arrest.");
}
new pwl = GetPlayerWantedLevel(ID);
if(pwl == 3)
{
format(string, sizeof(string), "Police Officer %s(%d) has arrested wanted suspect %s(%d)", pname, playerid, opname, ID);
SendClientMessageToAll(COLOR_BLUE, string);
format(string, sizeof(string), "[POLICE RADIO] Suspect %s(%d) has been sent to jail", opname, ID);
SendCopMessage(string);
GivePlayerMoney(playerid, 3000);
IncreaseScore(playerid, 1);
SetPVarInt(ID, "JailTime", 45);
SetPlayerInterior(ID, 10);
new rnd = random(sizeof(PrisonSpawn));
SetPlayerPos(ID, PrisonSpawn[rnd][0], PrisonSpawn[rnd][1], PrisonSpawn[rnd][2]);
SendClientMessage(playerid, COLOR_GREY, "**LOS SANTOS PRISON**");
SendClientMessage(playerid, COLOR_LIGHTBLUE, "[PRISON] You have been sent to prison. You will be released soon.");
TogglePlayerControllable(ID, 1);
SetPlayerWantedLevel(ID, 0);
return 1;
}
if(pwl == 4)
{
format(string, sizeof(string), "Police Officer %s(%d) has arrested wanted suspect %s(%d)", pname, playerid, opname, ID);
SendClientMessageToAll(COLOR_BLUE, string);
format(string, sizeof(string), "[POLICE RADIO] Suspect %s(%d) has been sent to jail", opname, ID);
SendCopMessage(string);
GivePlayerMoney(playerid, 4000);
IncreaseScore(playerid, 1);
SetPVarInt(ID, "JailTime", 70);
SetPlayerInterior(ID, 10);
new rnd = random(sizeof(PrisonSpawn));
SetPlayerPos(ID, PrisonSpawn[rnd][0], PrisonSpawn[rnd][1], PrisonSpawn[rnd][2]);
SendClientMessage(playerid, COLOR_GREY, "**LOS SANTOS PRISON**");
SendClientMessage(playerid, COLOR_LIGHTBLUE, "[PRISON] You have been sent to prison. You will be released soon.");
TogglePlayerControllable(ID, 1);
SetPlayerWantedLevel(ID, 0);
return 1;
}
if(pwl == 5)
{
format(string, sizeof(string), "Police Officer %s(%d) has arrested most wanted suspect %s(%d)", pname, playerid, opname, ID);
SendClientMessageToAll(COLOR_BLUE, string);
format(string, sizeof(string), "[POLICE RADIO] Suspect %s(%d) has been sent to jail", opname, ID);
SendCopMessage(string);
GivePlayerMoney(playerid, 10000);
IncreaseScore(playerid, 2);
SetPVarInt(ID, "JailTime", 80);
SetPlayerInterior(ID, 10);
new rnd = random(sizeof(PrisonSpawn));
SetPlayerPos(ID, PrisonSpawn[rnd][0], PrisonSpawn[rnd][1], PrisonSpawn[rnd][2]);
SendClientMessage(playerid, COLOR_GREY, "**LOS SANTOS PRISON**");
SendClientMessage(playerid, COLOR_LIGHTBLUE, "[PRISON] You have been sent to prison. You will be released soon.");
TogglePlayerControllable(ID, 1);
SetPlayerWantedLevel(ID, 0);
return 1;
}
if(pwl == 6)
{
format(string, sizeof(string), "Police Officer %s(%d) has arrested most wanted suspect %s(%d)", pname, playerid, opname, ID);
SendClientMessageToAll(COLOR_BLUE, string);
format(string, sizeof(string), "[POLICE RADIO] Suspect %s(%d) has been sent to jail", opname, ID);
SendCopMessage(string);
GivePlayerMoney(playerid, 10000);
IncreaseScore(playerid, 2);
SetPVarInt(ID, "JailTime", 100);
SetPlayerInterior(ID, 10);
new rnd = random(sizeof(PrisonSpawn));
SetPlayerPos(ID, PrisonSpawn[rnd][0], PrisonSpawn[rnd][1], PrisonSpawn[rnd][2]);
SendClientMessage(playerid, COLOR_GREY, "**LOS SANTOS PRISON**");
SendClientMessage(playerid, COLOR_LIGHTBLUE, "[PRISON] You have been sent to prison. You will be released soon.");
TogglePlayerControllable(ID, 1);
SetPlayerWantedLevel(ID, 0);
return 1;
}
return 1;
}
if ((strcmp("/ar", cmd, true) == 0) || (strcmp(cmd, "/arrest", true) == 0))
{
new tmp[256];
tmp = strtok(cmdtext, idx);
new playername[MAX_PLAYER_NAME];
GetPlayerName(playerid, playername, MAX_PLAYER_NAME);
giveplayerid = strval(tmp);
if(!strlen(tmp)) {
SendClientMessage(playerid,0xFF0000AA, "USAGE: /Ar [Playerid] / [Player Name]");
return 1;
}
if(!IsPlayerConnected(giveplayerid))
{
SendClientMessage(playerid,0xFF0000AA,"ERROR: Invaild ID!");
return 1;
}
if(GetPlayerWantedLevel(playerid) >= 4)
{
format(string, sizeof(string), "You Have Been Arrested by Officer %s[%d]!",playername,playerid);
SendClientMessage(giveplayerid,0x33CCFFAA,string);
format(string, sizeof(string), "~r~BUSTED!");
GameTextForPlayer(giveplayerid,string,3000,5);
format(string, sizeof(string), "You Arrested %s[%d], You Get $2500!",playername,giveplayerid);
SendClientMessage(playerid,0x33CCFFAA,string);
format(string, sizeof(string), "Suspect %s[%d] Has Been Arrested By Officer %s[%d].",playername,giveplayerid,playername,playerid);
SendClientMessageToAll(0x33CCFFAA,string);
format(string, sizeof(string), "~b~WELL DONE!");
GameTextForPlayer(playerid,string,3000,5);
GivePlayerMoney(playerid,2500);
SetPlayerScore(playerid,1);
SetPlayerSpecialAction(giveplayerid,SPECIAL_ACTION_HANDSUP);
ResetPlayerWeapons(giveplayerid);
}
return 1;
}
return 0;
}
|
18 mins and your bumping?
OMG eddy i thought you learned from the other night. use a timer to show the Gametext after n(seconds) |