Why doesn't this work - 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: Why doesn't this work (
/showthread.php?tid=417439)
Why doesn't this work -
lollie123 - 21.02.2013
pawn Код:
else if(newstate == PLAYER_STATE_ENTER_VEHICLE_PASSENGER) // Player entered a vehicle as a driver
{
new string[150], str[150], PlayerN[MAX_PLAYER_NAME], Player1[MAX_PLAYER_NAME];
new modelid = GetVehicleModel(GetPlayerVehicleID(playerid));
new car = modelid-400;
format(string, sizeof(string), "~w~%s", VehicleNames[car]);
GameTextForPlayer(playerid,string,3000,1);
new driver=GetVehicleDriver(modelid);
GetPlayerName(driver, PlayerN, sizeof(PlayerN));
GetPlayerName(playerid, Player1, sizeof(Player1));
if(IsPlayerNPC(driver))
{
format(str, sizeof str, "%s: {FFFFF}I am not gonna drive you for free, %s. It will cost $10/10 minutes", PlayerN, Player1);
SendClientMessage(playerid, GetPlayerColor(driver), str);
drivertimer[playerid] = SetTimerEx("DriverCosts",5000,true,"i",playerid);
}
}
When you enter the vehicle of the NPC, nothing happens..
Using:
https://sampforum.blast.hk/showthread.php?tid=271321
Re: Why doesn't this work -
RajatPawar - 21.02.2013
Try using newstate as "PLAYER_STATE_PASSENGER" because you are calling this as he enters the car as a passenger. I don't know, I could be wrong, just try it.
Re: Why doesn't this work -
lollie123 - 21.02.2013
Thanks I will test it
EDIT:
Nope didnt work
I think I did something wrong with modelid
I made it work with
pawn Код:
new vid = GetPlayerVehicleID(playerid);
new driver=GetVehicleDriver(vid);