SA-MP Forums Archive
Need Help! Cuff with a key - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Need Help! Cuff with a key (/showthread.php?tid=272240)



Need Help! Cuff with a key - DarKiss_ - 27.07.2011

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


Re: Need Help! Cuff with a key - DarKiss_ - 27.07.2011

I was hoping to get help i this forum :/