Why doesn't this work
#1

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
Reply
#2

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.
Reply
#3

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);
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)