Help with a car comand?
#1

Ok well i am making a RP server but i made a "sky island",so i wanted to put cars on there only I could get in and drive.Maybe 1 or 2 more people also, so how can i do this?
Reply
#2

Something like this?
pawn Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
    if (newstate == PLAYER_STATE_DRIVER)
    {
        new name[MAX_PLAYER_NAME];
        GetPlayerName(playerid, name, sizeof(name));
        new vid = GetPlayerVehicleID(playerid);

        if(vid == 1) // VehicleID of the restricted vehicle
        {
            if(strcmp(name, "YourCharName", true) != 0)
            {
                RemovePlayerFromVehicle(playerid);
            }
        }
    }
    return 1;
}
Reply
#3

But wouldnt i have to define PLAYER_STATE_DRIVER ?
Reply
#4

No, PLAYER_STATE_DRIVER is already defined
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)