Raised This Month: $ Target: $400
 0% 

Stats, how?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Obbin
Senior Member
Join Date: Mar 2005
Location: 192.168.1.3
Old 10-24-2005 , 12:35   Stats, how?
Reply With Quote #1

how do i get different stats of a player to a variable? (csx)
Code:
new hitsinleftarm = what to_put_here(id) //To get how many times a player has shot someone i left arm
__________________
Sig(h)!
Obbin is offline
XxAvalanchexX
Veteran Member
Join Date: Oct 2004
Location: abort73.com
Old 10-24-2005 , 16:41  
Reply With Quote #2

Look at your csstats.inc
__________________
No longer around. Thanks your support, everyone! As always:
THIS ONES FOR YOU
3000 PTS
XxAvalanchexX is offline
Obbin
Senior Member
Join Date: Mar 2005
Location: 192.168.1.3
Old 10-24-2005 , 16:42  
Reply With Quote #3

I did, but i didnt understand!
__________________
Sig(h)!
Obbin is offline
XxAvalanchexX
Veteran Member
Join Date: Oct 2004
Location: abort73.com
Old 10-24-2005 , 16:46  
Reply With Quote #4

Code:
/* Gets stats with which user have killed/hurt his victim. If victim is 0 * then stats are from all victims. If victim has not been hurt, function * returns 0 in other case 1. User stats are reset on his respawn. */ native get_user_vstats(index,victim,stats[8],bodyhits[8],wpnname[]="",len=0);

So try this:

Code:
new stats[8], bodyhits[8], weapon[32]; get_user_vstats(attacker,victim,stats,bodyhits,weapon,31); leftarmhits = bodyhits[HIT_LEFTLEG];
__________________
No longer around. Thanks your support, everyone! As always:
THIS ONES FOR YOU
3000 PTS
XxAvalanchexX is offline
Obbin
Senior Member
Join Date: Mar 2005
Location: 192.168.1.3
Old 10-25-2005 , 11:58  
Reply With Quote #5

Ok so i got these, a test plugin!
it should print how many times you hited someones leftleg (everybody that round)

Errors:
/home/users/amxmodx/tmp3/textVyTvyi.sma(14) : error 017: undefined symbol "leftleghits"
/home/users/amxmodx/tmp3/textVyTvyi.sma(14) : warning 215: expression has no effect
/home/users/amxmodx/tmp3/textVyTvyi.sma(15) : error 017: undefined symbol "leftleghits"
/home/users/amxmodx/tmp3/textVyTvyi.sma(15 -- 17) : warning 202: number of arguments does not match definition
/home/users/amxmodx/tmp3/textVyTvyi.sma(15 -- 17) : error 001: expected token: ",", but found "}"


Code:
#include <amxmodx> #include <csx> public plugin_init(){     register_plugin("Test","test","test")     register_clcmd("Leftleghits","haha") } public haha(id){ new stats[8], bodyhits[8], weapon[32] get_user_vstats(id,0,stats,bodyhits,weapon,31) leftleghits = bodyhits[HIT_LEFTLEG]; client_print(id ,print_chat ,"%s", leftleghits) }

why?
__________________
Sig(h)!
Obbin is offline
XxAvalanchexX
Veteran Member
Join Date: Oct 2004
Location: abort73.com
Old 10-25-2005 , 12:10  
Reply With Quote #6

Because you never declared the leftleghits variable. Just put "new " before it.
__________________
No longer around. Thanks your support, everyone! As always:
THIS ONES FOR YOU
3000 PTS
XxAvalanchexX is offline
Obbin
Senior Member
Join Date: Mar 2005
Location: 192.168.1.3
Old 10-26-2005 , 10:57  
Reply With Quote #7

can i get the stats out of statsX like:
like
Hits:
Head: 1
right arm: 2
and so on?
__________________
Sig(h)!
Obbin 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 23:43.


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