VIP Cars
#2

You can do with this method:
pawn Код:
enum
    gInfoV
{
    gID,
    gVIP
}
new gVehicleInfo[MAX_VEHICLES][gInfoV];

public OnPlayerStateChange(playerid, newstate, oldstate) {
    if (GetPlayerState(playerid) == PLAYER_STATE_DRIVER) {
        if (gVehicleInfo[GetPlayerVehicleID(playerid)][gVIP] ^ 0) {
            if (/*your vip var here*/ ^ 1) {
                RemovePlayerFromVehicle(playerid);
                SendClientMessage(playerid, -1, "Only vips!");
            }
        }
    }
    return 1;
}

stock CreateVIPVehicle(model, Float:x, Float:y, Float:z, Float:a, color1, color2, respawn_delay) {
    new
        gId = AddStaticVehicleEx(model, x, y, z, a, color1, color2, respawn_delay);
    gVehicleInfo[gId][gID] = gId;
    gVehicleInfo[gId][gVIP] = 1;
    return 1;
}
To create the vehicles for vip, just do that:

pawn Код:
public OnGameModeInit() {
    CreateVIPVehicle(532, 0.0000, 0.0000, 0.0000, 0.0000, 1, 1, 60);
    return 1;
}
Change "532" for the model of vehicle;
Change "0.0000" for the respective coordinates;
Change "1" for the colors of vehicle
Change "60" for the respawn delay.

Now it's more easily to add new vehicles. You can adapt my code to create job and faction vehicles too.
Reply


Messages In This Thread
VIP Cars - by Yasubo - 27.04.2014, 05:54
Re: VIP Cars - by Abravanel - 27.04.2014, 06:11
Re: VIP Cars - by Yasubo - 27.04.2014, 06:22

Forum Jump:


Users browsing this thread: 1 Guest(s)