AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   set_user_frags problem (https://forums.alliedmods.net/showthread.php?t=222884)

Jhob94 08-07-2013 16:18

set_user_frags problem
 
Well iam using this:
PHP Code:

set_user_frags(idget_user_frags(id) + 1

It gives frags to players but only updates on scoreboard when players die. On game is real players vs npc. (In case of be important information for the problem)
So it works well since frags are given correctly, the problem is that doesnt updates the scoreboard.

Black Rose 08-07-2013 16:40

Re: set_user_frags problem
 
Code:
message_begin(MSG_ALL, get_user_msgid("ScoreInfo")); write_byte(id); write_short(kills); write_short(deaths); write_short(0); write_short(get_user_team(id)); message_end();

http://wiki.amxmodx.org/Half-Life_1_...ents#ScoreInfo

Jhob94 08-07-2013 17:53

Re: set_user_frags problem
 
Thanks it works :)

ConnorMcLeod 08-07-2013 18:02

Re: set_user_frags problem
 
Or use this :

Add 1 frag to player
PHP Code:

ExecuteHam(Ham_AddPointsid1true); 

In addition :

PHP Code:

CsSetUserScore(idfragsdeaths)
{
    
set_pdata_int(idm_iDeathsdeaths);
    
ExecuteHam(Ham_AddPointsidfrags get_user_frags(id), true);
}

CsSetUserFrags(idfrags)
{
    
ExecuteHam(Ham_AddPointsidfrags get_user_frags(id), true);
}

CsSetUserDeaths(iddeaths)
{
    
set_pdata_int(idm_iDeathsdeaths);
    
ExecuteHam(Ham_AddPointsid0true);



Jhob94 08-07-2013 18:46

Re: set_user_frags problem
 
Quote:

Originally Posted by ConnorMcLeod (Post 2008063)
Or use this :

Add 1 frag to player
PHP Code:

ExecuteHam(Ham_AddPointsid1true); 

In addition :

Does it updates automatickly the score board?

ConnorMcLeod 08-08-2013 00:21

Re: set_user_frags problem
 
That's why i suggested you to use it, yes.

Spoiler

bibu 08-08-2013 05:52

Re: set_user_frags problem
 
Connor, why:

PHP Code:

frags get_user_frags(id

and not just

frags

?

TheDS1337 08-08-2013 06:03

Re: set_user_frags problem
 
Quote:

Originally Posted by bibu (Post 2008423)
Connor, why:

PHP Code:

frags get_user_frags(id

and not just

frags

?

Because it will add points

ConnorMcLeod 08-08-2013 12:03

Re: set_user_frags problem
 
PHP Code:

ExecuteHam(Ham_AddPointsidfrags get_user_frags(id), true); 

is same than doing :

PHP Code:

set_pev(idpev_frags0.0);
ExecuteHam(Ham_AddPointsidfragstrue); 

Do as you want, as it is the most easy to understand and to be comfortable with.


All times are GMT -4. The time now is 15:56.

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