SA-MP Forums Archive
Random Thing Gets Errors :( Help - 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: Random Thing Gets Errors :( Help (/showthread.php?tid=168260)



Random Thing Gets Errors :( Help - vakhtang - 15.08.2010

Okey guys I love you all but here in script when I made random spawn locations is got errors and I don`t know why Here is code:
Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
    new rand = random(sizeof(RandomSteal));
 	if(gTeam[playerid] == 6)
    (
    new rand = random(sizeof(RandomSteal));
    SetPlayerCheckpoint(playerid, RandomSteal[rand][0], RandomSteal[rand][1], RandomSteal[rand][2], 3.0);
	return 1;
}
The thing is when team dude enters a vehicle I want checkpoint to apear


Re: Random Thing Gets Errors :( Help - akis_tze - 15.08.2010

use your code at
public OnPlayerStateChange(playerid, newstate, oldstate)
not at public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)


Re: Random Thing Gets Errors :( Help - akis_tze - 15.08.2010

use this
if(newstate == PLAYER_STATE_DRIVER)

and

if(newstate == PLAYER_STATE_PASSENGER)