SA-MP Forums Archive
[Ajuda] comando nгo estб pegando - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: Non-English (https://sampforum.blast.hk/forumdisplay.php?fid=9)
+--- Forum: Languages (https://sampforum.blast.hk/forumdisplay.php?fid=33)
+---- Forum: Português/Portuguese (https://sampforum.blast.hk/forumdisplay.php?fid=34)
+---- Thread: [Ajuda] comando nгo estб pegando (/showthread.php?tid=520851)



comando nгo estб pegando - CrazyHelp - 20.06.2014

galera criei este comando agora, mas nгo esta funcionando, alguem poderia me falar qual erro ?

pawn Код:
if(!strcmp(cmdtext, "/mf", true, 3))
       if(dini_Int(file, "Profissao") == MotoqueiroFantasma || dini_Int(file, "aAdmin") == 1)
        {
    if(GetPlayerVehicleID(playerid) == 463)
    {
        fogo = CreateObject(18688, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0);
        AttachObjectToPlayer(fogo, playerid, 0.0, 0.0, -1.2, 0.0, 0.0, 0);
        SendClientMessage(playerid, -1, "Vocк Esta Em Modo (MF)");
        SetPlayerSkin(playerid, 181);
    }
    return 1;
}
pawn Код:
if(!strcmp(cmdtext, "/dmf", true, 3))
       if(dini_Int(file, "Profissao") == MotoqueiroFantasma || dini_Int(file, "aAdmin") == 1)
{
    if(GetPlayerVehicleID(playerid) == 463)
    {
        DestroyObject(fogo);
        RemovePlayerAttachedObject(playerid, fogo);
        SetPlayerSkin(playerid, 181);
        SendClientMessage(playerid, -1, "Vocк Voltou ao Normal");
    }
    return 1;
}



Re: comando nгo estб pegando - MultiKill - 20.06.2014

Retire o ! do strcmp.


Re: comando nгo estб pegando - CrazyHelp - 20.06.2014

pawn Код:
C:\Users\Pedro\Desktop\BVP\gamemodes\BVP.pwn(15554) : warning 206: redundant test: constant expression is non-zero
C:\Users\Pedro\Desktop\BVP\gamemodes\BVP.pwn(15554) : error 029: invalid expression, assumed zero
C:\Users\Pedro\Desktop\BVP\gamemodes\BVP.pwn(15554 -- 15555) : warning 215: expression has no effect
C:\Users\Pedro\Desktop\BVP\gamemodes\BVP.pwn(15555) : error 001: expected token: ";", but found "if"
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


2 Errors.
pawn Код:
if(cmdtext, "/mf", true, 3))
       if(dini_Int(file, "Profissao") == MotoqueiroFantasma || dini_Int(file, "aAdmin") == 1)
        {
    if(GetPlayerVehicleID(playerid) == 463)
    {
        fogo = CreateObject(18688, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0);
        AttachObjectToPlayer(fogo, playerid, 0.0, 0.0, -1.2, 0.0, 0.0, 0);
        SendClientMessage(playerid, -1, "Vocк Esta Em Modo (MF)");
        SetPlayerSkin(playerid, 181);
        }
        return 1;
    }



Re: comando nгo estб pegando - darkxdll - 20.06.2014

PHP код:
    if(GetPlayerVehicleID(playerid) == 463
Estб funзгo e para pegar o ID do veiculo e nгo o modelo , o certo seria usar a funзгo :

PHP код:
if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 463



Re: comando nгo estб pegando - MultiKill - 20.06.2014

Mude:
pawn Код:
if(cmdtext, "/mf", true, 3))
Para:
pawn Код:
if(strcmp(cmdtext, "/mf", true, 3))
E Mude:
pawn Код:
if(!strcmp(cmdtext, "/dmf", true, 3))
Para:
pawn Код:
if(strcmp(cmdtext, "/dmf", true, 3))
Era so remover o operador logico !


Re: comando nгo estб pegando - CrazyHelp - 20.06.2014

Quote:
Originally Posted by darkxdll
Посмотреть сообщение
PHP код:
    if(GetPlayerVehicleID(playerid) == 463
Estб funзгo e para pegar o ID do veiculo e nгo o modelo , o certo seria usar a funзгo :

PHP код:
if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 463
Obrigado, deu certo.