[Ajuda] Erro no Comando
#1

Esse й o script do meu comando...Quando eu uso funciona normalmente, mas a mensagem de erro que й sу parecer quando alguйm digitar um comando errado! mas estб aparecendo quando eu uso o comando!

Quote:

public OnPlayerCommandText(playerid, cmdtext[])
{
if(strcmp("/comprararmas", cmdtext, true, 10) == 0)
{
if(IsPlayerInRangeOfPoint(playerid, 2.0, 295.4400,-38.1690,1001.5156) && GetPlayerInterior(playerid == 1) ||
IsPlayerInRangeOfPoint(playerid, 2.0, 295.4050,-80.2096,1001.5156) && GetPlayerInterior(playerid == 4) ||
IsPlayerInRangeOfPoint(playerid, 2.0, 287.7806,-107.9312,1001.5156) && GetPlayerInterior(playerid == 6) ||
IsPlayerInRangeOfPoint(playerid, 2.0, 313.9190,-133.9259,999.6016) && GetPlayerInterior(playerid == 7) ||
IsPlayerInRangeOfPoint(playerid, 2.0, 312.5132,-165.7230,999.6010) && GetPlayerInterior(playerid == 6))
{
ShowPlayerDialog(playerid, 347, 5, "Loja de Armas","Armas\tPreзo\tMuniзгo\n\
Faca\tR$100\n\
Pistola 9mm\tR$1000\t50\n\
Pistola Desert\tR$1250\t50\n\
Uzi\tR$2100\t200\n\
TEC-9\tR$2500\t200\n\
MP5\tR$3000\t100\n\
Ak47\tR$4000\t200\n\
M4\tR$4200\t200\n\
Granada\tR$500\t1\n\
MolotIv\tR$450\t1\n\
Escopeta\tR$2000\t100\n\
Escopeta Cano Curto\tR$2500\t100\n\
SPAS 12\tR$2500\t100\n\
Rifle Sniper\tR$5000\t25",
"Comprar", "Cancelar");
}
else
{
SendClientMessage(playerid, 0xFF6347AA, "[!] Vocк nгo estб em uma Loja de Armas");
}
}
return SendClientMessage(playerid, 0xFF6347AA, "[!] Comando Invalido");
}

Reply
#2

PS: Tem outros comandos.. mais isso sу acontece quando usa esse comando!
Reply
#3

Proxima vez, poste seu cуdigo entre [*pawn][*/pawn]
Sem asterisco.

@cуdigo

Utilize return 1; no comando para nгo continuar o que vier abaixo, no caso a mensagem de comando invalido.
PHP код:
public OnPlayerCommandText(playeridcmdtext[])
{
    if(
strcmp("/comprararmas"cmdtexttrue10) == 0)
    {
        if(
IsPlayerInRangeOfPoint(playerid2.0295.4400,-38.1690,1001.5156) && GetPlayerInterior(playerid) == 1) ||
        
IsPlayerInRangeOfPoint(playerid2.0295.4050,-80.2096,1001.5156) && GetPlayerInterior(playerid) == 4) ||
        
IsPlayerInRangeOfPoint(playerid2.0287.7806,-107.9312,1001.5156) && GetPlayerInterior(playerid) == 6) ||
        
IsPlayerInRangeOfPoint(playerid2.0313.9190,-133.9259,999.6016) && GetPlayerInterior(playerid) == 7) ||
        
IsPlayerInRangeOfPoint(playerid2.0312.5132,-165.7230,999.6010) && GetPlayerInterior(playerid) == 6))
        {
            
ShowPlayerDialog(playerid3475"Loja de Armas","Armas\tPreзo\tMuniзгo\n\
            Faca\tR$100\n\
            Pistola 9mm\tR$1000\t50\n\
            Pistola Desert\tR$1250\t50\n\
            Uzi\tR$2100\t200\n\
            TEC-9\tR$2500\t200\n\
            MP5\tR$3000\t100\n\
            Ak47\tR$4000\t200\n\
            M4\tR$4200\t200\n\
            Granada\tR$500\t1\n\
            MolotIv\tR$450\t1\n\
            Escopeta\tR$2000\t100\n\
            Escopeta Cano Curto\tR$2500\t100\n\
            SPAS 12\tR$2500\t100\n\
            Rifle Sniper\tR$5000\t25"
,
            
"Comprar""Cancelar");
        }
        else 
SendClientMessage(playerid0xFF6347AA"[!] Vocк nгo estб em uma Loja de Armas");
        return 
1;
    }
    return 
SendClientMessage(playerid0xFF6347AA"[!] Comando Invalido");

Reply
#4

Deu erro
Reply
#5

Quote:
Originally Posted by felipelm3g
Посмотреть сообщение
Deu erro
Tente agora, esqueci que tinha colocado parenteses na verificaзгo e nao retirei.

PHP код:
public OnPlayerCommandText(playeridcmdtext[])
{
    if(
strcmp("/comprararmas"cmdtexttrue10) == 0)
    {
        if(
IsPlayerInRangeOfPoint(playerid2.0295.4400,-38.1690,1001.5156) && GetPlayerInterior(playerid) == ||
        
IsPlayerInRangeOfPoint(playerid2.0295.4050,-80.2096,1001.5156) && GetPlayerInterior(playerid) == ||
        
IsPlayerInRangeOfPoint(playerid2.0287.7806,-107.9312,1001.5156) && GetPlayerInterior(playerid) == ||
        
IsPlayerInRangeOfPoint(playerid2.0313.9190,-133.9259,999.6016) && GetPlayerInterior(playerid) == ||
        
IsPlayerInRangeOfPoint(playerid2.0312.5132,-165.7230,999.6010) && GetPlayerInterior(playerid) == 6)
        {
            
ShowPlayerDialog(playerid3475"Loja de Armas","Armas\tPreзo\tMuniзгo\n\
            Faca\tR$100\n\
            Pistola 9mm\tR$1000\t50\n\
            Pistola Desert\tR$1250\t50\n\
            Uzi\tR$2100\t200\n\
            TEC-9\tR$2500\t200\n\
            MP5\tR$3000\t100\n\
            Ak47\tR$4000\t200\n\
            M4\tR$4200\t200\n\
            Granada\tR$500\t1\n\
            MolotIv\tR$450\t1\n\
            Escopeta\tR$2000\t100\n\
            Escopeta Cano Curto\tR$2500\t100\n\
            SPAS 12\tR$2500\t100\n\
            Rifle Sniper\tR$5000\t25"
,
            
"Comprar""Cancelar");
        }
        else 
SendClientMessage(playerid0xFF6347AA"[!] Vocк nгo estб em uma Loja de Armas");
        return 
1;
    }
    return 
SendClientMessage(playerid0xFF6347AA"[!] Comando Invalido");

Reply
#6

Deu certo agora
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)