How to check if a variable is set?
#1

new myvar;
if(random condition) myvar=playerid;

At that point i want to know that myvar have a playerid or null.
But in here (https://sampwiki.blast.hk/wiki/Scripting_Basics#Variables) i read that always initial value is 0. But playerid can be 0 too.

I set myvar to -1 before actions now. But i believe its not logical. So..

Could you help me about that topic please?

Are there any function like isnull,isset etc.
Reply
#2

An invalid playerid should logically be specified with INVALID_PLAYER_ID. There isn't any null in Pawn.
Reply
#3

So how can i do that then,

new myvararrl[MAX_PLAYERS][10]={{INVALID_PLAYER_ID}};

without using a loop to set.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)