SA-MP Forums Archive
What is correct? - 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: What is correct? (/showthread.php?tid=575493)



What is correct? - Blackazur - 27.05.2015

Hello, i want that if a NPC connects, the NPC is getting banned. Is that correct or so?

Код:
	if(IsPlayerNPC(playerid))
	{
	   Ban(playerid);
	}
Код:
	if(IsPlayerNPC(playerid))
	{
	   Ban(playerid);
           return 1;
	}
Код:
	if(IsPlayerNPC(playerid))
	{
	   Ban(playerid);
           return 0;
	}



Re: What is correct? - Vince - 27.05.2015

Whether you put a return is entirely dependent on whether you want the code below that block (if any) to be executed. If you don't want it to be executed you put a return, otherwise you don't. As for the return value itself, I think returning 0 will stop the server looking for the same callback in other scripts.