16.08.2012, 10:05
I made a npc bot taxi around los santos with cmd /taxiroute in which I define my taxi's route.. Can anyone tell me codes that will find player 500$ when he/she enters in npc vehicle by pressing G?
public OnPlayerStateChange(playerid, newstate, oldstate)
{
if(newstate == PLAYER_STATE_PASSENGER && /*check if it's that taxi*/)
{
if(GetPlayerMoney(playerid) >= 500)
GivePlayerMoney(playerid, -500);
}
}
new RonsTaxi;
RonsTaxi = AddStaticVehicleEx(....);
public OnPlayerStateChange(playerid, newstate, oldstate)
{
if(newstate == PLAYER_STATE_PASSENGER && GetPlayerVehicleID(playerid) == RonsTaxi)
{
if(GetPlayerMoney(playerid) >= 500)
GivePlayerMoney(playerid, -500);
}
}