SA-MP Forums Archive
Small problem [+rep] - 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: Small problem [+rep] (/showthread.php?tid=310531)



Small problem [+rep] - Twinki1993 - 12.01.2012

Well I have the problem that this command is not doing what it's supposted to

Код HTML:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
	if(GetVehicleModel(vehicleid) == Missioncar)
 	{
  		if(GetPlayerTeam(playerid) == 2)
    	{
			SendClientMessage(playerid, COLOR_WHITE, "<!>Head to the marker which is added to your minimap!");
			SendClientMessage(playerid, COLOR_WHITE, "<!>If you succed in the mission you will be awarded!");
			return 1;
		}
		if(GetPlayerTeam(playerid) == 1)
		{
		    SendClientMessage(playerid, COLOR_WHITE, "<!>You must be USA team to drive this vehicle!");
		    RemovePlayerFromVehicle(playerid);
		    return 1;
		}
	}
	return 1;
}
If you are team 2 it should say:
Код HTML:
SendClientMessage(playerid, COLOR_WHITE, "<!>Head to the marker which is added to your minimap!");
			SendClientMessage(playerid, COLOR_WHITE, "<!>If you succed in the mission you will be awarded!");
And if you are team 1 it should do and say:
Код HTML:
		    SendClientMessage(playerid, COLOR_WHITE, "<!>You must be USA team to drive this vehicle!");
		    RemovePlayerFromVehicle(playerid);
But nothing is happening when player is entering the vehicle..
No problems while compiling


Re: Small problem [+rep] - Fj0rtizFredde - 12.01.2012

Change
pawn Код:
if(GetVehicleModel(vehicleid) == Missioncar)
to:
pawn Код:
if(vehicleid == Missioncar)



Re: Small problem [+rep] - Twinki1993 - 12.01.2012

Oh wow That's was kinda easy hehe, thanks mate!