[Ajuda] Eventos
#1

Pessoal quando da este erro aki olha:
pawn Код:
AdminSysteam.pwn(3446) : warning 225: unreachable code
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


1 Warning.
Linha 3446:
pawn Код:
if(Proibido == 1) Proibido = 0;
Comando dando error:
pawn Код:
new stringf[256];
new Proibido = 1;

CMD:newevento(playerid,params[])
{
    if(PlayerDados[playerid][Admin] < 3) return SendClientMessage(playerid, BRANCO, "Vocк precisa ser admin nivel 3 para usar este comando!");
    if(EventoCriado == 1) return SendClientMessage(playerid, COLOR_RED, "[LVDM](ERRO) Um evento ja foi criado, espere terminar para criar outro.");
    return SendClientMessage(playerid, COLOR_RED, "/newevento [Nome].");
    if(Proibido == 1) Proibido = 0;
    new pname[MAX_PLAYER_NAME];
    GetPlayerName(playerid, pname, MAX_PLAYER_NAME);
    interiore = GetPlayerInterior(playerid);
    GetPlayerPos(playerid, eventoX, eventoY, eventoZ);
    EventoCriado = 1;
    format(stringf, sizeof(stringf), "(LVDM) O Administrador %s criou um evento (В») Nome: %s (В») Digite: (/irevento)", pname);
    SendClientMessageToAll(COLOR_YELLOW, stringf);
    GameTextForAll("~y~Evento ~g~Criado ~y~use ~b~/irevento", 6000, 1);
    guerra = GangZoneCreate(eventoX-80,eventoY-80,eventoX+80,eventoY+80);
    GangZoneShowForAll(guerra,0xFF0000AA);
    SendClientMessage(playerid, 0x008000AA, "[LVDM](EVENTO) Evento criado com sucesso use ''/inievento'' quando vocк for inicialo");
    SendClientMessage(playerid, 0x008000AA, "[LVDM](EVENTO) Caso vocк queira cancela-lo use ''/cancelevento''");
    return 1;
}
Quando da isto ae significa o ke? (Por que ta dando o erro?)
Reply
#2

Poste o new Proibido.
Reply
#3

Jб editei oe la abaixo do strinf '--'

@EDIT



Ganhei a pa de ouro '--'
Reply
#4

oo Pessoal ajuda ae!!

Ajuda poxa to kerendo ligar servidor e to pagando host atoa '--'
Reply
#5

PHP код:
new stringf[128];

