Target ID and Invalid Player ID - 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: Target ID and Invalid Player ID (
/showthread.php?tid=368567)
Target ID and Invalid Player ID -
HydraX - 13.08.2012
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?
Re: Target ID and Invalid Player ID -
Kindred - 13.08.2012
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.
Re: Target ID and Invalid Player ID -
SEnergy - 13.08.2012
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);
Respuesta: Target ID and Invalid Player ID -
HydraX - 13.08.2012
Thanks.