[Ajuda] Clan Chat
#1

Queria Tranformar Isso em Um CMD:
PHP код:
public OnPlayerText(playerid, text[])
{
    if(
text[0] == '!')
    {
        
format(pFile, sizeof(pFile), "Servidor/Clas/%s.ini", PlayerName(playerid));
        if(
dini_Exists(pFile))
        {
            if(
strcmp(dini_Get(pFile, "cla"), "Nenhum", false))
            {
                new
                
tmp[128]
                ;
                
strmid(tmp, text, 1, strlen(text));
                if(!
strlen(tmp))
                {
                    
SendClientMessage(playerid, -1, "[New-TheDM] {1E90FF}Uso correto: ! [ Mensagem ]");
                    return 
0;
                }
                else
                {
                    for(new 
c = 0; c < MAX_PLAYERS; c++)
                    {
                        if(
IsPlayerConnected(c))
                        {
                            
format(gFile, sizeof(gFile), "Servidor/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(gstring, sizeof(gstring), "| Chat Clг | %s: %s", PlayerName(playerid), tmp);
                                    
SendClientMessage(c, 0x00FF00AA, gstring);
                                }
                            }
                        }
                    }
                    return 
0;
                }
            }
        }
    }
        return 
1;
} 
Reply
#2

Bom, tem varios tutoriais que tu pode achar np fуrum falando sobre como usar parвmetros no zcmd.Pode tambйm optar a usar sscanf.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)