Raised This Month: $ Target: $400
 0% 

Set Deaths?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
BOYSplayCS
BANNED
Join Date: Apr 2008
Location: Gainesville, FL
Old 03-08-2009 , 15:10   Set Deaths?
Reply With Quote #1

Is it possible to set deaths? If so, how?
BOYSplayCS is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 03-08-2009 , 15:13   Re: Set Deaths?
Reply With Quote #2

If using cs, http://www.amxmodx.org/funcwiki.php?go=func&id=181
__________________
Bugsy is offline
BOYSplayCS
BANNED
Join Date: Apr 2008
Location: Gainesville, FL
Old 03-08-2009 , 15:14   Re: Set Deaths?
Reply With Quote #3

Oh, thank you - I really didn't have enough time to search.
BOYSplayCS is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 03-08-2009 , 15:17   Re: Set Deaths?
Reply With Quote #4

If you prefer fakemeta, include fakemeta_util this can be used to do both scores.

PHP Code:
#define OFFSET_CSDEATHS        444
g_MsgScoreInfo get_user_msgid("ScoreInfo");

public 
SetScore(id iFrags iDeaths iTeam 
{
    if( !
is_user_connected(id) )
        return;
        
    if( 
iFrags )
        
fm_set_user_fragsid iFrags);

    if( 
iDeaths )
        
set_pdata_int(idOFFSET_CSDEATHS iDeaths);
    
    
message_begin(MSG_ALL g_MsgScoreInfo );
    
write_byte(id);
    
write_short(iFrags);
    
write_short(iDeaths);
    
write_short(0);
    
write_short(iTeam);
    
message_end();

__________________
Bugsy is offline
BOYSplayCS
BANNED
Join Date: Apr 2008
Location: Gainesville, FL
Old 03-08-2009 , 15:19   Re: Set Deaths?
Reply With Quote #5

That will automatically be displayed on the scoreboard correct?
BOYSplayCS is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 03-08-2009 , 15:20   Re: Set Deaths?
Reply With Quote #6

Quote:
Originally Posted by BOYSplayCS View Post
That will automatically be displayed on the scoreboard correct?
Yes, that will set the scores appropriately and update scoreboard. Make sure you pass the appropriate team (or you can edit the function itself to find team)
__________________
Bugsy is offline
BOYSplayCS
BANNED
Join Date: Apr 2008
Location: Gainesville, FL
Old 03-08-2009 , 15:22   Re: Set Deaths?
Reply With Quote #7

Now, to set frags and deaths equal to an amount how would you do it with fakemeta? I know how with cstrike though.
BOYSplayCS is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 03-08-2009 , 15:26   Re: Set Deaths?
Reply With Quote #8

SetScore(id , 10 , 0 , get_user_team(id) )

Would set 10 frags, 0 deaths.
__________________
Bugsy is offline
BOYSplayCS
BANNED
Join Date: Apr 2008
Location: Gainesville, FL
Old 03-08-2009 , 15:26   Re: Set Deaths?
Reply With Quote #9

Thank you very much.

BOYSplayCS is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 03-08-2009 , 16:13   Re: Set Deaths?
Reply With Quote #10

Just replace get_user_team(id) with get_pdata_int(id, 114), as get_user_team may return false results when a player is dead and have changed his team.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 09:01.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode