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



Ajuda Rapidinha (( Super Duvida )) - fodaoeusim - 14.07.2012

PHP код:
    if (strcmp("/criarevento"cmdtexttrue10) == 0) {
        new 
tmp[256];
        
tmp strtok(cmdtextidx);
        new 
aname[MAX_PLAYER_NAME];
        
GetPlayerName(playeridanameMAX_PLAYER_NAME);
        
format(filesizeof(file), PASTA_CONTASaname);
        if (
pAdmin[playerid] > 1) {
            if (
EventoCriado == 1) return SendClientMessage(playeridVermelho"(ERRO) Um evento ja foi criado, espere terminar para criar outro.");
            if (!
strlen(tmp)) {
                
SendClientMessage(playeridVermelho"/criarevento [Nome].");
                return 
1;
            }
            if (
Proibido == 1Proibido 0;
            new 
pname[MAX_PLAYER_NAME];
            
GetPlayerName(playeridpnameMAX_PLAYER_NAME);
            
interiore GetPlayerInterior(playerid);
            
GetPlayerPos(playerideventoXeventoYeventoZ);
            
EventoCriado 1;
            
format(stringsizeof(string), "(INFO) O Administrador %s criou um evento (») Nome: %s (») Digite: (/irevento)"pnametmp);
            
SendClientMessageToAll(Amarelostring);
            
GameTextForAll("~y~Evento ~g~Criado ~y~use ~b~/irevento"60001);
            
guerra GangZoneCreate(eventoX 80eventoY 80eventoX 80eventoY 80);
            
GangZoneShowForAll(guerra0xFF0000AA);
            
SendClientMessage(playerid0x008000AA"(INFO) Evento criado com sucesso use:/comecarevento quando vocк for inicialo");
            
SendClientMessage(playerid0x008000AA"(INFO) Caso vocк queira cancela-lo use:/cancelarevento");
            return 
1;
        }
    } 
a minha duvida й o seguinte o new tmp significa o tamanho do nome que pode ser usado no evento ne supondo se todos eventos fosse padrao com o mesmo nome e fosse com o nome Drift o new tmp seria representado por 5 nao por 256 ne?


Re: Ajuda Rapidinha (( Super Duvida )) - .FuneraL. - 14.07.2012

256 significa o lenght de characteres qe vocк pode utilizar em uma string, ou seja, maximo 256 Letras, caso contrбrio vai cortar


Re: Ajuda Rapidinha (( Super Duvida )) - BreakDriFT - 14.07.2012

Lenbrando que o Mбximo de Tamanho й 128 .


Poderб ser maior em casos de dialogs e STRCAT entre outros


Re: Ajuda Rapidinha (( Super Duvida )) - fodaoeusim - 14.07.2012

obrigado!!!