SA-MP Forums Archive
[Ajuda] Problema com Funзoes - 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] Problema com Funзoes (/showthread.php?tid=290255)



[Ajuda] Problema com Funзoes - Jason` - 15.10.2011

Estou com um problema no meu gamemode onde duas funcoes muito importantes para meu infoorg estao dando problema, GetPlayerID e IsPlayerOnline, queria saber se essas funзoes estao na include a_samp ou se estao em outra include, ate porque no momento as unicas includes do gm sao a_samp, dini, zcmd e sscanf.

Agradeзo desde ja


Re: Problema com Funзoes - Sergiinhonike - 15.10.2011

Negativo, estas funзхes nгo se encontram no include a_samp!!

GetPlayerID
pawn Код:
stock GetPlayerID(const playername[]) //By Jan "DracoBlue" Schьtze (edited by Gabriel "Larcius" Cordes)
{
    new playername1[256];
    for (new i=0;i<MAX_PLAYERS;i++)
    {
        if (IsPlayerConnected(i))
        {
            GetPlayerName(i,playername1,sizeof(playername1));
            if (strcmp(playername1,playername,true)==0)
            {
                return i;
            }
        }
    }
}
A outra eu nгo tenho!
Se te ajudei da Rep. pls


Re: Problema com Funзoes - Jason` - 15.10.2011

vlw rep add, alguem tem o IsPlayerOnline?


Re: Problema com Funзoes - Sergiinhonike - 15.10.2011

IsPlayerOnline seria o mesmo que IsPlayerConnected??
pawn Код:
#define IsPlayerOnline IsPlayerConnected



Re: Problema com Funзoes - Jason` - 15.10.2011

Acho que й diferente, estou usando o Infoorg de outro gm, e ele ate usa IsPlayerConnected e IsPlayerOnline no mesmo code, logo imagino que nao seja a mesma coisa.


Re: Problema com Funзoes - ViniBorn - 15.10.2011

IsPlayerOnline , nгo seria IsPlayerConnected ?


Re: Problema com Funзoes - Ricop522 - 15.10.2011

pawn Код:
stock isPlayerOnline ( nome[] ) //by Ricop522
{
    for(new a = 0, b = GetMaxPlayers(); a < b; ++a);
    {
        new name2[MAX_PLAYER_NAME];
        GetPlayerName(a, name2, sizeof(name2));
        if (strcmp(nome, name2, true) != 0) {
            return true;
        }
    }
    return false;
}
Eu fiz pra vocк, testa ai se funciona , abзs
se for por id:
pawn Код:
stock isPlayerOnline(id) {
    if(IsPlayerConnected(id)) return true;
    return false;
}



Re: Problema com Funзoes - Sergiinhonike - 15.10.2011

Tenta como eu falei se funcionar й lucro...

@EDIT

Esquece ja vocк tem a func.


Re: Problema com Funзoes - [O.z]Caroline - 15.10.2011

pawn Код:
GetPlayerID(p[])
{
    new a[24];
    for(new i; i < MAX_PLAYERS; ++i)
    {
        if(IsPlayerConnected(i))
        {
            GetPlayerName(i, a, 24);
            if(!strcmp(p, a, true))
            {
                return i;
            }
        }
    }
    return 0;
}

#define IsPlayerOnline IsPlayerConnected