SA-MP Forums Archive
Problem with public OnPlayerStateChange - 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: Problem with public OnPlayerStateChange (/showthread.php?tid=262342)



Problem with public OnPlayerStateChange - Aizen - 17.06.2011

Well i have error about OnPlayerStateChange.

This is the code

Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
	new vehicleid = GetPlayerVehicleID(playerid);
	if(newstate == PLAYER_STATE_DRIVER && oldstate == PLAYER_STATE_ONFOOT)
	{
	    if(vehicleid == valo)
	    {
	        if(strcmp(PlayerName(playerid)," Valo_Xhan", true) != 0)
	        {
	            RemovePlayerFromVehicle(playerid);
	            SendClientMessage(playerid, COLOR_RED, "This vehicle belongs to Valo, better get away fast.");
         	}
		}
        stock PlayerName(playerid)
		{
			new PlrName[MAX_PLAYER_NAME];
			GetPlayerName(playerid,PlrName,sizeof(PlrName));
			return PlrName;
		}
		return 1;
	}
}
And i got this 5 error:
Код:
D:\Test server\filterscripts\Valox.pwn(118) : error 017: undefined symbol "PlayerName"
D:\Test server\filterscripts\Valox.pwn(121) : error 029: invalid expression, assumed zero
D:\Test server\filterscripts\Valox.pwn(121) : warning 215: expression has no effect
D:\Test server\filterscripts\Valox.pwn(121) : error 001: expected token: ";", but found ")"
D:\Test server\filterscripts\Valox.pwn(121) : error 029: invalid expression, assumed zero
D:\Test server\filterscripts\Valox.pwn(121) : fatal error 107: too many error messages on one line