[Ajuda] digitar apafecer sу em um virtualword
#1

Eae galera ando muito triste motivo: to tentando faz tempo mas nao consigo ex: player esta no mesmo interior ate ai blz eles nao se veem por causa do virtual word mas ae vem o problema o player digita o outro do outro virtual word ve oque ele escreveu e nao era pra isso acontecer como faco para so ve oq o outro digita no mesmo virtualword ?? Bom creio que nao preciso mandar nenhum code nй mais se precisar eu mando!! Pf me ajudem
Reply
#2

A funзгo ProxDetector de seu GF, sу verifica a posiзгo, e nгo virtual world
Reply
#3

Ta e como eu faзo?
Reply
#4

Adiciona uma condiзгo verificando o virtual world nela.
Reply
#5

Nossa cara ajuda ae se nao souber pesso up mas se saber me ajuda ae.
Reply
#6

Aconselho a fazer o seu prуprio mas pela sua angustia resolvi passar
PHP код:
forward ProxDetector(Float:radiplayeridstring[],col1,col2,col3,col4,col5); //Inicio do GM
public OnPlayerText(playeridtext[])
{
new 
nome[MAX_PLAYER_NAME];
new 
str[128];
GetPlayerName(playeridnomesizeof(nome));
format(strsizeof(str),"%s diz: %s"nometext);
ProxDetector(20.0playeridstr,0xFFFFFFAA,0xFFFFFFAA,0xFFFFFFAA,0xFFFFFFAA,0xFFFFFFAA);
return 
1;
}
//---------------------------------PUBLIC----------------------------------------
public ProxDetector(Float:radiplayeridstring[],col1,col2,col3,col4,col5)
{
    if(
IsPlayerConnected(playerid))
    {
        new 
Float:posxFloat:posyFloat:posz;
        new 
Float:oldposxFloat:oldposyFloat:oldposz;
        new 
Float:tempposxFloat:tempposyFloat:tempposz;
        
GetPlayerPos(playeridoldposxoldposyoldposz);
        for(new 
0MAX_PLAYERSi++)
        {
            if(
IsPlayerConnected(i))
            {
                
GetPlayerPos(iposxposyposz);
                
tempposx = (oldposx -posx);
                
tempposy = (oldposy -posy);
                
tempposz = (oldposz -posz);
                if (((
tempposx radi/16) && (tempposx > -radi/16)) && ((tempposy radi/16) && (tempposy > -radi/16)) && ((tempposz radi/16) && (tempposz > -radi/16)))
                {
                    
SendClientMessage(icol1string);
                }
                else if (((
tempposx radi/8) && (tempposx > -radi/8)) && ((tempposy radi/8) && (tempposy > -radi/8)) && ((tempposz radi/8) && (tempposz > -radi/8)))
                {
                    
SendClientMessage(icol2string);
                }
                else if (((
tempposx radi/4) && (tempposx > -radi/4)) && ((tempposy radi/4) && (tempposy > -radi/4)) && ((tempposz radi/4) && (tempposz > -radi/4)))
                {
                    
SendClientMessage(icol3string);
                }
                else if (((
tempposx radi/2) && (tempposx > -radi/2)) && ((tempposy radi/2) && (tempposy > -radi/2)) && ((tempposz radi/2) && (tempposz > -radi/2)))
                {
                    
SendClientMessage(icol4string);
                }
                else if (((
tempposx radi) && (tempposx > -radi)) && ((tempposy radi) && (tempposy > -radi)) && ((tempposz radi) && (tempposz > -radi)))
                {
                    
SendClientMessage(icol5string);
                }
            }
            else
            {
                
SendClientMessage(icol1string);
            }
        }
    }
    return 
1;

Reply
#7

Podia explicar mais a funзao de cada um e isso so players do mesmo interior ve?
Reply
#8

vitorluiz se a sua funзгo for igual a do viniciuship

faz assim

PHP код:
forward ProxDetector(Float:radiplayeridstring[],col1,col2,col3,col4,col5); //Inicio do GM
public OnPlayerText(playeridtext[])
{
new 
nome[MAX_PLAYER_NAME];
new 
str[128];
GetPlayerName(playeridnomesizeof(nome));
format(strsizeof(str),"%s diz: %s"nometext);
ProxDetector(20.0playeridstr,0xFFFFFFAA,0xFFFFFFAA,0xFFFFFFAA,0xFFFFFFAA,0xFFFFFFAA);
return 
1;
}
//---------------------------------PUBLIC----------------------------------------
public ProxDetector(Float:radiplayeridstring[],col1,col2,col3,col4,col5)
{
    if(
IsPlayerConnected(playerid))
    {
        new 
Float:posxFloat:posyFloat:posz;
        new 
Float:oldposxFloat:oldposyFloat:oldposz;
        new 
Float:tempposxFloat:tempposyFloat:tempposz;
        
GetPlayerPos(playeridoldposxoldposyoldposz);
        for(new 
0MAX_PLAYERS; ++i)
        {                                   
// verificaзгo se o ID i esta no mesmo virtual que playerid
            
if(IsPlayerConnected(i) && GetPlayerVirtualWorld(i) == GetPlayerVirtualWorld(playerid)) 
            {
                
GetPlayerPos(iposxposyposz);
                
tempposx = (oldposx -posx);
                
tempposy = (oldposy -posy);
                
tempposz = (oldposz -posz);
                if (((
tempposx radi/16) && (tempposx > -radi/16)) && ((tempposy radi/16) && (tempposy > -radi/16)) && ((tempposz radi/16) && (tempposz > -radi/16)))
                {
                    
SendClientMessage(icol1string);
                }
                else if (((
tempposx radi/8) && (tempposx > -radi/8)) && ((tempposy radi/8) && (tempposy > -radi/8)) && ((tempposz radi/8) && (tempposz > -radi/8)))
                {
                    
SendClientMessage(icol2string);
                }
                else if (((
tempposx radi/4) && (tempposx > -radi/4)) && ((tempposy radi/4) && (tempposy > -radi/4)) && ((tempposz radi/4) && (tempposz > -radi/4)))
                {
                    
SendClientMessage(icol3string);
                }
                else if (((
tempposx radi/2) && (tempposx > -radi/2)) && ((tempposy radi/2) && (tempposy > -radi/2)) && ((tempposz radi/2) && (tempposz > -radi/2)))
                {
                    
SendClientMessage(icol4string);
                }
                else if (((
tempposx radi) && (tempposx > -radi)) && ((tempposy radi) && (tempposy > -radi)) && ((tempposz radi) && (tempposz > -radi)))
                {
                    
SendClientMessage(icol5string);
                }
            }
            else
            {
                
SendClientMessage(icol1string);
            }
        }
    }
    return 
1;

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)