22.05.2011, 08:42
Try this code:
I cannot guarantee that it will work + I'm sleepy. Good night.
pawn Код:
if(newkeys == KEY_LOOK_BEHIND)
{
if(gTeam[playerid] == TEAM_COPS)
{
for(new i = 0; i < MAX_PLAYERS; ++i)
{
if(IsPlayerConnected(i) && !IsPlayerNPC(i) && GetPlayerWantedLevel(i) > 0)
{
new
Float:i_Pos[3];
GetPlayerPos(i, i_Pos[0], i_Pos[1], i_Pos[2]);
if(IsPlayerInRangeOfPoint(playerid, 5, i_Pos[0], i_Pos[1], i_Pos[2]))
{
new
i_NameWanted[MAX_PLAYER_NAME],
i_NameCop[MAX_PLAYER_NAME],
iStr[48 + 20];
TogglePlayerControllable(i, false);
GetPlayerName(i, i_NameWanted, MAX_PLAYER_NAME]);
GetplayerName(playerid, i_NameCop, MAX_PLAYER_NAME);
format(iStr, sizeof(iStr), "%s(%d) has been cuffed by %s(%d)", i_NameWanted, i, i_NameCop, playerid);
SendClientMessageToAll(COLOR_GREY, iStr);
GivePlayerMoney(playerid, 500);
return 1;
}
else SendClientMessage(playerid, COLOR_WHITE, "Nobody is close enough.");
}
}
}
}