SA-MP Forums Archive
[Ajuda] OnPlayerKeyStateChange - 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] OnPlayerKeyStateChange (/showthread.php?tid=517029)



OnPlayerKeyStateChange - UzumakiNaruto - 02.06.2014

Ai galera eu queria saber pq eu n to conseguindo deixar o comando so para admin,sempre que coloco pra so admin poder usar ele nгo funciona ( eu aperto o botгo e nгo acontece nada)

pawn Код:
if (PRESSED(KEY_SUBMISSION))
    {
        if(PlayerInfo[playerid][pAdmin] < 1)
        {
            SetPlayerHealth(playerid, 99999);
            SetPlayerArmour(playerid, 99999);
            SetPlayerSkin(playerid, 199);
        }
        else if (RELEASED(KEY_SUBMISSION))
        {
            SetPlayerHealth(playerid, 100);
            SetPlayerArmour(playerid, 100);
            SetPlayerSkin(playerid, 20);
        }
     }



Re: OnPlayerKeyStateChange - MultiKill - 02.06.2014

pawn Код:
if(PlayerInfo[playerid][pAdmin] < 1) // < 1 й igual a zero.



Re: OnPlayerKeyStateChange - UzumakiNaruto - 02.06.2014

n isso n fez diferenзa,mesmo eu alterando pra > 1 e quando coloco == 1,ele vai normal,so q quando eu solto o botao ele n seta a skin 20 de volta


Re: OnPlayerKeyStateChange - Smoking_Script - 03.06.2014

Amigo voce quer que so admin possa usar e quando dez clicar voltar pra skin 20 ne ? nn testei aqui ver ai


pawn Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
    if(newkeys == KEY_SUBMISSION)
    {
    if(PlayerInfo[playerid][pAdmin] >= 1)
    {
        SetPlayerHealth(playerid, 99999);
        SetPlayerArmour(playerid, 99999);
        SetPlayerSkin(playerid, 199);
    }
    }
    else
    {
    if(PlayerInfo[playerid][pAdmin] >= 1)
    {
        SetPlayerHealth(playerid, 100);
        SetPlayerArmour(playerid, 100);
        SetPlayerSkin(playerid, 20);
    }
    }
    return 1;
}