27.04.2014, 06:11
You can do with this method:
To create the vehicles for vip, just do that:
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.
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;
}
pawn Код:
public OnGameModeInit() {
CreateVIPVehicle(532, 0.0000, 0.0000, 0.0000, 0.0000, 1, 1, 60);
return 1;
}
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.