28.05.2011, 13:41
Look this are my first loops and I'm not so good at them yet so if you could tell me what;s wrong I would appreciate because the only thing I manage to do in-game is arresting myself.
pawn Код:
if(newkeys == KEY_LOOK_BEHIND)
{
for(new i = 0;i<MAX_PLAYERS;i++)
{
if(gTeam[playerid] == TEAM_COPS)
{
if(GetDistanceBetweenPlayers(i,playerid) > 5) return SendClientMessage(playerid,COLOR_WHITE,"Nobody is close enough");
if(GetDistanceBetweenPlayers(i,playerid) < 5)
{
if(GetPlayerWantedLevel(i) > 0)
{
TogglePlayerControllable(i,0);
GivePlayerMoney(playerid,500);
GivePlayerMoney(i,-500);
new copname[20];
new wantedname[20];
GetPlayerName(i,wantedname,sizeof(wantedname));
GetPlayerName(playerid,copname,sizeof(copname));
new string[128];
format(string,sizeof(string),"%s(%d) has been arrested by officer %s(%d)",wantedname,i,copname,playerid);
SendClientMessageToAll(COLOR_GREY,string);
}
}
}
}
}