SA-MP Forums Archive
Call public when player exit from vehicle - 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: Call public when player exit from vehicle (/showthread.php?tid=658427)



Call public when player exit from vehicle - Pachino - 03.09.2018

I want to call this plugin when player exit from vehicle.
Problem is, i cant hear the stream from boombox when I exit from vehicle in boombox area.

Код:
public OnPlayerEnterDynamicArea(playerid, areaid)
{
	foreach(new i : Player)
	{
	   	if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
		{
		return 1;
		}
	    if(GetPVarType(i, "BBArea"))
	    {
	        if(areaid == GetPVarInt(i, "BBArea"))
	        {
	            new station[256];
				GetPVarString(i, "BBStation", station, sizeof(station));
	            if(!isnull(station))
				{
					PlayStream(playerid, station, GetPVarFloat(i, "BBX"), GetPVarFloat(i, "BBY"), GetPVarFloat(i, "BBZ"), 30.0, 1);
	            }
				return 1;
	        }
	    }
	}
	return 1;
}