SA-MP Forums Archive
OnPlayerConnect in a filterscript - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: OnPlayerConnect in a filterscript (/showthread.php?tid=130346)



OnPlayerConnect in a filterscript - adsy - 26.02.2010

i am looking to create a filterscript which utilises the above fufunction. What do i need to return to make sure it doesnt overrule the gamemode script

ie return 1



Re: OnPlayerConnect in a filterscript - Babul - 26.02.2010

you can even add this callback into several filterscripts. just dont forget to place the return 1; in order to let them work properly
Код:
public OnPlayerConnect(playerid)
{
	if(IsPlayerNPC(playerid))
	{
		SendClientMessageToAll(0xFFFF00AA,"NPC detected.");
	}
	new name[MAX_PLAYER_NAME], string[48];
	GetPlayerName(playerid, name, sizeof(name));
	format(string,sizeof(string),"** %s joined the game.",name);
	SendClientMessageToAll(0xffffffff,string);
	return 1;
}