Check is it passsanger
#4

Quote:
Originally Posted by cyberlord
Посмотреть сообщение
hello why this code doesnt work (its for npc trains i need to make them payable) :
Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
    if(IsPlayerInVehicle(playerid, LSTrain1NPCVehicle || SFTrain2NPCVehicle || LVTrain3NPCVehicle) && ispassenger)
	{
	 
        GivePlayerMoney(playerid, -10);
        GameTextForPlayer(playerid,"~G~Uz bilieta sumokejot 10 Euru",3000,3);
	}
    
    
	return 1;
}
Instead of checking if the player is in one of those vehicles you may can compare the vehicleid like: if(vehicleid == LSTrain1NPCVehicle /*plus the passenger like*/ && ispassenger ==0); if he enters that vehicle and as a passenger.

Edit: LOL, i was to slow, i mean same like M4D

https://sampwiki.blast.hk/wiki/OnPlayerEnterVehicle

Well, read through it to understand it completly.
Reply


Messages In This Thread
Check is it passsanger - by cyberlord - 25.12.2014, 13:00
Re: Check is it passsanger - by M4D - 25.12.2014, 13:09
Re: Check is it passsanger - by cyberlord - 25.12.2014, 13:13
AW: Check is it passsanger - by Flori - 25.12.2014, 13:14
Re: Check is it passsanger - by M4D - 25.12.2014, 13:33

Forum Jump:


Users browsing this thread: 1 Guest(s)