#1

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."); 
Reply
#2

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.");
Reply
#3

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


Forum Jump:


Users browsing this thread: 2 Guest(s)