SA-MP Forums Archive
What's wrong with this? - 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: What's wrong with this? (/showthread.php?tid=491185)



What's wrong with this? - TheSnaKe - 29.01.2014

Hello guys, i have made a code, but it's not working i don't know why, every citizen can drive the LSPD car, it's not working in any faction, i have like 12 factions and it's not working, any citizen can drive faction cars.

Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
    SendClientMessage(playerid, COLOR_BLUE, "Remember to wear your seatbelt so you don't get fined!(/belt).");
Under OnPlayerEnterVehicle

Код:
else if(IsLeoVehicle(vehicleid) && PlayerInfo[playerid][pFac] != 1)
	    {
		    new Float:pos[3];
		    GetPlayerPos(playerid, pos[0], pos[1], pos[2]);
		    SetPlayerPos(playerid, pos[0], pos[1], pos[2]);
		    SendClientMessage(playerid, COLOR_ORANGE, " You can't start the engine as it belongs to the LSPD.");



AW: What's wrong with this? - xerox8521 - 29.01.2014

You missed RemovePlayerFromVehicle(playerid);


Re: AW: What's wrong with this? - TheSnaKe - 29.01.2014

Quote:
Originally Posted by xerox8521
Посмотреть сообщение
You missed RemovePlayerFromVehicle(playerid);
Like this?

Код:
else if(IsLeoVehicle(vehicleid) && PlayerInfo[playerid][pFac] != 1)
	    {
		    new Float:pos[3];
                    RemovePlayerFromVehicle(playerid);
		    GetPlayerPos(playerid, pos[0], pos[1], pos[2]);
		    SetPlayerPos(playerid, pos[0], pos[1], pos[2]);
		    SendClientMessage(playerid, COLOR_ORANGE, " You can't start the engine as it belongs to the LSPD.");



Re: What's wrong with this? - TheSnaKe - 29.01.2014

Still not working. Any help?