Jump to content
  • 0

Cum fac chatul din samp sa nu mai fie global?


Question

Posted

Daca incep un gamemode de la zero, chatul automat va fi global nu?

Adica daca eu scriu ceva in cealanta parte a mapei si un player este in cea lanta parte ii va arata.

Cum pot pune un range in care daca cineva scrie intr-un loc sa aprare doar intr-o raza?

(sunt la inceput)

1 answer to this question

Recommended Posts

  • 1
Posted

Foloseste functia ProxDetector. La OnPlayerText unde trimite mesajul sterge SendClientMessageToAll sau foreach sau ce folosesti si pune ProxDetector.

function ProxDetector(Float:radi, playerid, string[],col1,col2,col3,col4,col5) {
    new Float:posx, Float:posy, Float:posz;
    new Float:oldposx, Float:oldposy, Float:oldposz;
    new Float:tempposx, Float:tempposy, Float:tempposz;
    GetPlayerPos(playerid, oldposx, oldposy, oldposz);
    foreach(new i: Player) {
        if(GetPlayerInterior(playerid) == GetPlayerInterior(i) && GetPlayerVirtualWorld(playerid) == GetPlayerVirtualWorld(i)) {
                GetPlayerPos(i, posx, posy, posz);
                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)))
                    SCM(i, col1, string);
                else if(((tempposx < radi/8) && (tempposx > -radi/8)) && ((tempposy < radi/8) && (tempposy > -radi/8)) && ((tempposz < radi/8) && (tempposz > -radi/8)))
                    SCM(i, col2, string);
                else if(((tempposx < radi/4) && (tempposx > -radi/4)) && ((tempposy < radi/4) && (tempposy > -radi/4)) && ((tempposz < radi/4) && (tempposz > -radi/4)))
                    SCM(i, col3, string);
                else if(((tempposx < radi/2) && (tempposx > -radi/2)) && ((tempposy < radi/2) && (tempposy > -radi/2)) && ((tempposz < radi/2) && (tempposz > -radi/2)))
                    SCM(i, col4, string);
                else if(((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
                    SCM(i, col5, string);

        }
    }
    return true;
}

 

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.