if(newkeys == KEY_LOOK_BEHIND)
{
if(gTeam[playerid] == TEAM_COPS)
{
new p1;
new p2;
GetDistanceBetweenPlayers(p1,p2);
if(GetDistanceBetweenPlayers(p1,p2) > 5) return SendClientMessage(p1,COLOR_WHITE,"Nobody is close enough");
if(GetDistanceBetweenPlayers(p1,p2) < 5)
{
GetPlayerWantedLevel(p2);
if(GetPlayerWantedLevel(p2) == 0) return SendClientMessage(p1,COLOR_WHITE,"The player is not wanted");
if(GetPlayerWantedLevel(p2) > 0)
{
TogglePlayerControllable(p2,0);
SendClientMessageToAll(COLOR_GREEN,"Officer %s has arrested %s");
GivePlayerMoney(p1,1000);
}
}
}
if(gTeam[playerid] == TEAM_ROBBERS || gTeam[playerid] == TEAM_MEDICS || gTeam == TEAM_FIREFIGHTERS) return SendClientMessage(playerid,COLOR_RED,"This command is only for a cop");
}
if(gTeam[playerid] == TEAM_COPS)
{
new p1;
new p2;
GetDistanceBetweenPlayers(p1,p2);
if(GetDistanceBetweenPlayers(p1,p2) > 5) return SendClientMessage(p1,COLOR_WHITE,"Nobody is close enough");
if(GetDistanceBetweenPlayers(p1,p2) < 5)
{
GetPlayerWantedLevel(p2);
if(GetPlayerWantedLevel(p2) == 0) return SendClientMessage(p1,COLOR_WHITE,"The player is not wanted");
if(GetPlayerWantedLevel(p2) > 0)
{
TogglePlayerControllable(p2,0);
new copname[24];
new wantedname[24];
new string[128];
format(string,sizeof(string),"Officer %s has arrested %s",copname,wantedname);
SendClientMessageToAll(COLOR_GREEN,string);
GivePlayerMoney(p1,1000);
}
}
}
if(gTeam[playerid] == TEAM_ROBBERS || gTeam[playerid] == TEAM_MEDICS || gTeam == TEAM_FIREFIGHTERS) return SendClientMessage(playerid,COLOR_RED,"This command is only for a cop");
}
if(newkeys == KEY_LOOK_BEHIND)
{
if(gTeam[playerid] == TEAM_COPS)
{
new p1;
new p2;
GetDistanceBetweenPlayers(p1,p2);
if(GetDistanceBetweenPlayers(p1,p2) > 5) return SendClientMessage(p1,COLOR_WHITE,"Nobody is close enough");
if(GetDistanceBetweenPlayers(p1,p2) < 5)
{
GetPlayerWantedLevel(p2);
if(GetPlayerWantedLevel(p2) == 0) return SendClientMessage(p1,COLOR_WHITE,"The player is not wanted");
if(GetPlayerWantedLevel(p2) > 0)
{
TogglePlayerControllable(p2,0);
new copname[24];
new wantedname[24];
GetPlayerName(p1,copname,sizeof(copname));
GetPlayerName(p2,wantedname,sizeof(wantedname));
new string[128];
format(string,sizeof(string),"Officer %s has arrested %s",copname,wantedname);
SendClientMessageToAll(COLOR_GREEN,string);
GivePlayerMoney(p1,1000);
}
}
}
if(gTeam[playerid] == TEAM_ROBBERS || gTeam[playerid] == TEAM_MEDICS || gTeam[playerid] == TEAM_FIREFIGHTERS) return SendClientMessage(playerid,COLOR_RED,"This command is only for a cop");
}
What a noob am I,thanks xir,now here's the re-re-writed command:
pawn Код:
|
new distane,wanted;
distance = GetDistanceBetweenPlayers(p1,p2);
wanted = GetPlayerWantedLevel(p2);