CMD:newevento(playerid,params[])
{
    if(
PlayerDados[playerid][Admin] < 3) return SendClientMessage(playeridBRANCO"Vocк precisa ser admin nivel 3 para usar este comando!");
    if(
EventoCriado == 1) return SendClientMessage(playeridCOLOR_RED"[LVDM](ERRO) Um evento ja foi criado, espere terminar para criar outro.");
    return 
SendClientMessage(playeridCOLOR_RED"/newevento [Nome].");
    new 
pname[MAX_PLAYER_NAME];
    
GetPlayerName(playeridpnameMAX_PLAYER_NAME);
    
interiore GetPlayerInterior(playerid);
    
GetPlayerPos(playerideventoXeventoYeventoZ);
    
EventoCriado 1;
    
format(stringfsizeof(stringf), "(LVDM) O Administrador %s criou um evento (В») Nome: %s (В») Digite: (/irevento)"pname);
    
SendClientMessageToAll(COLOR_YELLOWstringf);
    
GameTextForAll("~y~Evento ~g~Criado ~y~use ~b~/irevento"60001);
    
guerra GangZoneCreate(eventoX-80,eventoY-80,eventoX+80,eventoY+80);
    
GangZoneShowForAll(guerra,0xFF0000AA);
    
SendClientMessage(playerid0x008000AA"[LVDM](EVENTO) Evento criado com sucesso use ''/inievento'' quando vocк for inicialo");
    
SendClientMessage(playerid0x008000AA"[LVDM](EVENTO) Caso vocк queira cancela-lo use ''/cancelevento''");
    return 
1;

Reply
#6

Failed delete.

Mas jб resolvi o problema fazendo isto! me diga se isto pode bugar?

pawn Код:
new stringf[256];
new tmpf[1024];
new idxf;
pawn Код:
CMD:newevento(playerid,params[],cmdtext[])
{
    tmpf = strtok(cmdtext, idxf);
    if(PlayerDados[playerid][Admin] < 3) return SendClientMessage(playerid, BRANCO, "Vocк precisa ser admin nivel 3 para usar este comando!");
    {
        if(EventoCriado == 1) return SendClientMessage(playerid, COLOR_RED, "[LVDM](ERRO) Um evento ja foi criado, espere terminar para criar outro.");
        if(!strlen(tmpf))
        {
            SendClientMessage(playerid, COLOR_RED, "/newevento [Nome].");
            return 1;
        }
        if(Proibido == 1) Proibido = 0;
        new pname[MAX_PLAYER_NAME];
        GetPlayerName(playerid, pname, MAX_PLAYER_NAME);
        interiore = GetPlayerInterior(playerid);
        GetPlayerPos(playerid, eventoX, eventoY, eventoZ);
        EventoCriado = 1;
        format(stringf, sizeof(stringf), "(LVDM) O Administrador %s criou um evento (В») Nome: %s (В») Digite: (/irevento)", pname);
        SendClientMessageToAll(COLOR_YELLOW, stringf);
        GameTextForAll("~y~Evento ~g~Criado ~y~use ~b~/irevento", 6000, 1);
        guerra = GangZoneCreate(eventoX-80,eventoY-80,eventoX+80,eventoY+80);
        GangZoneShowForAll(guerra,0xFF0000AA);
        SendClientMessage(playerid, 0x008000AA, "[LVDM](EVENTO) Evento criado com sucesso use ''/inievento'' quando vocк for inicialo");
        SendClientMessage(playerid, 0x008000AA, "[LVDM](EVENTO) Caso vocк queira cancela-lo use ''/cancelevento''");
    }
    return 1;
}
pawn Код:
strtok(const string[], &index)
{
    new length = strlen(string);
    while ((index < length) && (string[index] <= ' '))
    {
        index++;
    }

    new offset = index;
    new result[20];
    while ((index < length) && (string[index] > ' ') && ((index - offset) < (sizeof(result) - 1)))
    {
        result[index - offset] = string[index];
        index++;
    }
    result[index - offset] = EOS;
    return result;
}
Serб se vai bugar? uso zcmd mas axo ke isso ae inclue outro sistema de comandos nй? entгo buga?
Reply
#7

pawn Код:
if(Proibido == 1) Proibido = 0; //isso nгo faz sentido nenhum.
pawn Код:
CMD:newevento(playerid,params[],cmdtext[])
{
    tmpf = strtok(cmdtext, idxf);
    if(PlayerDados[playerid][Admin] < 3) return SendClientMessage(playerid, BRANCO, "Vocк precisa ser admin nivel 3 para usar este comando!");
    {
        if(EventoCriado == 1) return SendClientMessage(playerid, COLOR_RED, "[LVDM](ERRO) Um evento ja foi criado, espere terminar para criar outro.");
        if(!strlen(tmpf))
        {
            SendClientMessage(playerid, COLOR_RED, "/newevento [Nome].");
            return 1;
        }
        if(Proibido == 1) Proibido = 0;
        new pname[MAX_PLAYER_NAME];
        GetPlayerName(playerid, pname, MAX_PLAYER_NAME);
        interiore = GetPlayerInterior(playerid);
        GetPlayerPos(playerid, eventoX, eventoY, eventoZ);
        EventoCriado = 1;
        format(stringf, sizeof(stringf), "(LVDM) O Administrador %s criou um evento (В») Nome: %s (В») Digite: (/irevento)", pname);
        SendClientMessageToAll(COLOR_YELLOW, stringf);
        GameTextForAll("~y~Evento ~g~Criado ~y~use ~b~/irevento", 6000, 1);
        guerra = GangZoneCreate(eventoX-80,eventoY-80,eventoX+80,eventoY+80);
        GangZoneShowForAll(guerra,0xFF0000AA);
        SendClientMessage(playerid, 0x008000AA, "[LVDM](EVENTO) Evento criado com sucesso use ''/inievento'' quando vocк for inicialo");
        SendClientMessage(playerid, 0x008000AA, "[LVDM](EVENTO) Caso vocк queira cancela-lo use ''/cancelevento''");
    }
    return 1;
}
Й melhor usar sscanf.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)