AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Set Deaths? (https://forums.alliedmods.net/showthread.php?t=87231)

BOYSplayCS 03-08-2009 15:10

Set Deaths?
 
Is it possible to set deaths? If so, how?

Bugsy 03-08-2009 15:13

Re: Set Deaths?
 
If using cs, http://www.amxmodx.org/funcwiki.php?go=func&id=181

BOYSplayCS 03-08-2009 15:14

Re: Set Deaths?
 
Oh, thank you - I really didn't have enough time to search.

Bugsy 03-08-2009 15:17

Re: Set Deaths?
 
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();



BOYSplayCS 03-08-2009 15:19

Re: Set Deaths?
 
That will automatically be displayed on the scoreboard correct?

Bugsy 03-08-2009 15:20

Re: Set Deaths?
 
Quote:

Originally Posted by BOYSplayCS (Post 776647)
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)

BOYSplayCS 03-08-2009 15:22

Re: Set Deaths?
 
Now, to set frags and deaths equal to an amount how would you do it with fakemeta? I know how with cstrike though.

Bugsy 03-08-2009 15:26

Re: Set Deaths?
 
SetScore(id , 10 , 0 , get_user_team(id) )

Would set 10 frags, 0 deaths.

BOYSplayCS 03-08-2009 15:26

Re: Set Deaths?
 
Thank you very much.

:)

ConnorMcLeod 03-08-2009 16:13

Re: Set Deaths?
 
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.


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

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