Raised This Month: $ Target: $400
 0% 

set_user_frags problem


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Jhob94
AMX Mod X Donor
Join Date: Jul 2012
Old 08-07-2013 , 16:18   set_user_frags problem
Reply With Quote #1

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.
__________________
Jhob94 is offline
Black Rose
Veteran Member
Join Date: Feb 2011
Location: Stockholm, Sweden
Old 08-07-2013 , 16:40   Re: set_user_frags problem
Reply With Quote #2

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
__________________

Last edited by Black Rose; 08-07-2013 at 16:44.
Black Rose is offline
Jhob94
AMX Mod X Donor
Join Date: Jul 2012
Old 08-07-2013 , 17:53   Re: set_user_frags problem
Reply With Quote #3

Thanks it works
__________________
Jhob94 is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 08-07-2013 , 18:02   Re: set_user_frags problem
Reply With Quote #4

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);

__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
Jhob94
AMX Mod X Donor
Join Date: Jul 2012
Old 08-07-2013 , 18:46   Re: set_user_frags problem
Reply With Quote #5

Quote:
Originally Posted by ConnorMcLeod View Post
Or use this :

Add 1 frag to player
PHP Code:
ExecuteHam(Ham_AddPointsid1true); 
In addition :
Does it updates automatickly the score board?
__________________
Jhob94 is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 08-08-2013 , 00:21   Re: set_user_frags problem
Reply With Quote #6

That's why i suggested you to use it, yes.

Spoiler
__________________
- tired and retired -

- my plugins -

Last edited by ConnorMcLeod; 08-08-2013 at 00:22.
ConnorMcLeod is offline
bibu
Veteran Member
Join Date: Sep 2010
Old 08-08-2013 , 05:52   Re: set_user_frags problem
Reply With Quote #7

Connor, why:

PHP Code:
frags get_user_frags(id
and not just

frags

?
__________________
Selling tons of my own private works.
Accepting paid work for clans and communities.
Don't hesitate to contact me.
bibu is offline
TheDS1337
Veteran Member
Join Date: Jun 2012
Old 08-08-2013 , 06:03   Re: set_user_frags problem
Reply With Quote #8

Quote:
Originally Posted by bibu View Post
Connor, why:

PHP Code:
frags get_user_frags(id
and not just

frags

?
Because it will add points
TheDS1337 is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 08-08-2013 , 12:03   Re: set_user_frags problem
Reply With Quote #9

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.
__________________
- 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 15:56.


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