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(eInflictor, attacker, iDamage, sMeansOfDeath, sWeapon, vDir, sHitLoc, psOffsetTime, deathAnimDuration)
{
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(self, attacker, sWeapon, sMeansOfDeath);
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.