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



Clan Chat - JuniorTheDM - 26.07.2015

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;
} 



Re: Clan Chat - NegoEnsina - 26.07.2015

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.