Advertisement
Axll

Spawn Vehicle Trailer

Apr 23rd, 2015
214
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.20 KB | None | 0 0
  1. <?php
  2.  
  3. command(respawn, playerid, params []) {
  4.     if(player[playerid][E_PLAYER_ADMIN] < 2) return SendClientMessage(playerid, VERMELHO, ERROR_NOTFOUND_PERMISSIONS);
  5.     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));
  6.  
  7.     for(new i = 0; i < MAX_VEHICLES; i++) {
  8.         if(IsVehicleTrailer(i) == true) continue;
  9.         if(IsVehicleInUse(i) == INVALID_PLAYER_ID) {
  10.             if(IsTrailerAttachedToVehicle(i)) SetVehicleToRespawn(GetVehicleTrailer(i));
  11.             SetVehicleToRespawn(i);
  12.         }
  13.     }
  14.     return true;
  15. }
  16.  
  17.  
  18.  
  19. stock IsVehicleInUse(vehicleid) {
  20.     for(new i; i != MAX_PLAYERS; i++) {
  21.         if(GetPlayerVehicleID(i) == vehicleid) return i;
  22.     }
  23.     return INVALID_PLAYER_ID;
  24. }
  25.  
  26. stock IsVehicleTrailer(vehicleid) {
  27.     switch(GetVehicleModel(vehicleid)) {
  28.         case 435: return true;
  29.         case 450: return true;
  30.         case 569: return true;
  31.         case 570: return true;
  32.         case 584: return true;
  33.         case 590: return true;
  34.         case 591: return true;
  35.         case 606: return true;
  36.         case 607: return true;
  37.         case 608: return true;
  38.         case 610: return true;
  39.         case 611: return true;
  40.     }
  41.     return false;
  42. }
  43.  
  44.  
  45. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement