Show Other Players Items
Moderator: Forum Moderator
-
- Spell Breaker
- Posts: 398
- Joined: Sun Apr 27, 2008 10:11 pm
Re: Show Other Players Items
ya its possible its an easy code to do too, if u would like i can write it up for ya

-
- Spell Breaker
- Posts: 398
- Joined: Sun Apr 27, 2008 10:11 pm
Re: Show Other Players Items
well geesu somewhat has it setup to show items but its not adding the string correctly but here is what i have and it works and doesnt show the item if its a mole. find wc3_showspecinfo in war3ft.inl and replace the whole thing with this
*edited* fixed a small bug but here this should work 100%
Code: Select all
WC3_ShowSpecInfo( id, iTargetID )
{
// Get the target's name
new szTargetName[32];
get_user_name( iTargetID, szTargetName, 31 );
// Get the target's race name
new szRaceName[64];
lang_GetRaceName( p_data[iTargetID][P_RACE], id, szRaceName, 63, true );
new szMsg[512], iMsgPos = 0;
// User is level 0
if ( p_data[iTargetID][P_LEVEL] == 0 )
{
iMsgPos += formatex( szMsg, 511, "%s XP: %d/%d", szRaceName, p_data[iTargetID][P_XP], XP_GetByLevel( p_data[iTargetID][P_LEVEL]+1 ) );
}
// User is under level 10
else if ( p_data[iTargetID][P_LEVEL] < 17 )
{
iMsgPos += formatex( szMsg, 511, "%s %L: %d XP: %d/%d", szRaceName, id, "WORD_LEVEL", p_data[iTargetID][P_LEVEL], p_data[iTargetID][P_XP], XP_GetByLevel( p_data[iTargetID][P_LEVEL]+1 ) );
}
// User is level 10
else
{
iMsgPos += formatex( szMsg, 511, "%s %L: %d XP: %d", szRaceName, id, "WORD_LEVEL", p_data[iTargetID][P_LEVEL], p_data[iTargetID][P_XP] );
}
new szItemName[32], szItemName2[32];
// Get the item and race names
LANG_GetItemName( g_iShopMenuItems[iTargetID][ITEM_SLOT_ONE], id, szItemName, 31, true );
LANG_GetItemName( g_iShopMenuItems[iTargetID][ITEM_SLOT_TWO], id, szItemName2, 31, true );
new bool:ItemSlotOne = false
new bool:HasMoreThanOneRing = false
if ( g_iTotalRings[iTargetID] > 1 )
HasMoreThanOneRing = true;
// User has one item
if ( g_iShopMenuItems[iTargetID][ITEM_SLOT_ONE] > ITEM_NONE && g_iShopMenuItems[iTargetID][ITEM_SLOT_ONE] != ITEM_MOLE )
{
// Then they have rings, lets print how many there are
if (HasMoreThanOneRing && g_iShopMenuItems[iTargetID][ITEM_SLOT_ONE] == ITEM_RING)
iMsgPos += formatex( szMsg[iMsgPos], 512-iMsgPos, "^nItem: %s x%d", szItemName, g_iTotalRings[iTargetID] );
else
iMsgPos += formatex( szMsg[iMsgPos], 512-iMsgPos, "^nItem: %s", szItemName );
ItemSlotOne = true;
}
// User has another item
if ( g_iShopMenuItems[iTargetID][ITEM_SLOT_TWO] > ITEM_NONE && g_iShopMenuItems[iTargetID][ITEM_SLOT_TWO] != ITEM_MOLE )
{
// Then the string isn't empty and we have information in it (so we have a first item)
if ( ItemSlotOne )
{
// Then they have rings, lets print how many there are
if (HasMoreThanOneRing && g_iShopMenuItems[iTargetID][ITEM_SLOT_TWO] == ITEM_RING)
iMsgPos += formatex( szMsg[iMsgPos], 512-iMsgPos, " %L %s x%d", id, "WORD_AND", szItemName2, g_iTotalRings[iTargetID] );
else
iMsgPos += formatex( szMsg[iMsgPos], 512-iMsgPos, " %L %s", id, "WORD_AND", szItemName2 );
}
// We don't need the word "and"
else
{
// Then they have rings, lets print how many there are
if (HasMoreThanOneRing && g_iShopMenuItems[iTargetID][ITEM_SLOT_TWO] == ITEM_RING)
iMsgPos += formatex( szMsg[iMsgPos], 512-iMsgPos, "^nItem: %s x%d", szItemName2, g_iTotalRings[iTargetID] );
else
iMsgPos += formatex( szMsg[iMsgPos], 512-iMsgPos, "^nItem: %s", szItemName2 );
}
}
// Add the Health + Armor to the message
if ( g_MOD == GAME_CSTRIKE || g_MOD == GAME_CZERO )
{
iMsgPos += formatex( szMsg[iMsgPos], 512-iMsgPos, "^n%L: %d^n%L: %d", id, "CURRENT_HEALTH", get_user_health( iTargetID ), id, "WORD_ARMOR", get_user_armor( iTargetID ) );
}
// No armor in DOD
else if ( g_MOD == GAME_DOD )
{
iMsgPos += formatex( szMsg[iMsgPos], 512-iMsgPos, "^n%L: %d", id, "CURRENT_HEALTH", get_user_health( iTargetID ) );
}
// Format the message
new Float:fSpecTime = SPEC_HOLDTIME;
if ( get_pcvar_num( CVAR_wc3_spec_position ) == 0 )
{
set_hudmessage( 255, 255, 255, 0.018, 0.9, 2, 1.5, fSpecTime, 0.02, 5.0, HUD_SPEC_INFO );
}
else
{
set_hudmessage( 255, 255, 255, 0.65, 0.9, 2, 1.5, fSpecTime, 0.02, 5.0, HUD_SPEC_INFO );
}
// Show the message
show_hudmessage( id, szMsg );
}

