Advertisement
Guest User

Untitled

a guest
Jun 27th, 2017
47
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 4.70 KB | None | 0 0
  1.     if(strcmp(cmd, "/usar", true) == 0)
  2.     {
  3.         if(IsPlayerConnected(playerid))
  4.         {
  5.             new droga[256];
  6.             droga = strtok(cmdtext, idx);
  7.             if(!strlen(droga))
  8.             {
  9.                 SendClientMessage(playerid,0xFFFF00AA,"USE: /usar [droga] [quantidade]");
  10.                 SendClientMessage(playerid,0xFFFF00AA,"Drogas: maconha,crack,cocaina,lancaperfume");
  11.                 return 1;
  12.             }
  13.             if(strcmp(droga,"maconha",true) == 0)
  14.             {
  15.                 if(FusioN_Info[playerid][pMaconha] >= 0)
  16.                 {
  17.                     new quant;
  18.                     quant = strval(tmp);
  19.                     Noiado[playerid] += 1;
  20.                     if(Noiado[playerid] >= 3)
  21.                     {
  22.                         GameTextForPlayer(playerid, "~r~No~g~ia~y~do~n~", 4000, 1);
  23.                     }
  24.                     if(FusioN_Info[playerid][pMaconha] >= quant)
  25.                     {
  26.                         FusioN_Info[playerid][pMaconha] -= quant;
  27.                         AdicionarColete(playerid,quant);
  28.                         format(string,sizeof(string),"%s pegou o baseado e fumou.",pNome(playerid));
  29.                         ChatProx(30.0, playerid, string,COLOR_PURPLE);
  30.                     }
  31.                 }
  32.                 else
  33.                 {
  34.                     SendClientMessage(playerid,branco,"Você não possui nenhuma grama de maconha.");
  35.                     return 1;
  36.                 }
  37.             }
  38.             else if(strcmp(droga,"crack",true) == 0)
  39.             {
  40.                 if(FusioN_Info[playerid][pCrack] >= 0)
  41.                 {
  42.                     new quant;
  43.                     quant = strval(tmp);
  44.                     Noiado[playerid] += 1;
  45.                     if(Noiado[playerid] >= 3)
  46.                     {
  47.                         GameTextForPlayer(playerid, "~r~No~g~ia~y~do~n~", 4000, 1);
  48.                     }
  49.                     if(FusioN_Info[playerid][pCrack] >= quant)
  50.                     {
  51.                         FusioN_Info[playerid][pCrack] -= quant;
  52.                         AdicionarColete(playerid,quant);
  53.                         format(string,sizeof(string),"%s pegou seu cachimbo de crack e fumou.",pNome(playerid));
  54.                         ChatProx(30.0, playerid, string,COLOR_PURPLE);
  55.                     }
  56.                 }
  57.                 else
  58.                 {
  59.                     SendClientMessage(playerid,branco,"Você não possui nenhuma pedra de crack.");
  60.                     return 1;
  61.                 }
  62.             }
  63.             else if(strcmp(droga,"cocaina",true) == 0)
  64.             {
  65.                 if(FusioN_Info[playerid][pCocaina] >= 0)
  66.                 {
  67.                     new quant;
  68.                     quant = strval(tmp);
  69.                     Noiado[playerid] += 1;
  70.                     if(Noiado[playerid] >= 3)
  71.                     {
  72.                         GameTextForPlayer(playerid, "~r~No~g~ia~y~do~n~", 4000, 1);
  73.                     }
  74.                     if(FusioN_Info[playerid][pCocaina] >= quant)
  75.                     {
  76.                         FusioN_Info[playerid][pCocaina] -= quant;
  77.                         AdicionarColete(playerid,quant);
  78.                         format(string,sizeof(string),"%s pegou um saco de farinha e o cherou.",pNome(playerid));
  79.                         ChatProx(30.0, playerid, string,COLOR_PURPLE);
  80.                     }
  81.                 }
  82.                 else
  83.                 {
  84.                     SendClientMessage(playerid,branco,"Você não possui nenhuma grama de cocaína.");
  85.                     return 1;
  86.                 }
  87.             }
  88.             else if(strcmp(droga,"lancaperfume",true) == 0)
  89.             {
  90.                 if(FusioN_Info[playerid][pLanca] >= 0)
  91.                 {
  92.                     new quant;
  93.                     quant = strval(tmp);
  94.                     Noiado[playerid] += 1;
  95.                     if(Noiado[playerid] >= 3)
  96.                     {
  97.                         GameTextForPlayer(playerid, "~r~No~g~ia~y~do~n~", 4000, 1);
  98.                     }
  99.                     if(FusioN_Info[playerid][pLanca] >= quant)
  100.                     {
  101.                         new Float:vida;
  102.                         GetPlayerHealth(playerid, vida);
  103.                         FusioN_Info[playerid][pLanca] -= quant;
  104.                         SetPlayerHealth(playerid,vida+quant);
  105.                         GivePlayerWeapon(playerid,31,quant);
  106.                         format(string,sizeof(string),"%s pegou o vidro de Lança Perfume e cherou.",pNome(playerid));
  107.                         ChatProx(30.0, playerid, string,COLOR_PURPLE);
  108.                     }
  109.                 }
  110.                 else
  111.                 {
  112.                     SendClientMessage(playerid,branco,"Você não possui nenhum mililitro de lança perfume.");
  113.                     return 1;
  114.                 }
  115.             }
  116.         }
  117.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement