If you want to enter a specific vehicle ID, you need a specific skin
#1

Title, basically. I've requested this before, but I can't manage to compile it to a script. If a player for example wears skin ID 280, or 281, he or she gets access to vehicle ID 596 and vehicle ID 597, anyone that could give me an example?
Reply
#2

pawn Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
    if(newstate == PLAYER_STATE_DRIVER) {
        if(GetPlayerSkin(playerid, *SKINID*)) {
            /* Code here */
        }
        else {
            RemovePlayerFromVehicle(playerid);
        }  
    }
    return 1;
}
Something like this?
Reply
#3

Well, yeah, it should just be like that, but don't I have to define the vehicle ID somewhere? Lol.
Reply
#4

I'm working on it now xD. Hold on
Reply
#5

How about something like this?

Код:
public OnVehicleStreamIn(vehicleid, forplayerid)
{
	if(vehicleid == 596 || vehicleid == 597)
	{
		if(GetPlayerSkin(forplayerid) != 280 && GetPlayerSkin(forplayerid) != 281)
		{
			SetVehicleParamsForPlayer(vehicleid, forplayerid, 0, 1);
		}
	}
}
Not tested or compiled.
Reply
#6

pawn Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
    new vehicleid = GetPlayerVehicleID(playerid);
    new modelid = GetVehicleModel(vehicleid);
    if(newstate == PLAYER_STATE_DRIVER) {
        if(GetPlayerSkin(playerid) == *SKINID* && modelid == *MODELID*) {
            /* CODE */
        }
        else {
            RemovePlayerFromVehicle(playerid);
        }
    }
    return 1;
}
Works correctly.
Reply
#7

Thanks both of you :3
Reply
#8

Anytime
Reply
#9

- How am I supposed to add multipe skins to your code, Luis? :3
Reply
#10

You can use this too!

Код:
if(GetVehicleModel(vehicleid) == 520)
	{
    if(GetPlayerScore(playerid) < 500 && GetPlayerSkin(playerid) != 121)
    {
        SendClientMessage(playerid, COLOR_RED, "MESSAGE");
        RemovePlayerFromVehicle(playerid);
    }
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)