[AJUDA]Evento
#1

Код:
if(strcmp(cmd, "/criarevento", true) == 0){if(IsPlayerConnected(playerid)){
if(PlayerInfo[playerid][pAdmin] >= 4){if(Evento == 1){SendClientMessage(playerid, COLOR_WHITE, "Jб estб decorrendo um evento use, /pararevento para abrir outro!");return true;}if(Evento == 0){
SendClientMessage(playerid, COLOR_WHITE, "Vocк estб criando um evento e chamando todos do BMC.");
for(new i = 0; i < MAX_PLAYERS; i++){if(IsPlayerConnected(i)){
Evento = 1;GetPlayerName(playerid, sendername, sizeof(sendername));
format(string,sizeof(string),"Administraзгo: %s estб chamando todos para um Evento.\nPara ir ao evento clique em 'SIM'.\nPara nгo ir clique em 'NГO'.",sendername);
ShowPlayerDialog(i, EVENTOC, DIALOG_STYLE_MSGBOX, "EVENTO INICIADO", string, "Sim", "Nгo");
GetPlayerPos(playerid,ex,ey,ez);}}}}return true;}}

if(strcmp(cmd, "/pararevento", true) == 0){if(PlayerInfo[playerid][pAdmin] >= 4){if(Evento == 0){SendClientMessage(playerid, COLOR_DBLUE, "Nгo estб ativo um evento atualmente, use /criarevento para criar um!");return true;}
if(Evento == 1){Evento = 0;GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "Administrador(a) %s cancelou um evento que estava ocorrendo.", sendername);
SendClientMessageToAll(COLOR_LIGHTBLUE,string);}}return true;}
esse code de evento.. para chamar .. podem me dizer onde coloca-lo?
Reply
#2

Deus, diz que eu nгo li isso.
Vocк pegou o Codigo que o Sivi postou, e nгo sabe nem onde colocar?
Reply
#3

Poste na
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
ajudei? Reep +
Reply
#4

Adicione isso а sua public OnPlayerCommandText .


Identei o cуdigo para vocк :


pawn Код:
if(strcmp(cmd, "/criarevento", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            if(PlayerInfo[playerid][pAdmin] >= 4)
            {
                if(Evento == 1)
                {
                    SendClientMessage(playerid, COLOR_WHITE, "Jб estб decorrendo um evento use, /pararevento para abrir outro!");
                    return true;
                }
                if(Evento == 0)
                {
                    SendClientMessage(playerid, COLOR_WHITE, "Vocк estб criando um evento e chamando todos do BMC.");
                    for(new i = 0; i < MAX_PLAYERS; i++)
                    {
                        if(IsPlayerConnected(i))
                        {
                            Evento = 1;
                            GetPlayerName(playerid, sendername, sizeof(sendername));
                            format(string,sizeof(string),"Administraзгo: %s estб chamando todos para um Evento.\nPara ir ao evento clique em 'SIM'.\nPara nгo ir clique em 'NГO'.",sendername);
                            ShowPlayerDialog(i, EVENTOC, DIALOG_STYLE_MSGBOX, "EVENTO INICIADO", string, "Sim", "Nгo");
                            GetPlayerPos(playerid,ex,ey,ez);
                        }
                    }
                }
            }
        }
        return true;
    }
    if(strcmp(cmd, "/pararevento", true) == 0)
    {
        if(PlayerInfo[playerid][pAdmin] >= 4)
        {
            if(Evento == 0)
            {
                SendClientMessage(playerid, COLOR_DBLUE, "Nгo estб ativo um evento atualmente, use /criarevento para criar um!");
                return true;
            }
            if(Evento == 1)
            {
                Evento = 0;
                GetPlayerName(playerid, sendername, sizeof(sendername));
                format(string, sizeof(string), "Administrador(a) %s cancelou um evento que estava ocorrendo.", sendername);
                SendClientMessageToAll(COLOR_LIGHTBLUE,string);
            }
        }
        return true;
    }


Espero ter ajudado .
Reply
#5

Mesmo colocando no Lugar certo,
O codigo nunca vai funcionar sem os Dialogs ¬¬
Reply
#6

Onde tem? eu vi esse code num post :/ comeзei PAWNO hj
Reply
#7

Quote:
Originally Posted by gcoder
Посмотреть сообщение
Onde tem? eu vi esse code num post :/ comeзei PAWNO hj
Cria nй champs.. ^^

TuT
https://sampforum.blast.hk/showthread.php?tid=119297
Reply
#8

No Pawn vocк aperta Control + F

Depois escreve OnPlayerCommandText

e bota esse cуdigo>

Код:
if(strcmp(cmd, "/criarevento", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            if(PlayerInfo[playerid][pAdmin] >= 4)
            {
                if(Evento == 1)
                {
                    SendClientMessage(playerid, COLOR_WHITE, "Jб estб decorrendo um evento use, /pararevento para abrir outro!");
                    return true;
                }
                if(Evento == 0)
                {
                    SendClientMessage(playerid, COLOR_WHITE, "Vocк estб criando um evento e chamando todos do BMC.");
                    for(new i = 0; i < MAX_PLAYERS; i++)
                    {
                        if(IsPlayerConnected(i))
                        {
                            Evento = 1;
                            GetPlayerName(playerid, sendername, sizeof(sendername));
                            format(string,sizeof(string),"Administraзгo: %s estб chamando todos para um Evento.\nPara ir ao evento clique em 'SIM'.\nPara nгo ir clique em 'NГO'.",sendername);
                            ShowPlayerDialog(i, EVENTOC, DIALOG_STYLE_MSGBOX, "EVENTO INICIADO", string, "Sim", "Nгo");
                            GetPlayerPos(playerid,ex,ey,ez);
                        }
                    }
                }
            }
        }
        return true;
    }
    if(strcmp(cmd, "/pararevento", true) == 0)
    {
        if(PlayerInfo[playerid][pAdmin] >= 4)
        {
            if(Evento == 0)
            {
                SendClientMessage(playerid, COLOR_DBLUE, "Nгo estб ativo um evento atualmente, use /criarevento para criar um!");
                return true;
            }
            if(Evento == 1)
            {
                Evento = 0;
                GetPlayerName(playerid, sendername, sizeof(sendername));
                format(string, sizeof(string), "Administrador(a) %s cancelou um evento que estava ocorrendo.", sendername);
                SendClientMessageToAll(COLOR_LIGHTBLUE,string);
            }
        }
        return true;
    }
*Edit

Mas nгo deleta o OnPlayerCommandText...

Й pra vocк pode em baixo dele

De pouco em pouco vocк vai Aprendendo.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)