/* ======================== idMenuScreen_PDA_Inventory::EquipWeapon ======================== */ void idMenuScreen_PDA_Inventory::EquipWeapon() { if ( itemList.GetViewIndex() != itemList.GetMoveToIndex() ) { return; } idPlayer * player = gameLocal.GetLocalPlayer(); if ( player == NULL ) { return; } int validIndex = 0; for ( int j = 0; j < MAX_WEAPONS; j++ ) { const char * weap = GetWeaponName( j ); if ( weap == NULL || *weap == NULL ){ continue; } if ( !IsVisibleWeapon( j ) ) { continue; } if ( validIndex == itemList.GetMoveToIndex() ) { int slot = player->SlotForWeapon( weap ); player->SetPreviousWeapon( slot ); break; } validIndex++; } player->TogglePDA(); }
void VX_TrackerOddTeamkilled(int player, int weapon) { char outstring[MAX_TRACKER_MSG_LEN]=""; if (amf_tracker_frags.value == 2) snprintf(outstring, sizeof(outstring), "&rteammate &c%s%s&r %s", TKColor(player), GetWeaponName(weapon), cl.players[player].name); else if (cl.playernum == player || (player == Cam_TrackNum() && cl.spectator)) snprintf(outstring, sizeof(outstring), "&c380Teammate &c900killed you&r"); VX_TrackerAddText(outstring, tt_death); }
void VX_TrackerOddFrag(int player, int weapon, int wcount) { char outstring[MAX_TRACKER_MSG_LEN]=""; if (amf_tracker_frags.value == 2) snprintf(outstring, sizeof(outstring), "&r%s &c%s%s&r enemy", cl.players[player].name, OddFragColor(player), GetWeaponName(weapon)); else if (cl.playernum == player || (player == Cam_TrackNum() && cl.spectator)) snprintf(outstring, sizeof(outstring), "&c900You killed&r an enemy\n%s kills: %i", GetWeaponName(weapon), wcount); VX_TrackerAddText(outstring, tt_death); }
void VX_TrackerDeath(int player, int weapon, int count) { char outstring[MAX_TRACKER_MSG_LEN]=""; if (amf_tracker_frags.value == 2) snprintf(outstring, sizeof(outstring), "&r%s &c%s%s&r%s", cl.players[player].name, SuiColor(player), GetWeaponName(weapon), amf_tracker_string_died.string); else if (cl.playernum == player || (player == Cam_TrackNum() && cl.spectator)) snprintf(outstring, sizeof(outstring), "&c960You died&r\n%s deaths: %i", GetWeaponName(weapon), count); VX_TrackerAddText(outstring, tt_death); }
/* ======================== idMenuScreen_PDA_Inventory::ShowScreen ======================== */ void idMenuScreen_PDA_Inventory::ShowScreen( const mainMenuTransition_t transitionType ) { idPlayer * player = gameLocal.GetLocalPlayer(); if ( player != NULL ) { int numItems = player->GetInventory().items.Num(); for ( int j = 0; j < numItems; j++ ) { idDict *item = player->GetInventory().items[j]; if ( !item->GetBool( "inv_pda" ) ) { const char *iname = item->GetString( "inv_name" ); const char *iicon = item->GetString( "inv_icon" ); const char *itext = item->GetString( "inv_text" ); iname = iname; iicon = iicon; itext = itext; const idKeyValue *kv = item->MatchPrefix( "inv_id", NULL ); if ( kv ) { //objectiveSystem->SetStateString( va( "inv_id_%i", j ), kv->GetValue() ); } } } idList<const idMaterial *> weaponIcons; for ( int j = 0; j < MAX_WEAPONS; j++ ) { const char * weap = GetWeaponName( j ); if ( weap == NULL || *weap == NULL ){ continue; } if ( !IsVisibleWeapon( j ) ) { continue; } const idDeclEntityDef * weaponDef = gameLocal.FindEntityDef( weap, false ); if ( weaponDef != NULL ) { weaponIcons.Append( declManager->FindMaterial( weaponDef->dict.GetString( "hudIcon" ), false ) ); } } itemList.SetListImages( weaponIcons ); itemList.SetViewIndex( 0 ); itemList.SetMoveToIndex( 0 ); itemList.SetMoveDiff( 0 ); } idMenuScreen::ShowScreen( transitionType ); }
void VX_TrackerOddFrag(int player, int weapon, int wcount) { char outstring[MAX_TRACKER_MSG_LEN]=""; if (amf_tracker_frags.value == 2) { if (cl_useimagesinfraglog.integer) { snprintf(outstring, sizeof(outstring), "&c%s%s&r %s &c%s%s&r", OddFragColor(player), VX_Name(player), GetWeaponName(weapon), EnemyColor(), amf_tracker_string_enemy.string); Q_normalizetext(outstring); } else { snprintf(outstring, sizeof(outstring), "&r%s &c%s%s&r %s", VX_Name(player), OddFragColor(player), GetWeaponName(weapon), amf_tracker_string_enemy.string); } } else if (cl.playernum == player || (player == Cam_TrackNum() && cl.spectator)) snprintf(outstring, sizeof(outstring), "&c900You killed&r an enemy\n%s kills: %i", GetWeaponName(weapon), wcount); VX_TrackerAddText(outstring, tt_death); }
void VX_TrackerDeath(int player, int weapon, int count) { char outstring[MAX_TRACKER_MSG_LEN]=""; if (amf_tracker_frags.value == 2) { if (cl_useimagesinfraglog.integer) { snprintf(outstring, sizeof(outstring), "&c%s%s&r %s&c%s%s&r", SuiColor(player), VX_Name(player), GetWeaponName(weapon), SuiColor(player), amf_tracker_string_died.string); Q_normalizetext(outstring); } else { snprintf(outstring, sizeof(outstring), "&r%s &c%s%s&r%s", VX_Name(player), SuiColor(player), GetWeaponName(weapon), amf_tracker_string_died.string); } } else if (cl.playernum == player || (player == Cam_TrackNum() && cl.spectator)) { snprintf(outstring, sizeof(outstring), "&c960You died&r\n%s deaths: %i", GetWeaponName(weapon), count); } VX_TrackerAddText(outstring, tt_death); }
void ParseSayText (edict_t * ent, char *text) { static unsigned char buf[10240], infobuf[10240]; char *p, *pbuf; p = text; pbuf = buf; *pbuf = 0; while (*p != 0) { if (((ptrdiff_t) pbuf - (ptrdiff_t) buf) > 225) { break; } if (*p == '%') { switch (*(p + 1)) { case 'H': GetHealth (ent, infobuf); strcpy (pbuf, infobuf); pbuf = SeekBufEnd (pbuf); p += 2; continue; case 'A': GetAmmo (ent, infobuf); strcpy (pbuf, infobuf); pbuf = SeekBufEnd (pbuf); p += 2; continue; case 'W': GetWeaponName (ent, infobuf); strcpy (pbuf, infobuf); pbuf = SeekBufEnd (pbuf); p += 2; continue; case 'I': GetItemName (ent, infobuf); strcpy (pbuf, infobuf); pbuf = SeekBufEnd (pbuf); p += 2; continue; case 'T': GetNearbyTeammates (ent, infobuf); strcpy (pbuf, infobuf); pbuf = SeekBufEnd (pbuf); p += 2; continue; case 'M': GetViewedTeammateName (ent, infobuf); strcpy (pbuf, infobuf); pbuf = SeekBufEnd (pbuf); p += 2; continue; case 'E': GetViewedEnemyName (ent, infobuf); strcpy (pbuf, infobuf); pbuf = SeekBufEnd (pbuf); p += 2; continue; case 'F': GetViewedEnemyWeapon (ent, infobuf); strcpy (pbuf, infobuf); pbuf = SeekBufEnd (pbuf); p += 2; continue; case 'G': GetEnemyPosition (ent, infobuf); strcpy (pbuf, infobuf); pbuf = SeekBufEnd (pbuf); p += 2; continue; case 'K': GetLastKilledTarget (ent, infobuf); strcpy (pbuf, infobuf); pbuf = SeekBufEnd (pbuf); p += 2; continue; //AQ2:TNG Slicer - New Location Code /* case 'L': GetOwnPosition (ent, infobuf); strcpy (pbuf, infobuf); pbuf = SeekBufEnd (pbuf); p += 2; continue; case 'S': GetViewedPosition (ent, infobuf); strcpy (pbuf, infobuf); pbuf = SeekBufEnd (pbuf); p += 2; continue; */ case 'S': GetSightedLocation (ent, infobuf); strcpy (pbuf, infobuf); pbuf = SeekBufEnd (pbuf); p += 2; continue; case 'L': GetPlayerLocation (ent, infobuf); strcpy (pbuf, infobuf); pbuf = SeekBufEnd (pbuf); p += 2; continue; //AQ2:TNG Slicer Last Damage Location case 'D': GetLastDamagedPart (ent, infobuf); strcpy (pbuf, infobuf); pbuf = SeekBufEnd (pbuf); p += 2; continue; //AQ2:TNG END //AQ2:TNG Freud Last Player Damaged case 'P': GetLastDamagedPlayers (ent, infobuf); strcpy (pbuf, infobuf); pbuf = SeekBufEnd (pbuf); p += 2; continue; //AQ2:TNG END } } *pbuf++ = *p++; } *pbuf = 0; strncpy (text, buf, 225); text[225] = 0; // in case it's 225 }
/* ======================== idMenuScreen_PDA_Inventory::Update ======================== */ void idMenuScreen_PDA_Inventory::Update() { idPlayer * player = gameLocal.GetLocalPlayer(); if ( player == NULL ) { idMenuScreen::Update(); return; } int validIndex = 0; for ( int j = 0; j < MAX_WEAPONS; j++ ) { const char * weap = GetWeaponName( j ); if ( weap == NULL || *weap == NULL ){ continue; } if ( !IsVisibleWeapon( j ) ) { return; } const idDeclEntityDef * weaponDef = gameLocal.FindEntityDef( weap, false ); if ( weaponDef == NULL ) { continue; } if ( validIndex == itemList.GetMoveToIndex() ) { idStr itemName = weaponDef->dict.GetString( "display_name" ); idStr itemDesc = weaponDef->dict.GetString( "inv_desc" ); infoBox.SetHeading( idLocalization::GetString( itemName.c_str() ) ); infoBox.SetBody( idLocalization::GetString( itemDesc.c_str() ) ); break; } validIndex++; } if ( GetSprite() != NULL ) { idSWFSpriteInstance * dpad = GetSprite()->GetScriptObject()->GetNestedSprite( "info", "dpad" ); if ( dpad != NULL ) { dpad->SetVisible( false ); } } if ( menuData != NULL ) { idMenuWidget_CommandBar * cmdBar = dynamic_cast< idMenuWidget_CommandBar * const >( menuData->GetChildFromIndex( PDA_WIDGET_CMD_BAR ) ); if ( cmdBar != NULL ) { cmdBar->ClearAllButtons(); idMenuWidget_CommandBar::buttonInfo_t * buttonInfo; buttonInfo = cmdBar->GetButton( idMenuWidget_CommandBar::BUTTON_JOY2 ); if ( menuData->GetPlatform() != 2 ) { buttonInfo->label = "#str_01345"; } buttonInfo->action.Set( WIDGET_ACTION_GO_BACK ); buttonInfo = cmdBar->GetButton( idMenuWidget_CommandBar::BUTTON_JOY3 ); buttonInfo->label = "#str_SWF_EQUIP"; buttonInfo->action.Set( WIDGET_ACTION_JOY3_ON_PRESS ); buttonInfo = cmdBar->GetButton( idMenuWidget_CommandBar::BUTTON_TAB ); buttonInfo->label = ""; buttonInfo->action.Set( WIDGET_ACTION_GO_BACK ); } } idMenuScreen::Update(); }
void ParseSayText (edict_t * ent, char *text, size_t size) { char buf[PARSE_BUFSIZE + 256] = "\0"; //Parsebuf + chatpuf size char *p, *pbuf; p = text; pbuf = buf; while (*p != 0) { if (*p == '%') { switch (*(p + 1)) { case 'H': GetHealth (ent, pbuf); pbuf = SeekBufEnd (pbuf); p += 2; break; case 'A': GetAmmo (ent, pbuf); pbuf = SeekBufEnd (pbuf); p += 2; break; case 'W': GetWeaponName (ent, pbuf); pbuf = SeekBufEnd (pbuf); p += 2; break; case 'I': GetItemName (ent, pbuf); pbuf = SeekBufEnd (pbuf); p += 2; break; case 'T': GetNearbyTeammates (ent, pbuf); pbuf = SeekBufEnd (pbuf); p += 2; break; case 'M': GetViewedTeammateName (ent, pbuf); pbuf = SeekBufEnd (pbuf); p += 2; break; case 'E': GetViewedEnemyName (ent, pbuf); pbuf = SeekBufEnd (pbuf); p += 2; break; case 'F': GetViewedEnemyWeapon (ent, pbuf); pbuf = SeekBufEnd (pbuf); p += 2; break; case 'G': GetEnemyPosition (ent, pbuf); pbuf = SeekBufEnd (pbuf); p += 2; break; case 'K': GetLastKilledTarget (ent, pbuf); pbuf = SeekBufEnd (pbuf); p += 2; break; //AQ2:TNG Slicer - New Location Code /* case 'L': GetOwnPosition (ent, infobuf); strcpy (pbuf, infobuf); pbuf = SeekBufEnd (pbuf); p += 2; break; case 'S': GetViewedPosition (ent, infobuf); strcpy (pbuf, infobuf); pbuf = SeekBufEnd (pbuf); p += 2; break; */ case 'S': GetSightedLocation (ent, pbuf); pbuf = SeekBufEnd (pbuf); p += 2; break; case 'L': GetPlayerLocation (ent, pbuf); pbuf = SeekBufEnd (pbuf); p += 2; break; //AQ2:TNG Slicer Last Damage Location case 'D': GetLastDamagedPart (ent, pbuf); pbuf = SeekBufEnd (pbuf); p += 2; break; //AQ2:TNG END //AQ2:TNG Freud Last Player Damaged case 'P': GetLastDamagedPlayers (ent, pbuf); pbuf = SeekBufEnd (pbuf); p += 2; break; //AQ2:TNG END default: *pbuf++ = *p++; break; } } else { *pbuf++ = *p++; } if (buf[size-1]) { buf[size-1] = 0; break; } } *pbuf = 0; strcpy(text, buf); }
void VX_TrackerOddTeamkilled(int player, int weapon) { char outstring[MAX_TRACKER_MSG_LEN]=""; if (amf_tracker_frags.value == 2) { if (cl_useimagesinfraglog.integer) { snprintf(outstring, sizeof(outstring), "&c%s%s&r %s &c%s%s&r", TKColor(player), amf_tracker_string_teammate.string, GetWeaponName(weapon), TKColor(player), VX_Name(player)); Q_normalizetext(outstring); } else { snprintf(outstring, sizeof(outstring), "&r%s &c%s%s&r %s", amf_tracker_string_teammate.string, TKColor(player), GetWeaponName(weapon), VX_Name(player)); } } else if (cl.playernum == player || (player == Cam_TrackNum() && cl.spectator)) { snprintf(outstring, sizeof(outstring), "&c380Teammate &c900killed you&r"); } VX_TrackerAddText(outstring, tt_death); }
void VX_TrackerTK_XvsY(int player, int killer, int weapon, int p_count, int p_icount, int k_count, int k_icount) { char outstring[MAX_TRACKER_MSG_LEN]=""; if (amf_tracker_frags.value == 2) { if (cl_useimagesinfraglog.integer) { snprintf(outstring, sizeof(outstring), "&c%s%s&r %s &c%s%s&r", TKColor(player), VX_Name(killer), GetWeaponName(weapon), TKColor(player), VX_Name(player)); Q_normalizetext(outstring); } else { snprintf(outstring, sizeof(outstring), "&r%s &c%s%s&r %s", VX_Name(killer), TKColor(player), GetWeaponName(weapon), VX_Name(player)); } } else if (cl.playernum == player || (player == Cam_TrackNum() && cl.spectator)) { snprintf(outstring, sizeof(outstring), "&c380Teammate&r %s &c900killed you\nTimes: %i\nTotal Teamkills: %i", cl.players[killer].name, p_icount, p_count); } else if (cl.playernum == killer || (killer == Cam_TrackNum() && cl.spectator)) { snprintf(outstring, sizeof(outstring), "&c900You killed &c380teammate&r %s\nTimes: %i\nTotal Teamkills: %i", cl.players[player].name, k_icount, k_count); } VX_TrackerAddText(outstring, tt_death); }
void VX_TrackerFragXvsY(int player, int killer, int weapon, int player_wcount, int killer_wcount) { char outstring[MAX_TRACKER_MSG_LEN]=""; if (amf_tracker_frags.value == 2) { if (cl_useimagesinfraglog.integer) { snprintf(outstring, sizeof(outstring), "&c%s%s&r %s &c%s%s&r", XvsYColor(player, killer), VX_Name(killer), GetWeaponName(weapon), XvsYColor(killer, player), VX_Name(player)); Q_normalizetext(outstring); } else { snprintf(outstring, sizeof(outstring), "&r%s &c%s%s&r %s", VX_Name(killer), XvsYColor(player, killer), GetWeaponName(weapon), VX_Name(player)); } } else if (cl.playernum == player || (player == Cam_TrackNum() && cl.spectator)) snprintf(outstring, sizeof(outstring), "&r%s &c900killed you&r\n%s deaths: %i", cl.players[killer].name, GetWeaponName(weapon), player_wcount); else if (cl.playernum == killer || (killer == Cam_TrackNum() && cl.spectator)) snprintf(outstring, sizeof(outstring), "&c900You killed &r%s\n%s kills: %i", cl.players[player].name, GetWeaponName(weapon), killer_wcount); if (cl.playernum == killer || (killer == Cam_TrackNum() && cl.spectator)) VX_OwnFragNew(cl.players[player].name); VX_TrackerAddText(outstring, tt_death); }
bool CGameControllerEXP::CheckCommand(int ClientID, int Team, const char *aMsg) { if(!strncmp(aMsg, "/info", 5) || !strncmp(aMsg, "!info", 5) || !strncmp(aMsg, "/help", 5)) { GameServer()->SendChatTarget(ClientID, "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"); GameServer()->SendChatTarget(ClientID, " EXPlorer"); GameServer()->SendChatTarget(ClientID, " "); GameServer()->SendChatTarget(ClientID, "Version 1.0 | by xush', original idea and mod by Choupom."); GameServer()->SendChatTarget(ClientID, "You have to explore the map, fight monsters, collect items..."); GameServer()->SendChatTarget(ClientID, "Kill a monster to earn an Item (say /items for more info)."); GameServer()->SendChatTarget(ClientID, " "); GameServer()->SendChatTarget(ClientID, "Say /cmdlist for the command list."); GameServer()->SendChatTarget(ClientID, "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"); return true; } else if(!strncmp(aMsg, "/cmdlist", 8) || !strncmp(aMsg, "/cmd", 4)) { GameServer()->SendChatTarget(ClientID, " "); GameServer()->SendChatTarget(ClientID, "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"); GameServer()->SendChatTarget(ClientID, " COMMAND LIST"); GameServer()->SendChatTarget(ClientID, ""); GameServer()->SendChatTarget(ClientID, "'/info': Get info about the modification."); GameServer()->SendChatTarget(ClientID, "'/items': Get info about the items."); GameServer()->SendChatTarget(ClientID, "'/new': Restart the game."); GameServer()->SendChatTarget(ClientID, "'/bind': Learn how to bind a key to use an item."); GameServer()->SendChatTarget(ClientID, "'/game': Show your weapons, kills, armor, etc."); GameServer()->SendChatTarget(ClientID, "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"); return true; } else if(!strncmp(aMsg, "/items", 6)) { GameServer()->SendChatTarget(ClientID, "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"); GameServer()->SendChatTarget(ClientID, " ITEMS"); GameServer()->SendChatTarget(ClientID, " "); GameServer()->SendChatTarget(ClientID, "Checkout '/bind' to learn how to bind items."); GameServer()->SendChatTarget(ClientID, "Weapons: You keep it when you have it."); GameServer()->SendChatTarget(ClientID, "Life: You can use it to respawn where you died."); GameServer()->SendChatTarget(ClientID, "Minor Potion: Use it to get full health."); GameServer()->SendChatTarget(ClientID, "Greater Potion: Use it to get full health and full armor."); GameServer()->SendChatTarget(ClientID, "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"); return true; } else if(!strncmp(aMsg, "/game", 5)) { GameServer()->SendChatTarget(ClientID, "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"); GameServer()->SendChatTarget(ClientID, " GAME"); GameServer()->SendChatTarget(ClientID, " "); char aBuf[256] = {0}; if(GameServer()->m_apPlayers[ClientID]->m_GameExp.m_Weapons == 0) str_format(aBuf, sizeof(aBuf), "Weapons: None", aBuf); for(int i = 1; i < NUM_WEAPONS+2; i++) { if(GameServer()->m_apPlayers[ClientID]->m_GameExp.m_Weapons & (int)pow(2, i)) { if(aBuf[0] == 0) str_format(aBuf, sizeof(aBuf), "Weapons: %s", GetWeaponName(i)); else str_format(aBuf, sizeof(aBuf), "%s, %s", aBuf, GetWeaponName(i)); } } GameServer()->SendChatTarget(ClientID, aBuf); str_format(aBuf, sizeof(aBuf), "Armor : %d", GameServer()->m_apPlayers[ClientID]->m_GameExp.m_ArmorMax); GameServer()->SendChatTarget(ClientID, aBuf); str_format(aBuf, sizeof(aBuf), "Kills : %d", GameServer()->m_apPlayers[ClientID]->m_Score); GameServer()->SendChatTarget(ClientID, aBuf); GameServer()->SendChatTarget(ClientID, "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"); return true; } else if(!strncmp(aMsg, "/bind", 5)) { GameServer()->SendChatTarget(ClientID, "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"); GameServer()->SendChatTarget(ClientID, " BIND DOCUMENTATION"); GameServer()->SendChatTarget(ClientID, ""); GameServer()->SendChatTarget(ClientID, "1) Open the Local Console (F1)."); GameServer()->SendChatTarget(ClientID, "2) Type \"bind <key> say <item>\""); GameServer()->SendChatTarget(ClientID, "Replace <key> by the key you want to press."); GameServer()->SendChatTarget(ClientID, "Replace <item> by the item : life, minor or greater."); GameServer()->SendChatTarget(ClientID, "Example : \"bind l say life\""); GameServer()->SendChatTarget(ClientID, "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"); return true; } else if(!strncmp(aMsg, "/new", 4)) { RestartClient(ClientID); return true; } else if(!strncmp(aMsg, "/life", 5) || !strncmp(aMsg, "life", 4)) { Use(ClientID, "Life"); return true; } else if(!strncmp(aMsg, "/minor", 6) || !strncmp(aMsg, "minor", 5)) { Use(ClientID, "Minor Potion"); return true; } else if(!strncmp(aMsg, "/greater", 8) || !strncmp(aMsg, "greater", 7)) { Use(ClientID, "Greater Potion"); return true; } else if(!strncmp(aMsg, "/", 1)) { char aBuf[256]; str_format(aBuf, sizeof(aBuf), "Unknown command: '%s'", aMsg); GameServer()->SendChatTarget(ClientID, aBuf); return true; } else return false; }
void VX_TrackerOddTeamkill(int player, int weapon, int count) { char outstring[MAX_TRACKER_MSG_LEN]=""; if (amf_tracker_frags.value == 2) snprintf(outstring, sizeof(outstring), "&r%s &c%s%s&r teammate", cl.players[player].name, TKColor(player), GetWeaponName(weapon)); else if (cl.playernum == player || (player == Cam_TrackNum() && cl.spectator)) snprintf(outstring, sizeof(outstring), "&c900You killed &c380a teammate&r\nTotal Teamkills: %i", count); VX_TrackerAddText(outstring, tt_death); }
void ParseSayText(edict_t *ent, char *text) { static unsigned char buf[10240], infobuf[10240]; char *p, *pbuf; p = text; pbuf = buf; *pbuf = 0; while (*p != 0) { if (((ptrdiff_t)pbuf - (ptrdiff_t)buf) > 300) { break; } if (*p == '%') { /* //%A %B%C%D %E%F%G %H %I %J%K %L %M%N%O%P%Q%R%S %T %U%V%W %X%Y%Z //12 rounds (0 extra clips)%B%CNorth%E%F800100Stealth Slippers%Jsome guy I just fondledon Street below top roof%M%N%O%P%Q%Ron Street below top roofnobody%U%VMK23 Pistol%X%Y%Z */ switch (*(p+1)) { /* case 'H': GetHealth(ent, infobuf); strcpy(pbuf, infobuf); pbuf = SeekBufEnd(pbuf); p += 2; continue; case 'A': GetAmmo(ent, infobuf); strcpy(pbuf, infobuf); pbuf = SeekBufEnd(pbuf); p += 2; continue; */ case 'I': GetItemName(ent, infobuf); strcpy(pbuf, infobuf); pbuf = SeekBufEnd(pbuf); p += 2; continue; case 'W': GetWeaponName(ent, infobuf); strcpy(pbuf, infobuf); pbuf = SeekBufEnd(pbuf); p += 2; continue; case 'T': GetNearbyTeammates(ent, infobuf); strcpy(pbuf, infobuf); pbuf = SeekBufEnd(pbuf); p += 2; continue; //case 'N': // GetIDView(ent, infobuf); // strcpy(pbuf, infobuf); // pbuf = SeekBufEnd(pbuf); // p += 2; // continue; case 'M': GetMarkerColor(ent, infobuf); strcpy(pbuf, infobuf); pbuf = SeekBufEnd(pbuf); p += 2; continue; case 'J': GetJumpModes(ent, infobuf); strcpy(pbuf, infobuf); pbuf = SeekBufEnd(pbuf); p += 2; continue; case 'P': sprintf(pbuf, "%d,%d,%d", ent->client->ps.pmove.origin[0]/8,ent->client->ps.pmove.origin[1]/8,ent->client->ps.pmove.origin[2]/8-24); pbuf = SeekBufEnd(pbuf);p += 2;continue; case 'D': sprintf(pbuf,"%d",ent->client->resp.falldmg); pbuf = SeekBufEnd(pbuf);p += 2;continue; case 'S': sprintf(pbuf,"%d",ent->client->ps.stats[STAT_SPEEDX]); pbuf = SeekBufEnd(pbuf);p += 2;continue; case 'H': sprintf(pbuf,"%d",ent->client->resp.highspeed); pbuf = SeekBufEnd(pbuf);p += 2;continue; case 'C': sprintf(pbuf,"%d",ent->client->resp.fallcount); pbuf = SeekBufEnd(pbuf);p += 2;continue; case 'L': sprintf(pbuf,"%d",ent->client->resp.falldmglast); pbuf = SeekBufEnd(pbuf);p += 2;continue; case 'G': sprintf(pbuf,"%d",ent->client->resp.cgravity);//ps.stats[STAT_GRAVITY]); pbuf = SeekBufEnd(pbuf);p += 2;continue; /* %P - Announces your current position on the map + %N - Announces the player's name you are looking at + %C - Announces your fall Count + %D - Announces your falling damage + %L - Announces your last falling damage + %H - Announces your highspeed + %S - Announces your current speed + %M - Announces your marker color + %T - Announces the names of people near you + %W - Announces your current weapon + %I - Announces your active items + %J - Announces your jump modes + %G - Announces your gravity + */ } } *pbuf++ = *p++; } *pbuf = 0; strncpy(text, buf, 300); text[300] = 0; // in case it's 300 }