daily pastebin goal
21%
SHARE
TWEET

james

a guest Jun 22nd, 2018 79 Never
Upgrade to PRO!
ENDING IN00days00hours00mins00secs
  1. public OnPlayerDropGarbage(playerid)
  2. {
  3.     RemovePlayerAttachedObject(playerid, 8);
  4.     DisablePlayerCheckpoint(playerid);
  5.     SendClientMessage(playerid,COLOR_LIGHTGREEN,"Lixo colocado dentro do caminhão, siga para o próximo.");
  6.     GameTextForPlayer(playerid,"~w~Lixo coletado",5000,1);
  7.     garbage_run_state[playerid] = 0;
  8.     garbage_run_stage[playerid] ++;
  9.     RefreshGarbageStage(playerid);
  10. }
  11.  
  12. public OnPlayerPickupGarbage(playerid)
  13. {
  14.     new Float:X, Float:Y, Float:Z;
  15.     GetPlayerPos(playerid,X,Y,Z);
  16.     //garbage_object[playerid] = CreateObject(1265,X,Y,Z,0.0,0.0,0.0);
  17.     SetPlayerAttachedObject(playerid, 8, 1265, 6);
  18.     AttachObjectToPlayer(garbage_object[playerid],playerid,0.0,0.7,0.0,0.0,0.0,0.0);
  19.     SendClientMessage(playerid,COLOR_LIGHTGREEN,"Jogue o saco de lixo na traseira do caminhão.");
  20.     garbage_run_state[playerid] = 1;
  21.     GetPosInFrontOfVehicle(garbage_run_vehicle[playerid], X, Y, -4.5);
  22.     SetPlayerCheckpoint(playerid,X,Y,Z,2.0);
  23. }
  24.  
  25. public RefreshGarbageStage(playerid)
  26. {
  27.     if(PlayerInfo[playerid][pJob] == JOB_LIXEIRO)
  28.     {
  29.         if(garbage_run_stage[playerid] < 14)
  30.         {
  31.             SetPlayerCheckpoint(playerid,garbage_profiles[garbage_run[playerid]][garbage_run_stage[playerid]][0],garbage_profiles[garbage_run[playerid]][garbage_run_stage[playerid]][1],garbage_profiles[garbage_run[playerid]][garbage_run_stage[playerid]][2],2.0);
  32.             SendClientMessage(playerid,COLOR_LIGHTGREEN,"Vá até o checkpoint para coletar o lixo.");
  33.         }
  34.         else
  35.         {
  36.             SendClientMessage(playerid,COLOR_LIGHTGREEN,"Trajeto completo, vá até a base.");
  37.             PlayerInfo[playerid][pJobInPd]++;
  38.             SetPlayerCheckpoint(playerid,2328.5171,265.1754,26.3643,5.0);
  39.             garbage_run_state[playerid] = 3;
  40.         }
  41.     }
  42. }
  43.  
  44. public OnPlayerEndGarbage(playerid)
  45. {
  46.     if(garbage_object[playerid] > -1) { DestroyObject(garbage_object[playerid]); garbage_object[playerid] = -1; }
  47.     garbage_run[playerid] = -1;
  48.     garbage_run_stage[playerid] = -1;
  49.     garbage_run_state[playerid] = -1;
  50.     SetVehicleToRespawn(garbage_run_vehicle[playerid]);
  51.  
  52.     garbage_run_vehicle[playerid] = -1;
  53.     DisablePlayerCheckpoint(playerid);
  54. }
  55.  
  56. public OnPlayerStartGarbage(playerid)
  57. {
  58.     new run;
  59.     if(PlayerInfo[playerid][pJob] == JOB_LIXEIRO)
  60.     {
  61.         run = random((sizeof(garbage_profiles) - 1));
  62.         garbage_run[playerid] = run;
  63.         garbage_run_stage[playerid] = 0;
  64.         garbage_run_state[playerid] = 0;
  65.         garbage_run_vehicle[playerid] = GetPlayerVehicleID(playerid);
  66.         RefreshGarbageStage(playerid);
  67.         StartEngine(GetPlayerVehicleID(playerid));
  68.         SendClientMessage(playerid,COLOR_LIGHTGREEN,"Colete o lixo nos Checkpoints, saindo do caminhão para pega-los.");
  69.  
  70.      }
  71. }
  72.  
  73. public InGarbage(playerid)
  74. {
  75.     if(!IsPlayerInAnyVehicle(playerid)) { return false; }
  76.     new id = GetPlayerVehicleID(playerid);
  77.     for(new i = 0; i < sizeof(garbage_vehicles); i ++)
  78.     {
  79.         if(garbage_vehicles[i] == id)
  80.             return true;
  81.     }
  82.     return false;
  83. }
  84.  
  85. COMMAND:comecarcoleta(playerid,params[])
  86. {
  87.     if(!PlayerInfo[playerid][pLogado]) return 1;
  88.     if(!InGarbage(playerid)) return SendClientMessage(playerid,COLOR_LIGHTRED,"Você não está em um caminhão de lixo.");
  89.     if(PlayerInfo[playerid][pJob] != JOB_LIXEIRO) return SendClientMessage(playerid,COLOR_LIGHTRED,"Você não é um lixeiro.");
  90.     if(PlayerInfo[playerid][pJobInPd] > 3) return SendClientMessage(playerid,COLOR_LIGHTRED,"Você já trabalhou bastante neste PayDay, volte após seu pagamento.");
  91.     if(garbage_run[playerid] != -1) return SendClientMessage(playerid,COLOR_LIGHTRED,"Você já está em serviço, use /cancelarcoleta para cancelar.");
  92.  
  93.     OnPlayerStartGarbage(playerid);
  94.     return 1;
  95. }
  96.  
  97. COMMAND:cancelarcoleta(playerid,params[])
  98. {
  99.     if(!PlayerInfo[playerid][pLogado]) return 1;
  100.     if(garbage_run[playerid] > -1)
  101.     {
  102.         GameTextForPlayer(playerid,"~r~Trabalho como Lixeiro cancelado",5000,5);
  103.         OnPlayerEndGarbage(playerid);
  104.         return 1;
  105.     }
  106.     else
  107.     {
  108.         SendClientMessage(playerid,COLOR_LIGHTRED, "ERRO: {FFFFFF}Você não está trabalhando.");
  109.         return 1;
  110.     }
  111. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top