Mensagem para players prуximos
#2

PHP код:
forward ProxDetector(Float:radiplayeridstring[],col1,col2,col3,col4,col5);
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(
GetPlayerVirtualWorld(playerid) == GetPlayerVirtualWorld(i))
                {
                    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);
                    }
                }
            }
        }
    }
    return 
1;

Uso:
PHP код:
ProxDetector(10.0playerid"Mensagem"COR1COR2COR3COR4COR5); 
Reply


Messages In This Thread
Mensagem para players prуximos - by BrunoSayden177 - 10.10.2018, 14:55
Re: Mensagem para players prуximos - by ipsLuan - 10.10.2018, 15:04
Re: Mensagem para players prуximos - by Locky_ - 10.10.2018, 15:13
Re: Mensagem para players prуximos - by BrunoSayden177 - 10.10.2018, 15:29
Re: Mensagem para players prуximos - by GSantana - 10.10.2018, 15:32

Forum Jump:


Users browsing this thread: 1 Guest(s)