SA-MP Forums Archive
OnPlayerEnterVehicle - 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: OnPlayerEnterVehicle (/showthread.php?tid=348278)



OnPlayerEnterVehicle - imnoob - 04.06.2012

How to make when player enter in the gsf vehicle to say "You Dont Have Keys from this vehicle" i make something but didnt work look what i made


Код:
new gsf1
gsf = AddStaticVehicle(Co-ordinates bla bla....)
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
	new name[MAX_PLAYER_NAME];
	GetPlayerName(playerid,name,sizeof(name));
	new vehicle;
	vehicle = GetPlayerVehicleID(playerid);
	if(vehicle == gsf1)
	{
		if(!strcmp(name, "gsf1", false, 0))
		{
		  SendClientMessage(playerid,COLOR_WHITE, "You Dont Have Key from this vehicle.");
		}
	}



Re: OnPlayerEnterVehicle - Ironboy - 04.06.2012

pawn Код:
if(GetVehicleModel(GetPlayerVehicleID(playerid)) == vehicleid)   //change vehicle id
     {
         SendClientMessage(playerid, Property, "You Dont Have Key for this vehicle.");
     }