Page 1 of 2 12 LastLast
Results 1 to 10 of 12

Thread: Headicon

  1. #1
    Private First Class
    Join Date
    Jul 2013
    Posts
    170
    Thanks
    44
    Thanked 16 Times in 11 Posts

    Headicon

    How i can change headicons?
    Bigger rank=other icon and when you press tab there show icons.
    Regards.

  2. #2
    Private
    Join Date
    Jul 2012
    Posts
    76
    Thanks
    9
    Thanked 56 Times in 38 Posts
    Making it short.

    player.statusicon = rankicon; //this makes the rankicon show up in the scoreboard
    player.headicon = rankicon; //changes the headicon

    That's how you do it.

  3. The Following 2 Users Say Thank You to Peterlankton For This Useful Post:

    kung foo man (17th November 2013),Rocky (17th November 2013)

  4. #3
    Private First Class
    Join Date
    Jul 2013
    Posts
    170
    Thanks
    44
    Thanked 16 Times in 11 Posts
    Thanks for this...Where to put it?

  5. #4
    Private First Class
    Join Date
    Feb 2013
    Posts
    201
    Thanks
    4
    Thanked 10 Times in 7 Posts
    on spawnplayer

  6. #5
    Private First Class
    Join Date
    Jul 2013
    Posts
    170
    Thanks
    44
    Thanked 16 Times in 11 Posts
    unitititalied variable 'rankicon' script error.

  7. #6
    Brigadier General
    Join Date
    Dec 2012
    Posts
    1,012
    Thanks
    440
    Thanked 171 Times in 132 Posts
    omg stop scripting... u need to precache ur headicon rankicon and they need to be real material files

  8. The Following User Says Thank You to Ni3ls For This Useful Post:

    thOuMta (18th November 2013)

  9. #7
    Assadministrator IzNoGoD's Avatar
    Join Date
    Aug 2012
    Posts
    1,718
    Thanks
    17
    Thanked 1,068 Times in 674 Posts
    Quote Originally Posted by Rocky View Post
    unitititalied variable 'rankicon' script error.
    Thread closed.

  10. The Following User Says Thank You to IzNoGoD For This Useful Post:

    RobsoN (18th November 2013)

  11. #8
    Assadministrator kung foo man's Avatar
    Join Date
    Jun 2012
    Location
    trailerpark
    Posts
    2,011
    Thanks
    2,102
    Thanked 1,084 Times in 753 Posts
    In maps/mp/gametypes/sd.gsc you can find an example:

    PHP Code:

    Callback_StartGameType
    ()
    {
        
    level.splitscreen isSplitScreen();

        
    // if this is a fresh map start, set nationalities based on cvars, otherwise leave game variable nationalities as set in the level script
        
    if(!isdefined(game["gamestarted"]))
        {
            
    // defaults if not defined in level script
            
    if(!isdefined(game["allies"]))
                
    game["allies"] = "american";
            if(!
    isdefined(game["axis"]))
                
    game["axis"] = "german";
            if(!
    isdefined(game["attackers"]))
                
    game["attackers"] = "allies";
            if(!
    isdefined(game["defenders"]))
                
    game["defenders"] = "axis";

            
    // server cvar overrides
            
    if(getCvar("scr_allies") != "")
                
    game["allies"] = getCvar("scr_allies");
            if(
    getCvar("scr_axis") != "")
                
    game["axis"] = getCvar("scr_axis");

            
    precacheStatusIcon("hud_status_dead");
            
    precacheStatusIcon("hud_status_connecting"); 

    Setting an icon is:

    PHP Code:
    Callback_PlayerKilled(eInflictorattackeriDamagesMeansOfDeathsWeaponvDirsHitLocpsOffsetTimedeathAnimDuration)
    {
        
    self endon("spawned");
        
    self notify("killed_player");

        if(
    self.sessionteam == "spectator")
            return;

        
    // If the player was killed by a head shot, let players know it was a head shot kill
        
    if(sHitLoc == "head" && sMeansOfDeath != "MOD_MELEE")
            
    sMeansOfDeath "MOD_HEAD_SHOT";

        
    // send out an obituary message to all clients about the kill
        
    obituary(selfattackersWeaponsMeansOfDeath);

        
    self maps\mp\gametypes\_weapons::dropWeapon();
        
    self maps\mp\gametypes\_weapons::dropOffhand();

        
    self.sessionstate "dead";
        
    self.statusicon "hud_status_dead"
    Headicons, example in maps\mp\gametypes\_friendicons.gsc:

    PHP Code:
    init()
    {
        
    // Draws a team icon over teammates
        
    if(getCvar("scr_drawfriend") == "")
            
    setCvar("scr_drawfriend""1");
        
    level.drawfriend getCvarInt("scr_drawfriend");

        switch(
    game["allies"])
        {
        case 
    "american":
            
    game["headicon_allies"] = "headicon_american";
            
    precacheHeadIcon(game["headicon_allies"]); 
    PHP Code:
    showFriendIcon()
    {
        if(
    level.drawfriend)
        {
            if(
    self.pers["team"] == "allies")
            {
                
    self.headicon game["headicon_allies"];
                
    self.headiconteam "allies";
            }
            else
            {
                
    self.headicon game["headicon_axis"];
                
    self.headiconteam "axis";
            }
        }


    So, in short:

    PHP Code:
    precacheStatusIcon("hud_status_dead");
    self.statusicon "hud_status_dead"
    PHP Code:
    precacheHeadIcon("headicon_american");
    self.headicon "headicon_american"
    I don't know whats to hard on answering a straight question, no need for rage and closing.
    timescale 0.01

  12. The Following User Says Thank You to kung foo man For This Useful Post:

    Rocky (19th November 2013)

  13. #9
    Private First Class thOuMta's Avatar
    Join Date
    Oct 2012
    Location
    France
    Posts
    191
    Thanks
    139
    Thanked 35 Times in 28 Posts
    Just put this:

    On connect
    PHP Code:
    precacheHeadIcon("something");
    precacheStatusIcon("something"); 
    On spawn
    PHP Code:
    self.headicon "something";
    self.statusicon "something"
    Its very easy !

  14. #10
    Assadministrator IzNoGoD's Avatar
    Join Date
    Aug 2012
    Posts
    1,718
    Thanks
    17
    Thanked 1,068 Times in 674 Posts
    Quote Originally Posted by thOuMta View Post
    Just put this:

    On connect
    PHP Code:
    precacheHeadIcon("something");
    precacheStatusIcon("something"); 
    Its very easy !

    Do not put your precaches on connect, put them on gamestart.

  15. The Following User Says Thank You to IzNoGoD For This Useful Post:

    thOuMta (19th November 2013)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •