[AJUDA] Public sу funciona com ID 0
#1

pawn Код:
public Derby()
{
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if(IsPlayerConnected(i))
        {
            if(entrouderby[i] == 1)
            {
                TogglePlayerControllable(i, 1);
                SendClientMessage(i, COLOR_LIGHTBLUE,"Sinal verde, GO, GO, GO!");
                format(gstring, sizeof(gstring), "~g~GO, GO, GO!");
                GameTextForPlayer(i, gstring, 15000, 6);
                derbyiniciado[i] = 1;                                                                               f
                derbyevento = 0;
            }
        }
    }
    return 1;
}
Essa pъblic sу funciona se estiver com o ID 0 no evento.
Reply
#2

impossнvel!

sу se derbyiniciado
nгo for uma array.
Reply
#3

pawn Код:
new derbyiniciado[MAX_PLAYERS];
derbyiniciado[playerid] = 0;
Algum prуblema?
Reply
#4

talvez funcione:
pawn Код:
public Derby()
{
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if(IsPlayerConnected(i))
        {
            if(derbyevento == true)
            {
                if(entrouderby[i] == true)
                {
                    TogglePlayerControllable(i, true);
                    SendClienteMessage(i, -1,"Sinal verde, GO, GO, GO!");
                    format(gstring, sizeof(gstring), "~g~GO, GO, GO!");
                    GameTextForPlayer(i, gstring, 15000, 6);
                    derbyiniciado[i]    = false;                                                                               f
                    derbyevento         = false;
                }
            }
        }
    }
}
Reply
#5

Ainda continua na mesma, o comando sу funciona se tiver o ID 0 no meio e quando o ID 0 entra nгo aparece a mensagem pra ele somente para os outros IDs.
Reply
#6

Quote:
Originally Posted by diretor7
Посмотреть сообщение
Ainda continua na mesma, o comando sу funciona se tiver o ID 0 no meio e quando o ID 0 entra nгo aparece a mensagem pra ele somente para os outros IDs.
Veja se: entrouderby[i] == 1 estб correto.
Pode ser que seja algo errado nisso.
Reply
#7