Re: Show Other Players Items
what is the issue on the existing source tree? I thought this should work by defaultwhosyourdaddy wrote:well geesu somewhat has it setup to show items but its not adding the string correctly but here is what i have and it works and doesnt show the item if its a mole. find wc3_showspecinfo in war3ft.inl and replace the whole thing with this*edited* fixed a small bug but here this should work 100%Code: Select all
WC3_ShowSpecInfo( id, iTargetID ) { // Get the target's name new szTargetName[32]; get_user_name( iTargetID, szTargetName, 31 ); // Get the target's race name new szRaceName[64]; lang_GetRaceName( p_data[iTargetID][P_RACE], id, szRaceName, 63, true ); new szMsg[512], iMsgPos = 0; // User is level 0 if ( p_data[iTargetID][P_LEVEL] == 0 ) { iMsgPos += formatex( szMsg, 511, "%s XP: %d/%d", szRaceName, p_data[iTargetID][P_XP], XP_GetByLevel( p_data[iTargetID][P_LEVEL]+1 ) ); } // User is under level 10 else if ( p_data[iTargetID][P_LEVEL] < 17 ) { iMsgPos += formatex( szMsg, 511, "%s %L: %d XP: %d/%d", szRaceName, id, "WORD_LEVEL", p_data[iTargetID][P_LEVEL], p_data[iTargetID][P_XP], XP_GetByLevel( p_data[iTargetID][P_LEVEL]+1 ) ); } // User is level 10 else { iMsgPos += formatex( szMsg, 511, "%s %L: %d XP: %d", szRaceName, id, "WORD_LEVEL", p_data[iTargetID][P_LEVEL], p_data[iTargetID][P_XP] ); } new szItemName[32], szItemName2[32]; // Get the item and race names LANG_GetItemName( g_iShopMenuItems[iTargetID][ITEM_SLOT_ONE], id, szItemName, 31, true ); LANG_GetItemName( g_iShopMenuItems[iTargetID][ITEM_SLOT_TWO], id, szItemName2, 31, true ); new bool:ItemSlotOne = false new bool:HasMoreThanOneRing = false if ( g_iTotalRings[iTargetID] > 1 ) HasMoreThanOneRing = true; // User has one item if ( g_iShopMenuItems[iTargetID][ITEM_SLOT_ONE] > ITEM_NONE && g_iShopMenuItems[iTargetID][ITEM_SLOT_ONE] != ITEM_MOLE ) { // Then they have rings, lets print how many there are if (HasMoreThanOneRing && g_iShopMenuItems[iTargetID][ITEM_SLOT_ONE] == ITEM_RING) iMsgPos += formatex( szMsg[iMsgPos], 512-iMsgPos, "^nItem: %s x%d", szItemName, g_iTotalRings[iTargetID] ); else iMsgPos += formatex( szMsg[iMsgPos], 512-iMsgPos, "^nItem: %s", szItemName ); ItemSlotOne = true; } // User has another item if ( g_iShopMenuItems[iTargetID][ITEM_SLOT_TWO] > ITEM_NONE && g_iShopMenuItems[iTargetID][ITEM_SLOT_TWO] != ITEM_MOLE ) { // Then the string isn't empty and we have information in it (so we have a first item) if ( ItemSlotOne ) { // Then they have rings, lets print how many there are if (HasMoreThanOneRing && g_iShopMenuItems[iTargetID][ITEM_SLOT_TWO] == ITEM_RING) iMsgPos += formatex( szMsg[iMsgPos], 512-iMsgPos, " %L %s x%d", id, "WORD_AND", szItemName2, g_iTotalRings[iTargetID] ); else iMsgPos += formatex( szMsg[iMsgPos], 512-iMsgPos, " %L %s", id, "WORD_AND", szItemName2 ); } // We don't need the word "and" else { // Then they have rings, lets print how many there are if (HasMoreThanOneRing && g_iShopMenuItems[iTargetID][ITEM_SLOT_TWO] == ITEM_RING) iMsgPos += formatex( szMsg[iMsgPos], 512-iMsgPos, "^nItem: %s x%d", szItemName2, g_iTotalRings[iTargetID] ); else iMsgPos += formatex( szMsg[iMsgPos], 512-iMsgPos, "^nItem: %s", szItemName2 ); } } // Add the Health + Armor to the message if ( g_MOD == GAME_CSTRIKE || g_MOD == GAME_CZERO ) { iMsgPos += formatex( szMsg[iMsgPos], 512-iMsgPos, "^n%L: %d^n%L: %d", id, "CURRENT_HEALTH", get_user_health( iTargetID ), id, "WORD_ARMOR", get_user_armor( iTargetID ) ); } // No armor in DOD else if ( g_MOD == GAME_DOD ) { iMsgPos += formatex( szMsg[iMsgPos], 512-iMsgPos, "^n%L: %d", id, "CURRENT_HEALTH", get_user_health( iTargetID ) ); } // Format the message new Float:fSpecTime = SPEC_HOLDTIME; if ( get_pcvar_num( CVAR_wc3_spec_position ) == 0 ) { set_hudmessage( 255, 255, 255, 0.018, 0.9, 2, 1.5, fSpecTime, 0.02, 5.0, HUD_SPEC_INFO ); } else { set_hudmessage( 255, 255, 255, 0.65, 0.9, 2, 1.5, fSpecTime, 0.02, 5.0, HUD_SPEC_INFO ); } // Show the message show_hudmessage( id, szMsg ); }
No Support via PM
-
- Spell Breaker
- Posts: 398
- Joined: Sun Apr 27, 2008 10:11 pm
Re: Show Other Players Items
But it's supposed towhosyourdaddy wrote:urs wont show players items when some1 dead is speccing them

No Support via PM
-
- Spell Breaker
- Posts: 398
- Joined: Sun Apr 27, 2008 10:11 pm
Re: Show Other Players Items
ya i know i pretty much took what u did and kinda rewrote it so it would work, i think ur add string ommand isnt working correctly

Re: Show Other Players Items
This on bug tracker as a problem?whosyourdaddy wrote:ya i know i pretty much took what u did and kinda rewrote it so it would work, i think ur add string ommand isnt working correctly
No Support via PM
-
- Spell Breaker
- Posts: 398
- Joined: Sun Apr 27, 2008 10:11 pm
Re: Show Other Players Items
If you add it maybe it will get fixedwhosyourdaddy wrote:i dont beleive so

The one time a year I actually do some updates - I only go by what is on the bug tracker
No Support via PM
-
- Spell Breaker
- Posts: 398
- Joined: Sun Apr 27, 2008 10:11 pm
Re: Show Other Players Items
I fix them (once a year) - I don't add themwhosyourdaddy wrote:lol added but i got a question, why dont u ever add lol?
No Support via PM