[Ajuda] Usar chat somente se estiver logado...
#3

Vocк tem que cria uma variavel.
Exp Bбsico:

PHP код:
new bool:Logado[MAX_PLAYERS] = false;


public 
onPlayerSpawn(playerid)
{
    if(
Logado[playerid] == false)
    {
        
Logado[playerid] = true;
    }
}


public 
OnPlayerText(playeridtext[])
{
    if(
text[0] == '.')
    {
            if(
Logado[playerid] == false) return SendClientMessage(playerid, -1"[x] Vocк tem que estar logado para usar o chat do clг!");
             
format(pFilesizeof(pFile), "clas/%s.ini"PlayerName(playerid));
             if(
dini_Exists(pFile))
             {
             if(
strcmp(dini_Get(pFile"cla"), "Nenhum"false))
            {
                new
                    
tmp[128]
                ;
                
strmid(tmptext1strlen(text));
                if(!
strlen(tmp))
                {
                    
SendClientMessage(playeridCOR_BRANCO"[ > ] Uso correto: . [texto]");
                    return 
0;
                }
                else
                {
                    for(new 
0MAX_PLAYERSc++)
                    {
                        if(
IsPlayerConnected(c))
                        {
                            
format(gFilesizeof(gFile), "clas/%s.ini"PlayerName(c));
                            if(
strcmp(dini_Get(gFile"cla"), "Nenhum"false))
                            {
                                if(
strcmp(dini_Get(gFile"cla"), dini_Get(pFile"cla"), true) == 0)
                                {
                                    
format(gstringsizeof(gstring), "( C/C ) %s: %s"PlayerName(playerid), tmp);
                                    
SendClientMessage(c0x00FF00AAgstring);
                                }
                              }
                        }
                    }
                    return 
0;
                }
               }
        }
    }
    return 
1;

Reply


Messages In This Thread
Usar chat somente se estiver logado... - by viniciussvl - 12.07.2016, 18:28
Re: Usar chat somente se estiver logado... - by F1N4L - 12.07.2016, 18:41
Respuesta: Usar chat somente se estiver logado... - by SammyJ - 12.07.2016, 18:44
Re: Usar chat somente se estiver logado... - by viniciussvl - 12.07.2016, 20:19
Re: Usar chat somente se estiver logado... - by F1N4L - 12.07.2016, 20:26
Re: Usar chat somente se estiver logado... - by viniciussvl - 12.07.2016, 20:38
Respuesta: Usar chat somente se estiver logado... - by Kanuy - 12.07.2016, 20:52
Re: Usar chat somente se estiver logado... - by viniciussvl - 12.07.2016, 21:04
Re: Usar chat somente se estiver logado... - by pWesley - 12.07.2016, 21:10
Respuesta: Re: Usar chat somente se estiver logado... - by Kanuy - 12.07.2016, 21:21

Forum Jump:


Users browsing this thread: 1 Guest(s)