SHARE
TWEET

Untitled

a guest Jan 24th, 2020 72 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // Teste de desempenho
  2. ptask UpdatePlayerUnjail[1000] (i)
  3. {
  4.     if (!playerLogado[i]) return true;
  5.  
  6.     new gstring[128];
  7.  
  8.     if (GetPlayerEscTime(i) > 4)
  9.     {
  10.         format(gstring, sizeof gstring, "Ausente há %s", ConvertTime(GetPlayerEscTime(i)));
  11.         SetPlayerChatBubble(i, gstring, 0x96959580, 10.0, 1500);
  12.     }
  13.     else if (timerAusente[i] != 0)
  14.     {
  15.         format(gstring, sizeof gstring, "Inativo há %s", ConvertTime(gettime() - timerAusente[i]));
  16.         SetPlayerChatBubble(i, gstring, 0x96959580, 10.0, 1500);
  17.     }
  18.  
  19.     if (GetPlayerEscTime(i) < 5 * 60 && timerAusente[i] == 0)
  20.     {
  21.         if (PlayerInfo[i][pAdmin] > 0 && GetPVarInt(i, "varTeamViewer")) PlayerInfo[i][pAtividade][getdate()] ++;
  22.         else if (PlayerInfo[i][pAdmin] > 0 && !GetPVarInt(i, "varAFK")) PlayerInfo[i][pAtividade][getdate()] ++;
  23.         else if (PlayerInfo[i][pAdmin] < 1) PlayerInfo[i][pAtividade][getdate()] ++;
  24.     }
  25.    
  26.     UpdatePlayerFomeSede(i);
  27.    
  28.     if (SpectadorInfo[i][spectadorValid] || SpectadorInfo[i][spectadorID] != INVALID_PLAYER_ID)
  29.     {
  30.         if (!IsPlayerConnected(SpectadorInfo[i][spectadorID]))
  31.         {
  32.             SpectadorInfo[i][spectadorValid]    = false;
  33.             SpectadorInfo[i][spectadorID]       = INVALID_PLAYER_ID;
  34.             TogglePlayerSpectating(i, false);
  35.            
  36.             GameTextForPlayer(i, "~w~                TV~n~~r~~h~                DESCONECTADO", 5000, 6);
  37.             PlayerPlaySound(i, 1145, 0.0, 0.0, 0.0);
  38.  
  39.             PlayerTextDrawHide(i, SpectadorInfo[i][spectadorText]);
  40.         }
  41.        
  42.         new specID = SpectadorInfo[i][spectadorID], procurandoPlayer = GetPVarInt(specID, "varProcura");
  43.        
  44.         static
  45.             spec_string[326],
  46.             clientVersion[12],
  47.             Float:healthPlayer,
  48.             Float:armourPlayer,
  49.             municaoPlayer
  50.         ;
  51.        
  52.         GetPlayerHealth(specID, healthPlayer);
  53.         GetPlayerArmour(specID, armourPlayer);
  54.         GetPlayerVersion(specID, clientVersion, 12);
  55.  
  56.         if (GetPlayerAmmo(specID) == 65535) municaoPlayer = 0;
  57.         else municaoPlayer = GetPlayerAmmo(specID);
  58.  
  59.         format(spec_string,sizeof(spec_string),
  60.         "~g~~h~ID:~w~ %d~n~\
  61.         ~g~~h~NICK:~w~ %s~n~\
  62.         ~g~~h~VIDA:~w~ %.1f~n~\
  63.         ~g~~h~COLETE:~w~ %.1f~n~\
  64.         ~g~~h~VELOCIDADE:~w~ %d~n~\
  65.         ~g~~h~ARMA:~w~ %s~n~\
  66.         ~g~~h~MUNICAO:~w~ %d~n~\
  67.         ~g~~h~PING:~w~ %d~n~\
  68.         ~g~~h~PACKET LOSS:~w~ %.1f~n~\
  69.         ~g~~h~PROCURANDO:~w~ %s~n~\
  70.         ~g~~h~ARMAS BLOQ:~w~ %s~n~\
  71.         ~g~~h~SAMP-CLIENT:~w~ %s", specID, PlayerName[specID], healthPlayer, armourPlayer, GetPlayerVehicleSpeed_v(specID), NomeArma(GetPlayerWeapon(specID)), municaoPlayer,
  72.         GetPlayerPing(specID), NetStats_PacketLossPercent(specID), procurandoPlayer != INVALID_PLAYER_ID ? (PlayerName[procurandoPlayer]) : ("Ninguem"),
  73.         PlayerInfo[specID][pAllowWeapons] > 0 ? ("SIM") : ("NAO"), clientVersion);
  74.  
  75.         PlayerTextDrawSetString(i, SpectadorInfo[i][spectadorText], spec_string);
  76.         PlayerTextDrawShow(i, SpectadorInfo[i][spectadorText]);
  77.  
  78.         if (GetPlayerInterior(specID) != GetPlayerInterior(i))
  79.         {
  80.             SetPlayerInterior(i, GetPlayerInterior(specID));
  81.         }
  82.         if (GetPlayerVirtualWorld(specID) != GetPlayerVirtualWorld(i))
  83.         {
  84.             SetPlayerVirtualWorld(i, GetPlayerVirtualWorld(specID));
  85.         }
  86.         if (GetCameraDistancePlayers(i, specID) > 100.0)
  87.         {
  88.             SetPlayerVirtualWorld(i, GetPlayerVirtualWorld(specID));
  89.             PlayerSpectatePlayer(i, specID);
  90.         }
  91.     }
  92.    
  93.     new Float:Viida, Float:Coleete;
  94.     GetPlayerHealth(i, Viida);
  95.     if(modoAdminTrabalho[i] && PlayerInfo[i][pAdmin] >= 1)
  96.     {
  97.         if (PlayerInfo[i][pAdmin] < 3001) {
  98.             ResetPlayerWeapons(i);
  99.         }
  100.  
  101.         SetPlayerHealth(i, 99999);
  102.     }
  103.     else if(modoHelperAjuda[i] == 1 && PlayerInfo[i][pHelper] >= 1)
  104.     {
  105.         ResetPlayerWeapons(i);
  106.         SetPlayerHealth(i, 99999);
  107.     }
  108.     else if(PlayerInfo[i][pHospital] || PlayerInfo[i][pJailed])
  109.     {
  110.         if(!GetPVarInt(i, "varFugitivo")) {
  111.             ResetPlayerWeapons(i);
  112.             SetPlayerHealth(i, 99999);
  113.         }
  114.     }
  115.     else if(Viida > 100.0)
  116.     {
  117.         SetPlayerHealth(i, 100);
  118.     }
  119.     GetPlayerArmour(i,Coleete);
  120.     if(Coleete > 100.0)
  121.     {
  122.         SetPlayerArmour(i, 100);
  123.     }
  124.  
  125.     format(gstring, sizeof gstring, "~w~~h~Cash ~b~~h~%s", FormatGrana(PlayerInfo[i][pCashVip]));
  126.     PlayerTextDrawSetString(i, textPlayerCash[i], gstring);
  127.  
  128.     if(PlayerInfo[i][pCarTime] > 0)
  129.     {
  130.         PlayerInfo[i][pCarTime] -= 1;
  131.     }
  132.     if(PlayerInfo[i][pTraining]) {
  133.         format(gstring, sizeof gstring, "{00AAFF}Ping: %s", getPingText(i));
  134.         UpdateDynamic3DTextLabelText(playerArenaText[i], -1, gstring);
  135.     }
  136.    
  137.     new actorid = GetPlayerTargetActor(i);
  138.  
  139.     if (actorid != INVALID_ACTOR_ID && !ActorInfo[actorid][actrendido] && !ActorInfo[actorid][actmorto] && GetActorSkin(actorid) != 263)
  140.     {
  141.         new weaponid = GetPlayerWeapon(i);
  142.  
  143.         if (weaponid >= 22 && weaponid <= 38 && ProxDetectorActor(5.0, i, actorid))
  144.         {
  145.             ActorInfo[actorid][actrendido] = true;
  146.             ApplyActorAnimation(actorid, "ROB_BANK","SHP_HandsUp_Scr",4.1,0,1,1,1,0);
  147.  
  148.             // Voltar ao normal
  149.             ActorInfo[actorid][actTimer] = SetTimerEx("acalmarActor", 10000, false, "d", actorid);
  150.  
  151.             SetPVarInt(i, "mirandoActor", 1);
  152.            
  153.             // Roubar o actor
  154.             PlayerTextDrawSetString(i, textAbordagem[1][i], "ARMA DE FOGO");
  155.             PlayerTextDrawSetString(i, textAbordagem[2][i], "Voce esta apontando uma arma para este cidadao, escolha uma opcao");
  156.             PlayerTextDrawSetString(i, textAbordagem[3][i], "OPCOES:~n~Y = ASSALTAR~n~N = Mandar Agachar");
  157.            
  158.             for(new x; x != 4; x++) PlayerTextDrawShow(i, textAbordagem[x][i]);
  159.         }
  160.     }
  161.  
  162.     if (actorid == INVALID_ACTOR_ID && GetPVarInt(i, "mirandoActor") != 0)
  163.     {
  164.         for(new x; x != 4; x++) PlayerTextDrawHide(i, textAbordagem[x][i]);
  165.  
  166.         SetPVarInt(i, "mirandoActor", 0);
  167.     }
  168.    
  169.     foreach(new id : IterMedkit)
  170.     {
  171.         if (IsPlayerInRangeOfPoint(i, 1.2, MedkitInfo[id][medkitPos][0], MedkitInfo[id][medkitPos][1], MedkitInfo[id][medkitPos][2]) &&
  172.         GetPlayerVirtualWorld(i) == MedkitInfo[id][medkitWorld])
  173.         {
  174.             if (getPlayerLife(i) >= 200.0) continue;
  175.  
  176.             givePlayerLife(i, 5.0);
  177.             PlayerPlaySound(i, 45400, 0.0, 0.0, 0.0);
  178.  
  179.             if (MedkitInfo[id][medkitLife] < 5.0) destroyMedKit(id);
  180.            
  181.             MedkitInfo[id][medkitLife] -= 5.0;
  182.         }
  183.     }
  184.    
  185.     if (PlayerInfo[i][pAllowWeapons] > 0)
  186.         PlayerInfo[i][pAllowWeapons] --;
  187.        
  188.     if (PlayerInfo[i][pPayDay] > 0)
  189.     {
  190.         PlayerInfo[i][pPayDay] --;
  191.  
  192.         format(gstring, sizeof(gstring), "PayDay: %s", ConvertTime(PlayerInfo[i][pPayDay]));
  193.         PlayerTextDrawSetString(i, textPayDay[i], gstring);
  194.     }
  195.     else
  196.     {
  197.         PagarPayday(i);
  198.         PlayerInfo[i][pPayDay] = 60 * 60;
  199.     }
  200.  
  201.    
  202.     if (PlayerInfo[i][pJailed] > 0 && !PlayerInfo[i][pHospital])
  203.     {
  204.         if (PlayerInfo[i][pJailTime] > 0 && !GetPVarInt(i, "varFugitivo"))
  205.         {
  206.             SetPlayerHealth(i, 99999);
  207.  
  208.             if (PlayerInfo[i][pJailed] == 9)
  209.             {
  210.                 if (PlayerInfo[i][pLevel] > 10 && !IsPlayerESC(i)) PlayerInfo[i][pJailTime]--;
  211.                 else PlayerInfo[i][pJailTime]--;
  212.             }
  213.             else PlayerInfo[i][pJailTime]--;
  214.         }
  215.         PlayerTextDrawShow(i, TextHospital[i]);
  216.         format(gstring, sizeof gstring,
  217.         "~r~|PRESO|~n~\
  218.         ~w~Tempo de prisao: ~g~~h~%s~n~\
  219.         ~w~Delegacia: ~r~~h~%s",
  220.         ConvertTime(PlayerInfo[i][pJailTime]), GetDelegaciaName(i));
  221.         PlayerTextDrawSetString(i, TextHospital[i], gstring);
  222.  
  223.         if (PlayerInfo[i][pJailed] == 9 && !IsPlayerInRangeOfPoint(i, 50.0, 322.2597,306.0850,999.1484))
  224.         {
  225.             SetPlayerSpawn(i);
  226.         }
  227.  
  228.         if (PlayerInfo[i][pJailTime] < 1)
  229.         {
  230.             PlayerInfo[i][pJailTime] = 0;
  231.             if(PlayerInfo[i][pJailed] == 1)
  232.             {
  233.                 SetPlayerInterior(i, 6);
  234.                 SetPlayerPos(i,268.0903,77.6489,1001.0391);
  235.             }
  236.             else if(PlayerInfo[i][pJailed] == 3)
  237.             {
  238.                 SetPlayerInterior(i, 0);
  239.                 SetPlayerPos(i,-1536.3813,483.9163,7.1797);
  240.             }
  241.             else if(PlayerInfo[i][pJailed] == 33)
  242.             {
  243.                 SetPlayerInterior(i, 10);
  244.                 SetPlayerPos(i,223.5218,114.8807,999.0156);
  245.             }
  246.             else if(PlayerInfo[i][pJailed] == 24)
  247.             {
  248.                 SetPlayerInterior(i, 0);
  249.                 SetPlayerVirtualWorld(i, 0);
  250.                 SetPlayerPos(i,1803.0222,-1576.6367,13.4102);
  251.                 SetPlayerFacingAngle(i, 276.0733);
  252.             }
  253.             else if(PlayerInfo[i][pJailed] == 9)
  254.             {
  255.                 PlayerInfo[i][pJailed] = 0;
  256.                 PlayerInfo[i][pJailTime] = 0;
  257.                 PlayerInfo[i][pMuted] = 0;
  258.                 SetPlayerSpawn(i);
  259.             }
  260.             else if(PlayerInfo[i][pJailed] == 2 || PlayerInfo[i][pJailed] == 11 || PlayerInfo[i][pJailed] == 16)
  261.             {
  262.                 SetPlayerPos(i, 197.8425,178.8899,1003.0234);
  263.                 SetPlayerInterior(i, 3);
  264.             }
  265.             else if(PlayerInfo[i][pJailed] == 27)
  266.             {
  267.                 SetPlayerInterior(i, 6);
  268.                 storeexit[i] = 67;
  269.                 SetPlayerPos(i, 268.1595,77.9132,1001.0391);
  270.             }
  271.             SetPlayerHealth(i, 100.0);
  272.             SetPlayerArmour(i, 0);
  273.             PlayerInfo[i][pJailed] = 0;
  274.             GameTextForPlayer(i, "~g~Livre", 5000, 1);
  275.             PlayerTextDrawHide(i, TextHospital[i]);
  276.             SetPlayerSkin(i, PlayerInfo[i][pSkin]);
  277.             ClearCrime(i);
  278.             AdvogadoInfo[i][advogadoID] = INVALID_PLAYER_ID;
  279.             SetPlayerToTeamColor(i);
  280.            
  281.             setarInfoCadeia(i, "Nenhum", "Nenhum", 998);
  282.            
  283.             CheckConquista(i, Conquista_Solto);
  284.         }
  285.     }
  286.    
  287.     if(PlayerDrunk[i] >= 5)
  288.     {
  289.         PlayerDrunkTime[i] ++ ;
  290.         if(PlayerDrunkTime[i] >= 5)
  291.         {
  292.             PlayerDrunkTime[i] = 0;
  293.             PlayerDrunk[i] = 0;
  294.             new Float:angle;
  295.             GetPlayerFacingAngle(i, angle);
  296.             if(IsPlayerInAnyVehicle(i) && GetPlayerState(i) == 2)
  297.             {
  298.                 SetVehicleZAngle(GetPlayerVehicleID(i), angle + 25);
  299.             }
  300.             else
  301.             {
  302.                 ApplyAnimation(i,"PED", "WALK_DRUNK",4.0,0,1,0,0,0);
  303.             }
  304.         }
  305.     }
  306.  
  307.     if(PlayerCuffed[i] == 1)
  308.     {
  309.         if(PlayerCuffedTime[i] <= 0)
  310.         {
  311.             Controle(i, 1);
  312.             PlayerCuffed[i] = 0;
  313.             PlayerCuffedTime[i] = 0;
  314.         }
  315.         else
  316.         {
  317.             PlayerCuffedTime[i] -= 1;
  318.         }
  319.     }
  320.  
  321.     //Sistema de Textdraw Itens no chao
  322.     new playerWorld = GetPlayerVirtualWorld(i);
  323.  
  324.     for(new item; item != MAX_DROP_ITENS; item++)
  325.     {
  326.         if (DropItensInfo[item][drop_valid] && playerWorld == DropItensInfo[item][drop_world])
  327.         {
  328.             if (IsPlayerInRangeOfPoint(i, 1.5, DropItensInfo[item][drop_x], DropItensInfo[item][drop_y], DropItensInfo[item][drop_z]))
  329.             {
  330.                 if (DropItensInfo[item][drop_type] != ITEM_TYPE_WEAPON)
  331.                 {
  332.                     format(gstring, sizeof (gstring), "Item: %s com %d Unidade(s)", DropItensInfo[item][drop_nome], DropItensInfo[item][drop_quantia]);
  333.                 } else {
  334.                     format(gstring, sizeof (gstring), "Arma: %s com %d Bala(s)", DropItensInfo[item][drop_nome], DropItensInfo[item][drop_quantia]);
  335.                 }
  336.                 PlayerTextDrawSetString(i, DropTextdraw5[i], gstring);
  337.  
  338.                 TextDrawShowForPlayer(i, DropTextdraw0);
  339.                 TextDrawShowForPlayer(i, DropTextdraw1);
  340.                 TextDrawShowForPlayer(i, DropTextdraw2);
  341.                 TextDrawShowForPlayer(i, DropTextdraw3);
  342.                 TextDrawShowForPlayer(i, DropTextdraw4);
  343.                 PlayerTextDrawShow(i, DropTextdraw5[i]);
  344.  
  345.                 KillTimer(GetPVarInt(i, "varDropTimer"));
  346.                 SetPVarInt(i, "varDropTimer", SetTimerEx("hideDropTextdraws", 1000, false, "i", i));
  347.                 break;
  348.             }
  349.         }
  350.     }
  351.  
  352.     if (!IsPlayerHaveRespect(i)) return true;
  353.  
  354.     playerLevelUp(i);
  355.  
  356.     return true;
  357. }
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