Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- command(respawn, playerid, params []) {
- if(player[playerid][E_PLAYER_ADMIN] < 2) return SendClientMessage(playerid, VERMELHO, ERROR_NOTFOUND_PERMISSIONS);
- SendClientFormat(playerid, -1, ""SERVER_NAME_COLOR" - "VIVA_COLOR"O(A) %s %s respawnou os veículos não usados.", Admin_CargoN[player[playerid][E_PLAYER_ADMIN]], PlayerName(playerid));
- for(new i = 0; i < MAX_VEHICLES; i++) {
- if(IsVehicleTrailer(i) == true) continue;
- if(IsVehicleInUse(i) == INVALID_PLAYER_ID) {
- if(IsTrailerAttachedToVehicle(i)) SetVehicleToRespawn(GetVehicleTrailer(i));
- SetVehicleToRespawn(i);
- }
- }
- return true;
- }
- stock IsVehicleInUse(vehicleid) {
- for(new i; i != MAX_PLAYERS; i++) {
- if(GetPlayerVehicleID(i) == vehicleid) return i;
- }
- return INVALID_PLAYER_ID;
- }
- stock IsVehicleTrailer(vehicleid) {
- switch(GetVehicleModel(vehicleid)) {
- case 435: return true;
- case 450: return true;
- case 569: return true;
- case 570: return true;
- case 584: return true;
- case 590: return true;
- case 591: return true;
- case 606: return true;
- case 607: return true;
- case 608: return true;
- case 610: return true;
- case 611: return true;
- }
- return false;
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement