Need Help! Cuff with a key
#1

Hello
I'm having a problem with this script:

PHP код:
 if(playerDB[playerid][job] == || playerDB[playerid][job] == 40 || playerDB[playerid][job] == 50 || playerDB[playerid][job] == 23)
{
if(
newkeys == KEY_ANALOG_LEFT)
{
for(new 
MAX_PLAYERS + +)
{
if(
IsPlayerConnected(i))
{
if (
== playerid){ SendClientMessage(playeridRED"* you can't cuff yourself"); return 1;}
new 
Float:Coo[3];
GetPlayerPos(playerid,Coo[0],Coo[1],Coo[2]);
if(!
PlayerToPoint(3.1iCoo[0],Coo[1],Coo[2])){SendClientMessage(playeridRED"* 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;

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
Reply
#2

I was hoping to get help i this forum :/
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)