Lock a car and Lock Skin for specific player
#7

Quote:
Originally Posted by Nero_3D
View Post
RemovePlayerFromVehicle wont work in OnPlayerEnterVehicle

Just use OnPlayerStateChange and the state PLAYER_STATE_DRIVER
Oh yeah... I forgot. Sorry about that!

EDIT: This code should work for you. There is a new variable at the top, learn where it goes.

pawn Code:
new iRVehicle; // This needs to be the vehicle ID of "Robert's" vehicle.

public OnPlayerStateChange(playerid,newstate,oldstate)
{
    if(newstate == PLAYER_STATE_DRIVER)
    {
        if(GetPlayerVehicleID(playerid) == iRVehicle))
        {
            new szName[MAX_PLAYER_NAME];
            GetPlayerName(playerid, szName, sizeof(szName));
            if(!strcmp(szName, "Robert", false)) return 1;
            else RemovePlayerFromVehicle(playerid, GetPlayerVehicleID(playerid)), SendClientMessage(playerid, 0xFFFFFFFF, "GET THE FUCK OUT!!! THIS VEHICLE BELONGS TO ROBERT!!!");
        }
    }
    return 1;
}
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)