Target ID and Invalid Player ID
#1

pawn Код:
if( TargetID == INVALID_PLAYER_ID ) return SendClientMessage( playerid, -1, "SERVER: Invalid playerid! Please try again" );
This line is suppose to return an Error that the ID of the player that was typed in is not connected.
Lets say there is only 1 player connected with ID 0, whenever I type /ban 1 [reason] or /kick 1 [reason] or /mute 1 [reason] it would return an error, which is listed up there. However in my case, it ignores it whenever I type it.
Any Idea why?
Reply
#2

Try IsPlayerConnected instead.

Or show us the whole command or whatever you are using. You may have done something wrong with the TargetID variable or something.
Reply
#3

INVALID_PLAYER_ID is -1, that's INVALID ID, the ID that can't be used, not ID that's NOT used, instead use function

IsPlayerConnected(TargetID);
Reply
#4

Thanks.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)