PHP код:
public Derby()
{
    for(new 
0GetMaxPlayers(); != j; ++i)
    {
        if(
IsPlayerConnected(i) && (derbyevento == true) && (entrouderby[i] == true))
        {
            
TogglePlayerControllable(itrue);
            
SendClienteMessage(i, -1,"Sinal verde, GO, GO, GO!");
            
format(gstringsizeof(gstring), "~g~GO, GO, GO!");
            
GameTextForPlayer(igstring150006);
            
derbyiniciado[i] = false;
            
derbyevento false;
        }
    }

Reply
#8

esta public estб correta, algo estб errado em seu sistema em sн.
Reply
#9

Creio que nгo olha sу o CMD de iniciar o evento.
pawn Код:
//Topo
new derbyevento;
new derbyiniciado[MAX_PLAYERS];
new entrouderby[MAX_PLAYERS];  
//Iniciar Derby
if(strcmp(cmd, "/iniciarderby", true) == 0)
    {
            if (PlayerInfo[playerid][pAdmin] < 4)
            {
                SendClientMessage(playerid, COLOR_GRAD1, "   Vocк nгo tem permiзгo para ultilizar este comando!");
                return 1;
                }
                for(new i=0; i<MAX_PLAYERS; i++)
                {
                if(IsPlayerConnected(i))
                {
                if(carroderby[i] == 0)
                {
                SendClientMessage(playerid, COLOR_GREY,"Nгo hб carros criados, crie os veнculos para poder iniciar o evento!");
                return 1;
                }
                if(derbyiniciado[i] == 0)
                {
                SendClientMessage(playerid, COLOR_GREY,"O evento de Derby nгo estб aberto.");
                return 1;
                }
                if(entrouderby[i] == 1)
                {
                Derby();
                GetPlayerName(playerid, sendername, sizeof(sendername));
                format(string, sizeof(string), "Notнcias do Evento: O Admin %s iniciou o evento de Derby e o evento foi trancado!",sendername);
                SendClientMessageToAll(TEAM_CYAN_COLOR, string);
                return 1;
                }
            return 1;
            }
        return 1;
        }
    return 1;
    }
//Entrar Derby
    if(strcmp(cmd, "/entrarderby", true) == 0)
    {
        for(new i = 0; i < MAX_PLAYERS; i++)
        {
        if(IsPlayerConnected(i))
        {
            if(!PlayerToPoint(2,playerid,1412.078979,-1700.173583,13.539500))
            {
            SendClientMessage(playerid, COLOR_GREY,"Vocк nгo estб na empresa de eventos!");
            return 1;
            }
                if(derbyiniciado[i] == 0)
                {
                SendClientMessage(playerid, COLOR_GREY,"Nenhum Administrador criou um evento de Derby!");
                return 1;
                }
                derbyevento++;
                GetPlayerName(playerid, sendername, sizeof(sendername));
                format(string, sizeof(string), "Notнcias do Evento: %s entrou no evento de Derby, e hб poucas vagas, corra jб para a empresa! ",sendername);
                SendClientMessageToAll(TEAM_CYAN_COLOR, string);
                if(derbyevento == 48) PutPlayerInVehicle(playerid, derby1, 0);
                if(derbyevento == 47) PutPlayerInVehicle(playerid, derby2, 0);
                TogglePlayerControllable(playerid, 0);
                entrouderby[playerid] = 1;
                return 1;
                }
                return 1;
                }
                return 1;
                }
Reply
#10

PHP код:
#include <a_samp>
new derbyeventobool:derbyiniciadoMAX_PLAYERS ],bool:entrouderbyMAX_PLAYERS ];   
public 
OnPlayerCommandText(playerid,cmdtext[]) 
{
    if( !
strcmp(cmdtext"/iniciarderby"true ) ) 
    {
        if (
PlayerInfo[playerid][pAdmin] < 4) return SendClientMessage(playeridCOLOR_GRAD1"   Vocк nгo tem permiзгo para ultilizar este comando!");
        for(new 
0GetMaxPlayers(); != j; ++i)
        {
            if( 
carroderby] == ) return SendClientMessage(playeridCOLOR_GREY,"Nгo hб carros criados, crie os veнculos para poder iniciar o evento!");
            if( 
derbyiniciado] == ) return SendClientMessage(playeridCOLOR_GREY,"O evento de Derby nгo estб aberto.");
            if( 
entrouderby] == true )
            {
                if(
derbyevento 0)
                {
                    
TogglePlayerControllable(i,true);
                    
SendClienteMessage(i, -1,"Sinal verde, GO, GO, GO!");
                    
GameTextForPlayer(i"~g~GO, GO, GO!"150006);
                    
derbyiniciado[i] = false;
                    
derbyevento 0;
                }
                new 
_str[24],str_[128];
                
GetPlayerName(playerid,_strsizeof(_str));
                
format(str_sizeof(str_), "Notнcias do Evento: O Admin %s iniciou o evento de Derby e o evento foi trancado!",_str);
                
SendClientMessageToAll(TEAM_CYAN_COLORstr_);
                return 
true;
            }
        }
        return 
true;
    }
    if( !
strcmp(cmdtext"/entrarderby"true) )
    {
        if(!
IsPlayerInRangeOfPoint(playerid,20.0,1412.078979,-1700.173583,13.539500)) return SendClientMessage(playeridCOLOR_GREY,"Vocк nгo estб na empresa de eventos!");
        for(new 
0GetMaxPlayers(); != j; ++i) if(derbyiniciado[i] == false) return SendClientMessage(playeridCOLOR_GREY,"Nenhum Administrador criou um evento de Derby!");
        new 
_str[24],str_[128];
        
GetPlayerName(playerid,_strsizeof(_str));
        
format(str_sizeof(str_), "Notнcias do Evento: %s entrou no evento de Derby, e hб poucas vagas, corra jб para a empresa! ",_str);
        
SendClientMessageToAll(TEAM_CYAN_COLORstr_);
        if(
derbyevento == 48PutPlayerInVehicle(playeridderby10);
        if(
derbyevento == 47PutPlayerInVehicle(playeridderby20);
        
TogglePlayerControllable(playeridfalse);
        
entrouderby[playerid] = true;
        
derbyevento++;
        return 
true;
    }
    return 
false;

Testa ae ...
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)