[Ajuda]Sistema de Drogas
#1

Eu estou usando o sistema de drogas do Pedro_Miranda
Que esta no post: https://sampforum.blast.hk/showthread.php?tid=295149

Eu tentei adptar ele ao meu gm, mais deu 26 Erros.
Eu acho que deve ser algum erro nas "}"
Mais nao consegui achar. Se alguem que tem alto conhecimento poder me ajudar o code й o abaixo.

PHP код:
    if(strcmp(cmd"/usardrogas"true) == 0)
    {
        if(
IsPlayerConnected(playerid))
        {
        
tmp strtok(cmdtextidx);
        if(!
strlen(tmp))
        {
            
SendClientMessage(playeridCOLOR_GRAD2"USE: /usardrogas [Maconha, Cocaina, Crack]");
            return 
1;
        }
        new 
droga[8];
        if(
strcmp(droga"maconha"true) == 0)
        {
            if(
PlayerInfo[playerid][pDrogas] > 1)
            {
            
PlayerStoned[playerid] += 1;
            if(
PlayerStoned[playerid] >= 3) { GameTextForPlayer(playerid,"~w~Vocк estб~n~~y~Chapado",4000,1); }
            new 
Float:PlayersArmour;
            
GetPlayerArmour(playerid,PlayersArmour);
            
PlayerInfo[playerid][pDrogas] -= 2;
            new 
Dmelhoria PlayerInfo[playerid][pDrugPerk]; Dmelhoria += 2;
            if(
PlayersArmour >= 100)
            {
                
SetPlayerArmour(playerid100);
                
SendClientMessage(playerid,COLOR_LIGHTRED,"* Vocк nгo pode mais usar drogas!");
                return 
1;
            }
            else
            {
                
SetPlayerArmour(playeridPlayersArmour Dmelhoria);
            }
            
GetPlayerName(playeridsendernamesizeof(sendername));
            
format(stringsizeof(string), "* %s fumou maconha."sendername);
            
ProxDetector(30.0playeridstringCOLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
        }   
        else return 
SendClientMessage(playerid0xFFFFFFAA"Vocк nгo tem 2 gramas de maconha.");
        return 
1;
        }
    if(
strcmp(droga"cocaina"true) == 0)
    {
        if(
PlayerInfo[playerid][pDrogas2] > 1)
        {
        
PlayerStoned[playerid] += 1;
        if(
PlayerStoned[playerid] >= 3) { GameTextForPlayer(playerid,"~w~Vocк estб~n~~y~Cherado",4000,1); }
        new 
Float:PlayersArmour;
        
GetPlayerArmour(playerid,PlayersArmour);
        
PlayerInfo[playerid][pDrogas2] -= 2;
        new 
Dmelhoria PlayerInfo[playerid][pDrugPerk]; Dmelhoria += 2;
        if(
playersArmour >= 100)
          {
            
SetPlayerArmour(playerid100);
            
SendClientMessage(playerid,COLOR_LIGHTRED,"* Vocк nгo pode mais usar drogas!");
            return 
1;
            }
            else
            {
                
SetPlayerArmour(playeridPlayersArmour Dmelhoria);
            }
            
GetPlayerName(playeridsendernamesizeof(sendername));
            
format(stringsizeof(string), "* %s cheirou cocaina."sendername);
            
ProxDetector(30.0playeridstringCOLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
        }
        else return 
SendClientMessage(playerid0xFFFFFFAA"Vocк nгo tem 2 carrerinha de cocaina.");
        return 
1;
    }
    if(
strcmp(droga"crack"true) == 0)
    {
        if(
PlayerInfo[playerid][pDrogas3] > 1)
        {
        
PlayerStoned[playerid] += 1;
        if(
PlayerStoned[playerid] >= 3) { GameTextForPlayer(playerid,"~w~Vocк estб~n~~y~Noiado",4000,1); }
        new 
Float:PlayersArmour;
        
GetPlayerArmour(playerid,PlayersArmour);
        
PlayerInfo[playerid][pDrogas2] -= 3;
        new 
Dmelhoria PlayerInfo[playerid][pDrugPerk]; Dmelhoria += 2;
        if(
playersArmour >= 100)
          {
            
SetPlayerArmour(playerid100);
            
SendClientMessage(playerid,COLOR_LIGHTRED,"* Vocк nгo pode mais usar drogas!");
            return 
1;
            }
            else
            {
                
SetPlayerArmour(playeridPlayersArmour Dmelhoria);
            }
            
GetPlayerName(playeridsendernamesizeof(sendername));
            
format(stringsizeof(string), "* %s fumou crack."sendername);
            
ProxDetector(30.0playeridstringCOLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
        }
        else return 
SendClientMessage(playerid0xFFFFFFAA"Vocк nгo tem 2 pedra de crack.");
        return 
1;
    }
    return 
1;

Reply
#2

Posta os erros
Reply
#3

Existe programas que acham a falta de chaves ( } ) automaticamente.
Alguns exemplos:

https://sampforum.blast.hk/showthread.php?tid=291018
https://sampforum.blast.hk/showthread.php?tid=305047
Reply
#4

Problema resolvido ?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)