Jump to content
  • 0

Question

Posted

Salut cum pot pune si eu clori facarei factiuni cand dai /id Ex: Daca Gigel este in LSPD cand dai id pe el sa apara numele factiunii cu o culoare anume.

Gamemode BURNED.

Mersi

2 answers to this question

Recommended Posts

  • 0
Posted

Ok, treaba e simpla!

sa zicem ca la /id ai asa SendClientMessage(playerid, COLOR_NONE, "ID: %d | Name | Faction: %d etc...", playerid, pName, pFaction .. );

si ca mearga cum vrei tu facem asa.

new ss[128];
switch(PlayerInfo[playerid][pFaction]) {

case 1:  ss = "{CULOARE} Numele factiuni cu id 1.

case ... etc cred ca ai prins ideea!

acum trebe sa ai

SendClientMessage(playerid, COLOR_NONE, "ID: %d | Name | Faction: %s etc...", playerid, pName, ss.. );

Cred ca am explicat destul de ok, sper ca ai inteles. 

 

Cheers !

  • Like 1
  • 0
Posted
YCMD:id(playerid, params[], help) {
    new names[64], giveplayer[25], x, sstring[180];
    if(sscanf(params, "s[64]", names)) return SCM(playerid, COLOR_GREY, "USAGE: {FFFFFF}/id <playerid/name>");
    if(strlen(names) > 24) return SCM(playerid, COLOR_GREY, "Player not connected.");
    if(IsNumeric(names)) {
        if(strval(names) >= 1000) return SCM(playerid, COLOR_GREY, "Player not connected.");
    }
    if(IsNumeric(names)) {
        if(x < 10) {
            if(strval(names) < 0 || strval(names) > 999) return SCM(playerid, COLOR_GREY, "Player not connected.");
            new i = strval(names);
            if(IsPlayerLogged[i] == 0) return SCM(playerid, COLOR_GREY, "Player not connected.");
            GetPlayerName(i, giveplayer, sizeof(giveplayer));
            new szRankk[180];
            if(PlayerInfo[i][pMember] != 0) format(szRankk, sizeof(szRankk), " (rank %d)", PlayerInfo[i][pRank]);
            new factioncolor[128];
            switch(PlayerInfo[i][pMember])
            {
                case 0: factioncolor = {FFFFFF};
                case 1: factioncolor = {00FF00};
            }
            if(GetPVarInt(i, "Cover") == 1) {
                format(sstring, sizeof(sstring), "(ID %d) Nume: %s | Level: %d | Factiune: Civil | FPS: %d",i,giveplayer,GetPlayerScore(i), FPS2[i]);
                SCM(playerid, COLOR_WHITE, sstring);
                return 1;
            }
            new name[180];
            format(name, sizeof(name), "%s", GetName(i));
            new clan = PlayerInfo[i][pClan];                    
            if(PlayerInfo[i][pSleeping] == 1 || AFKSeconds[i] >= 5) {
                if(clan != 0 && PlayerInfo[i][pTag] == 0) format(name, sizeof(name), "{%s}%s{AFAFAF}%s", ClanInfo[clan][clColor], ClanInfo[clan][clTag], GetName(i));
                else if(clan != 0 && PlayerInfo[i][pTag] == 1) format(name, sizeof(name), "%s{%s}%s{AFAFAF}", GetName(i), ClanInfo[clan][clColor], ClanInfo[clan][clTag]);                                
            }
            else {
                if(clan != 0 && PlayerInfo[i][pTag] == 0) format(name, sizeof(name), "{%s}%s{FFFFFF}%s", ClanInfo[clan][clColor], ClanInfo[clan][clTag], GetName(i));
                else if(clan != 0 && PlayerInfo[i][pTag] == 1) format(name, sizeof(name), "%s{%s}%s{FFFFFF}", GetName(i), ClanInfo[clan][clColor], ClanInfo[clan][clTag]);                                    
            }
            format(sstring, sizeof(sstring), "(ID %d) %s | Level: %d | Factiune: %s%s | FPS: %d",i,name,PlayerInfo[i][pLevel],FactionName(PlayerInfo[i][pMember]),szRankk, FPS2[i]);
            SCM(playerid, COLOR_WHITE, sstring);
                
            x++;
            return 1;
        }
    }    
    foreach(Player, i) {
        if(IsPlayerConnected(i) && IsPlayerLogged[i] == 1) {                    
            if(strfind(GetNameEx(i), names, true) != -1) {
                if(x < 10) {
                    if(i == INVALID_PLAYER_ID) return SCM(playerid, COLOR_GREY, "Player not connected.");
                    GetPlayerName(i, giveplayer, sizeof(giveplayer));
                    new szRankk[180];
                    if(PlayerInfo[i][pMember] != 0) format(szRankk, sizeof(szRankk), " (Rank %d)", PlayerInfo[i][pRank]);
                    new factioncolor[128];
                    switch(PlayerInfo[i][pMember])
                    {
                        case 0: factioncolor = {FFFFFF};
                        case 1: factioncolor = {00FF00};
                    }
                    if(GetPVarInt(i, "Cover") == 1) {
                        format(sstring, sizeof(sstring), "(ID %d) Nume: %s | Level: %d | Factiune: Civil | FPS: %d",i,giveplayer,GetPlayerScore(i), FPS2[i]);
                        SCM(playerid, COLOR_WHITE, sstring);
                        return 1;
                    }
                    new name[180];
                    format(name, sizeof(name), "%s", GetName(i));
                    new clan = PlayerInfo[i][pClan];
                    if(PlayerInfo[i][pSleeping] == 1 || AFKSeconds[i] >= 5) {
                        if(clan != 0 && PlayerInfo[i][pTag] == 0) format(name, sizeof(name), "{%s}%s{AFAFAF}%s", ClanInfo[clan][clColor], ClanInfo[clan][clTag], GetName(i));
                        else if(clan != 0 && PlayerInfo[i][pTag] == 1) format(name, sizeof(name), "%s{%s}%s{AFAFAF}", GetName(i), ClanInfo[clan][clColor], ClanInfo[clan][clTag]);                                
                    }
                    else {
                        if(clan != 0 && PlayerInfo[i][pTag] == 0) format(name, sizeof(name), "{%s}%s{FFFFFF}%s", ClanInfo[clan][clColor], ClanInfo[clan][clTag], GetName(i));
                        else if(clan != 0 && PlayerInfo[i][pTag] == 1) format(name, sizeof(name), "%s{%s}%s{FFFFFF}", GetName(i), ClanInfo[clan][clColor], ClanInfo[clan][clTag]);                                    
                    }
                    format(sstring, sizeof(sstring), "(ID %d) %s | Level: %d | Factiune: %s %s | FPS: %d",i,name,PlayerInfo[i][pLevel],FactionName(PlayerInfo[i][pMember]),szRankk, FPS2[i]);
                    SCM(playerid, COLOR_WHITE, sstring);
        
                    x++;
                }    
            }                                            
        }
    }
    if(x == 0) return SCM(playerid, COLOR_GREY, "Player not connected.");
    if(x == 10) SCM(playerid, COLOR_WHITE, "Au fost afisate doar primele 10 rezultate.");
    return 1;
}


Poti folosi sfatul lui El.Capo, aici ai comanda si un exemplu teoretic.

  • Like 1

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • 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.