SHARE
TWEET

Untitled

a guest Jul 18th, 2019 89 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. public GameModeInit
  2. {
  3.     SetTimer("OnPlayerInGangZone", Segundos(2), true); // Settimer ao iniciar o gm, true ficar repitindo
  4.     return 1;
  5. }
  6.  
  7. forward OnPlayerInGangZone();
  8. public OnPlayerInGangZone()
  9. {
  10.     for(new i = 0; i < MAX_PLAYERS; i++)
  11.     {
  12.         if(IsPlayerInPlace(i, 2893.7405,834.1365, 2780.5613,1019.6943)) // Pos XMin, YMin, XMax, YMax
  13.         {
  14.             PlayerTextDrawSetString(i, TextZonaInfo[i][0], "Total de mercadorias");
  15.             PlayerTextDrawShow(i, TextZonaInfo[i][0]);
  16.            
  17.             format(gStr, sizeof(gStr), "Utilitarios: %d > Loja de Skins: %d > Lanchonetes: %d", DOF2_GetInt("Distribuidora.ini", "Utilitarios"), DOF2_GetInt("Distribuidora.ini", "Skins"), DOF2_GetInt("Distribuidora.ini", "Lanches"));
  18.             PlayerTextDrawSetString(i, TextZonaInfo[i][1], gStr);
  19.             PlayerTextDrawShow(i, TextZonaInfo[i][1]);
  20.             SendClientMessage(i, COR_ERRO, "tESTE");
  21.  
  22.             } else {
  23.            
  24.             PlayerTextDrawHide(i, TextZonaInfo[i][0]);
  25.             PlayerTextDrawHide(i, TextZonaInfo[i][1]);
  26.         }
  27.     }
  28.     return 1;
  29. }
  30.  
  31. stock IsPlayerInPlace(playerid, Float:XMin, Float:YMin, Float:XMax, Float:YMax)
  32. {
  33.     new RetValue = 0, Float:aX, Float:aY, Float:aZ ;
  34.     GetPlayerPos(playerid, aX, aY, aZ);
  35.     if(aX >= XMin && aY >= YMin && aX < XMax && aY < YMax)
  36.     {
  37.         RetValue = 1;
  38.     }
  39.     return RetValue;
  40. }
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