Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #define VSAFTEY
- CMD:vsafety(playerid, params[])
- {
- new vstring[1024];
- for(new i, iModelID; i <new MAX_PLAYERVEHICLES; i++) {
- if((iModelID = PlayerVehicleInfo[playerid][i][pvModelId] - 400) >= 0) {
- if(PlayerVehicleInfo[playerid][i][pvImpounded]) {
- format(vstring, sizeof(vstring), "%s\n%s (impounded)", vstring, VehicleName[iModelID]);
- }
- else if(PlayerVehicleInfo[playerid][i][pvDisabled]) {
- format(vstring, sizeof(vstring), "%s\n%s (disabled)", vstring, VehicleName[iModelID]);
- }
- else if(!PlayerVehicleInfo[playerid][i][pvSpawned]) {
- format(vstring, sizeof(vstring), "%s\n%s (stored)", vstring, VehicleName[iModelID]);
- }
- else format(vstring, sizeof(vstring), "%s\n%s (spawned)", vstring, VehicleName[iModelID]);
- }
- else strcat(vstring, "\nEmpty");
- }
- ShowPlayerDialog(playerid, VEHICLESAFTEY, DIALOG_STYLE_LIST, "Vehicle storage", vstring, "(De)spawn", "Cancel");
- return 1;
- }
- else if(PlayerVehicleInfo[playerid][listitem][pvImpounded]) SendClientMessageEx(playerid, COLOR_WHITE, "You can not track an impounded vehicle. If you wish to reclaim it, do so at the DMV in Dillimore.");
- else if(PlayerVehicleInfo[playerid][listitem][pvDisabled] == 1) SendClientMessageEx(playerid, COLOR_WHITE, "You can not track a disabled vehicle. It is disabled due to your VIP level (vehicle restrictions).");
- else if(PlayerVehicleInfo[playerid][listitem][pvSpawned] == 0) SendClientMessageEx(playerid, COLOR_WHITE, "You can not track a stored vehicle. Use /vsafety to spawn it.");
- else SendClientMessageEx(playerid, COLOR_WHITE, "You can not track a non-existent vehicle.");
- }
- if(bVehRestoreFlag == true) SendClientMessageEx(playerid, COLOR_WHITE, "Your vehicles have been restored to their last known location from your previous timeout.");
- return 1;
- }
- vehicleSpawnCountCheck(playerid) {
- switch(PlayerInfo[playerid][pDonateRank]) {
- case 0, 1, 2: if(VehicleSpawned[playerid] >= 2) return 0;
- case 3: if(VehicleSpawned[playerid] >= 3) return 0;
- case 4, 5: if(VehicleSpawned[playerid] >= 5) return 0;
- default: return 0;
- }
- return 1;
- }
- stock UnloadPlayerVehicles(playerid) {
- for(new v = 0; v < MAX_PLAYERVEHICLES; v++) if(PlayerVehicleInfo[playerid][v][pvId] != INVALID_PLAYER_VEHICLE_ID && !PlayerVehicleInfo[playerid][v][pvImpounded] && PlayerVehicleInfo[playerid][v][pvSpawned]) {
- PlayerCars--;
- if(LockStatus{PlayerVehicleInfo[playerid][v][pvId]} != 0) LockStatus{PlayerVehicleInfo[playerid][v][pvId]} = 0;
- DestroyVehicle(PlayerVehicleInfo[playerid][v][pvId]);
- VehicleFuel[PlayerVehicleInfo[playerid][v][pvId]] = 100.0;
- PlayerVehicleInfo[playerid][v][pvId] = INVALID_PLAYER_VEHICLE_ID;
- if(PlayerVehicleInfo[playerid][v][pvAllowedPlayerId] != INVALID_PLAYER_ID)
- {
- PlayerInfo[PlayerVehicleInfo[playerid][v][pvAllowedPlayerId]][pVehicleKeys] = INVALID_PLAYER_VEHICLE_ID;
- PlayerInfo[PlayerVehicleInfo[playerid][v][pvAllowedPlayerId]][pVehicleKeysFrom] = INVALID_PLAYER_ID;
- PlayerVehicleInfo[playerid][v][pvAllowedPlayerId] = INVALID_PLAYER_ID;
- }
- }
- VehicleSpawned[playerid] = 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment