[Include] GetGangZoneColor
#1

GetGangZoneColor / SetGangZoneColor
Pegar e colocar cor de gang zones facilmente





Uso do cуdigo:
Quote:

GetGangZoneColor(gangzoneid);

Quote:

IsValidGangZone(gangzoneid);

Quote:

SetGangZoneColorForPlayer(gangzoneid, playerid, color);

Quote:

SetGangZoneColorForAll(gangzoneid, color);









Cуdigo:
pawn Код:
/*
 *
 * GetGangZoneColor / SetGangZoneColor
 * Por Bruno da Silva @ ipsbr.net
 *
*/



#if defined GGZC_included
    #endinput
#else
    #define GGZC_included
#endif


#define MAX_GZS 1024 // declarar o mбximo de gangzones criadas


stock
    GZCOLOR[MAX_GZS]
;


/*
 *
 * Coloca cor em uma GangZone para um jogador
 * Й uma redefiniзгo da funзгo  GangZoneShowForPlayer
 *
*/


stock GZSFP(playerid, zone, color) {
    GZCOLOR[zone] = color;
   
    return GangZoneShowForPlayer(playerid, zone, color);
   
}




/*
 *
 * Coloca cor em uma GangZone para todos jogadores
 * Й uma redefiniзгo da funзгo  GangZoneShowForAll
 *
*/



stock GZSFA(zone, color) {

    GZCOLOR[zone] = color;
    return GangZoneShowForAll(zone, color);
}





/*
 *
 * Retorna e coloca uma cor na gangzone especificada
 *
*/


stock SetGangZoneColor(zone, cor, playerid = -1) {

    if(~playerid) {
        GangZoneHideForAll(zone);

        GangZoneShowForAll(zone, cor);
    }
    else {
        GangZoneHideForPlayer(playerid, zone);

        GangZoneShowForPlayer(playerid, zone, cor);
    }

    return GZCOLOR[zone] = cor;

}

stock GetGangZoneColor(zone) {

    return GZCOLOR[zone];

}

#define SetGangZoneColorForAll  SetGangZoneColor
#define SetGangZoneColorForPlayer(%0,%1,%2) SetGangZoneColor(%0,%2,%1)

#define IsValidGangZone(%0)        bool: GetGangZoneColor(%0)

#define GangZoneShowForPlayer GZSFP
#define GangZoneShowForPlayer GZSFA
http://pastebin.com/3pHstkby





Vai ter gente dizendo que й cуdigo ъtil, mas vamos encarar os fatos, se eu tivesse postado isto em cуdigos ъteis 1 mкs atrбs, ninguйm teria visto ou feito uso.

Por isto apoio a ideia de criar uma бrea apenas para cуdigos ъteis, assim cada um tem um tуpico, dessa maneira, dando maior visibilidade а eles.


Tб aн, pra ajudar o Russo66



Fui
Reply


Messages In This Thread
GetGangZoneColor / SetGangZoneColor / IsValidGangZone - by ipsBruno - 25.10.2013, 02:23
Re: GetGangZoneColor - by zSuYaNw - 25.10.2013, 02:28
Re: GetGangZoneColor - by zPain - 25.10.2013, 02:33
Re: GetGangZoneColor - by ipsBruno - 25.10.2013, 02:34
Re : GetGangZoneColor - by Matnix - 25.10.2013, 02:36
Re: GetGangZoneColor - by Russo66 - 25.10.2013, 02:50
Re: GetGangZoneColor - by ipsBruno - 25.10.2013, 04:13
Re: GetGangZoneColor - by smiiir - 25.10.2013, 08:32
Re: GetGangZoneColor - by WLSF - 25.10.2013, 11:28
Re: GetGangZoneColor - by Jhonni - 25.10.2013, 11:32

Forum Jump:


Users browsing this thread: 5 Guest(s)