vendredi 15 juillet 2016

[Ajuda] Chat local

This entry passed through the Full-Text RSS service - if this is your content and you're reading it on someone else's site, please read the FAQ at http://ift.tt/jcXqJW.
Recommended article from FiveFilters.org: Most Labour MPs in the UK Are Revolting.



[Ajuda] Chat local

Little Clucker

 

Join Date: Apr 2013

Location: Iporã do Oeste - SC

Posts: 42

Reputation: 0

DefaultRespuesta: Re: Chat local

Quote:

Originally Posted by moura98 View Post
Esse codigo vai funcionar? é pra ser um chat local, so quem esta a 20.0 m do player pode ler.
Ps: totalmente criado por mim.
Ps²: Vagas Para Beta tester em um projeto mais info chamar skype.

PHP Code:

public OnPlayerText(playeridtext[])
{
    new 
nome[23], str[128];
    new 
Floatpos[3];
    
GetPlayerName(playeridnomesizeof(nome));
    
format(str128"%s: %s"nometext);
    
GetPlayerPos(playeridpos[0], pos[1], pos[2]);
    for( new 
i=0i<MAX_PLAYERSi++ )
    {
        if(
IsPlayerConnected(i))
        {
            if(
IsPlayerInRangeOfPoint(i20.0pos[0], pos[1], pos[2]))
            {
                
SendClientMessage(iCOR_CINZAstr);
            }
        }
    }
    return 
0;

Sim vai, uso da mesma forma só que por comando não na public OnPlayerText

Quote:

Originally Posted by LockedLucas View Post
Use esse aqui, mais fácil.

PHP Code:

forward ProxDetector(Float:radiplayeridstring[], col1col2col3col4col5);
public 
ProxDetector(Float:radiplayeridstring[], col1col2col3col4col5)
{
    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);
                }
            }
        }
    }
    return 
1;

Pra que tudo isso? Código do moura funcional...

Aucun commentaire:

Enregistrer un commentaire