16.12.2011, 15:20
i am using a vip system and want a vehicle to be only use dby vips how to do this ? the vehicles are on the server already i have the id i need i just dont no what to do with it
RemovePlayerFromVehicle(playerid);
if ( P_DATA[ playerid ][ Vip ] >= 1 )
under OnPlayerEnterVehicle callback
new vehid;
vehid == GetPlayerVehicleID(playerid);
if(vehid == 435 && ( P_DATA[ playerid ][ Vip ] <= 1)) return SendClientMessage(playerid,-1,"ERROR:only vip level 1 can enter this vehicle");
RemovePlayerFromVehicle(playerid);
else
{
//.....
}
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
new vehicle;
vehicle = GetPlayerVehicleID(playerid);
if(vehicle == 435) {
if(P_DATA[playerid][Vip] <1) return RemovePlayerFromVehicle(playerid);
}
return 1;
}
hmm something like that
if you are using 3 vip levels pawn Код:
|
public OnPlayerStateChange(playerid, newstate, oldstate)
{
if(newstate == PLAYER_STATE_DRIVER)
{
if(vid ==VIP_CAR_ID/*Change this*/)
{
if ( P_DATA[ playerid ][ Vip ] >= 1 ) return 1;
else if(! P_DATA[ playerid ][ Vip ] >= 1 )
{
SendClientMessage(playerid, -1, "This is a VIP vehicle, SIR.");
RemovePlayerFromVehicle(playerid);
}
}
}
return 1;
}