AddStaticVehicle(561,2170.4277,1973.5856,10.6340,88.5622,1,255); //
//Global - On top of script
new VIP_CAR1;
//GameModeInit
VIP_CAR1 = AddStaticVehicle(561,2170.4277,1973.5856,10.6340,88.5622,1,255);
public OnPlayerStateChange(playerid, newstate, oldstate)
{
if(newstate == PLAYER_STATE_DRIVER && GetPlayerVehicleID(playerid) == VIP_CAR1)
{
if(pInfo[playerid][VIPLevel] < 2)
{
SendClientMessage(playerid, 0xFF0000FF, "You need to be VIP Member (Level 2) to use this vehicle.");
RemovePlayerFromVehicle(playerid);
}
}
return 1;
}
CMD:cargod(PARAMS) { LoginCheck(playerid); LevelCheck(playerid, 1); switch(P_DATA[playerid][CarGod]) { case false: { P_DATA[playerid][CarGod] = 1; SetPVarInt(playerid, "0_CarGod", 1); SendClientMessage(playerid, Color:GREY, "Vehicle God has been activated!"); } case true: { P_DATA[playerid][CarGod] = 0; SetPVarInt(playerid, "0_CarGod", 0); SendClientMessage(playerid, Color:GREY, "Vehicle God has been deactivated!"); } } return 1; }
//Global - On top of script
new VIP_CAR1;
//GameModeInit
VIP_CAR1 = AddStaticVehicle(561,2170.4277,1973.5856,10.6340,88.5622,1,255);
public OnPlayerStateChange(playerid, newstate, oldstate)
{
if(newstate == PLAYER_STATE_DRIVER && GetPlayerVehicleID(playerid) == VIP_CAR1)
{
if(pInfo[playerid][VIPLevel] < 2)
{
SendClientMessage(playerid, 0xFF0000FF, "You need to be VIP Member (Level 2) to use this vehicle.");
RemovePlayerFromVehicle(playerid);
}
}
return 1;
}
// Code from iPLEOMAX
new vipcars; /////////////// vipcars = CreateVehicle(415, 2541.9836, 2373.1616, 4.2078, 90.0000, -1, -1, 10000); vipcars = CreateVehicle(494, 2542.0288, 2369.3257, 4.2078, 90.0000, -1, -1, 10000); vipcars = CreateVehicle(601, 2525.2507, 2364.4233, 4.2071, 90.0000, -1, -1, 10000); vipcars = CreateVehicle(601, 2525.2004, 2368.7664, 4.2071, 90.0000, -1, -1, 10000); vipcars = CreateVehicle(601, 2525.7378, 2372.9229, 4.2071, 90.0000, -1, -1, 10000); vipcars = CreateVehicle(601, 2525.3804, 2376.8618, 4.2071, 90.0000, -1, -1, 10000); vipcars = CreateVehicle(601, 2525.5127, 2381.3167, 4.2071, 90.0000, -1, -1, 10000); vipcars = CreateVehicle(568, 2515.0525, 2363.9822, 4.5085, 90.0000, -1, -1, 10000); vipcars = CreateVehicle(495, 2516.2449, 2382.1934, 4.5085, 90.0000, -1, -1, 10000); vipcars = CreateVehicle(444, 2516.2219, 2377.1284, 4.5085, 90.0000, -1, -1, 10000); vipcars = CreateVehicle(557, 2515.5313, 2372.4619, 4.5085, 90.0000, -1, -1, 10000); vipcars = CreateVehicle(424, 2514.8418, 2368.2844, 4.5085, 90.0000, -1, -1, 10000); vipcars = CreateVehicle(447, 2494.1953, 2398.8889, 71.5000, 0.0000, -1, -1, 10000); vipcars = CreateVehicle(488, 2494.1772, 2387.4556, 71.5327, 0.0000, -1, -1, 10000); vipcars = CreateVehicle(476, 2477.7434, 2355.8086, 71.5000, 0.0000, -1, -1, 10000); public OnPlayerStateChange(playerid, newstate, oldstate) { if(newstate == PLAYER_STATE_DRIVER && GetPlayerVehicleID(playerid) == VIP_CAR1) { if(pInfo[playerid][VIPLevel] < 2) { SendClientMessage(playerid, 0xFF0000FF, "You need to be VIP Member (Level 2) to use this vehicle."); RemovePlayerFromVehicle(playerid); } } return 1; }
new vipcars[14];
// Under OnGameModeInIt
vipcars = CreateVehicle(415, 2541.9836, 2373.1616, 4.2078, 90.0000, -1, -1, 10000);
vipcars[0] = CreateVehicle(494, 2542.0288, 2369.3257, 4.2078, 90.0000, -1, -1, 10000);
vipcars[1] = CreateVehicle(601, 2525.2507, 2364.4233, 4.2071, 90.0000, -1, -1, 10000);
vipcars[2] = CreateVehicle(601, 2525.2004, 2368.7664, 4.2071, 90.0000, -1, -1, 10000);
vipcars[3] = CreateVehicle(601, 2525.7378, 2372.9229, 4.2071, 90.0000, -1, -1, 10000);
vipcars[4] = CreateVehicle(601, 2525.3804, 2376.8618, 4.2071, 90.0000, -1, -1, 10000);
vipcars[5] = CreateVehicle(601, 2525.5127, 2381.3167, 4.2071, 90.0000, -1, -1, 10000);
vipcars[6] = CreateVehicle(568, 2515.0525, 2363.9822, 4.5085, 90.0000, -1, -1, 10000);
vipcars[7] = CreateVehicle(495, 2516.2449, 2382.1934, 4.5085, 90.0000, -1, -1, 10000);
vipcars[8] = CreateVehicle(444, 2516.2219, 2377.1284, 4.5085, 90.0000, -1, -1, 10000);
vipcars[9] = CreateVehicle(557, 2515.5313, 2372.4619, 4.5085, 90.0000, -1, -1, 10000);
vipcars[10] = CreateVehicle(424, 2514.8418, 2368.2844, 4.5085, 90.0000, -1, -1, 10000);
vipcars[11] = CreateVehicle(447, 2494.1953, 2398.8889, 71.5000, 0.0000, -1, -1, 10000);
vipcars[12] = CreateVehicle(488, 2494.1772, 2387.4556, 71.5327, 0.0000, -1, -1, 10000);
vipcars[13] = CreateVehicle(476, 2477.7434, 2355.8086, 71.5000, 0.0000, -1, -1, 10000);
ok thank you (it's simpler liker that)
and for OnPlayerStateChange ir will be if(newstate == PLAYER_STATE_DRIVER && GetPlayerVehicleID(playerid) == vipcars) ++rep by the way |
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger) { if(vehicleid == vipcars[]) { new file[128]; format(file, sizeof(file), USER_FILE, GetPName(playerid)); if(dini_Int(file, "VIP")< 1){ RemovePlayerFromVehicle(playerid); SendClientMessage(playerid,YELLOW,"Not Vip"); } } return 1; }