SA-MP Forums Archive
[SOLVED] Forbidden Vehicles 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: [SOLVED] Forbidden Vehicles Help (/showthread.php?tid=93291)



[SOLVED] Forbidden Vehicles Help - landapanda - 24.08.2009

The script works when it comes to the forbidden vehicles, they get destroyed and the message is displayed, thats all fine. The problem is that the message is displayed when ever you try and get into any car (it isnt destroyed just message appears).

Im sure i'm missing something very simple but please help, i don't want the message to be displayed when you get into any car other than the forbidden ones.



Код:
public OnPlayerEnterVehicle(playerid,vehicleid,ispassenger)
{
	new model = GetVehicleModel(vehicleid);

	switch(model)
	{
	  case 520,432,425,477,464,465,501,601,441 : {DestroyVehicle(vehicleid);}
	}

	format(string,sizeof(string),"~r~ That is a forbidden vehicle ~r~",pname);
	GameTextForPlayer(playerid,string,12000,3);
	return 1;
}



Re: Forbidden Vehicles Help - James_Alex - 24.08.2009

yes you have right it's very simple
try this
pawn Код:
public OnPlayerEnterVehicle(playerid,vehicleid,ispassenger)
{
    new model = GetVehicleModel(vehicleid);

    switch(model)
    {
      case 520,432,425,477,464,465,501,601,441 : {DestroyVehicle(vehicleid);    format(string,sizeof(string),"~r~ That is a forbidden vehicle ~r~",pname); GameTextForPlayer(playerid,string,12000,3); }
   
    }


    return 1;
}



Re: Forbidden Vehicles Help - landapanda - 24.08.2009

Thanks, works great.