27.07.2011, 17:15
Hello 
I'm having a problem with this script:
PAWN compiles all script with no error or warning, but it is not working correctly.
( only player who id is 0 gets cuffed )
So please help me fix this script or give me another one
thanks

I'm having a problem with this script:
PHP код:
if(playerDB[playerid][job] == 1 || playerDB[playerid][job] == 40 || playerDB[playerid][job] == 50 || playerDB[playerid][job] == 23)
{
if(newkeys == KEY_ANALOG_LEFT)
{
for(new i = 0 ; i < MAX_PLAYERS ; i + +)
{
if(IsPlayerConnected(i))
{
if (i == playerid){ SendClientMessage(playerid, RED, "* you can't cuff yourself"); return 1;}
new Float:Coo[3];
GetPlayerPos(playerid,Coo[0],Coo[1],Coo[2]);
if(!PlayerToPoint(3.1, i, Coo[0],Coo[1],Coo[2])){SendClientMessage(playerid, RED, "* player is too far."); return 1;}
new msg[128],police[MAX_PLAYER_NAME];
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid,police,sizeof(police));
GetPlayerName(i,name,sizeof(name));
if(playerDB[i][cuffed])
{
playerDB[i][cuffed]=false;
TogglePlayerControllable(i,true);
format(msg,sizeof(msg),"you have released {D53B00}%s.",name);
SendClientMessage(playerid,GREEN,msg);
format(msg,sizeof(msg),"you have been released by {D53B00}%s.",police);
SendClientMessage(i,RED,msg);
}else{
playerDB[i][cuffed]=true;
TogglePlayerControllable(i,false);
format(msg,sizeof(msg),"you have cuffed {D53B00}%s.",name);
SendClientMessage(playerid,GREEN,msg);
format(msg,sizeof(msg),"you have been cuffed by{D53B00}%s.",police);
SendClientMessage(i,GREEN,msg);
}
}
}
return 1;
}
( only player who id is 0 gets cuffed )
So please help me fix this script or give me another one

thanks