SA-MP Forums Archive
/rob - 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)
+--- Thread: /rob (/showthread.php?tid=474751)



/rob - Jimmy0wns - 09.11.2013

So, i was trying to fix a bug, that an user from my server has found.
I tried fixing it, but cant remember how i did it the last time.

What i am trying is to check if the player that used the command is himself.
I tried this:
PHP код:
    if(!IsPlayerConnected(ID) == (ID))
        return 
SendClientMessage(playeridCOLOR_ERROR"You cannot rob yourself."); 



Re: /rob - DarkLored - 09.11.2013

try this and delete the !Isplayerconnected

here is the code
pawn Код:
if(playerid == ID)
    {
        SendClientMessage(playerid,COLOR_ERROR,"You cannot rob yourself, why would you do that anyway?");
        return 1;
    }
this function is to chec if a player is connected
pawn Код:
if(!IsPlayerConnected(ID) == (ID))
        return SendClientMessage(playerid, COLOR_ERROR, "You cannot rob yourself.");



Re: /rob - PrivatioBoni - 09.11.2013

And surely it should be playerid and ID, not ID and ID.