AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Stats, how? (https://forums.alliedmods.net/showthread.php?t=19739)

Obbin 10-24-2005 12:35

Stats, how?
 
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

XxAvalanchexX 10-24-2005 16:41

Look at your csstats.inc

Obbin 10-24-2005 16:42

I did, but i didnt understand!

XxAvalanchexX 10-24-2005 16:46

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

Obbin 10-25-2005 11:58

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?

XxAvalanchexX 10-25-2005 12:10

Because you never declared the leftleghits variable. Just put "new " before it.

Obbin 10-26-2005 10:57

can i get the stats out of statsX like:
like
Hits:
Head: 1
right arm: 2
and so on?


All times are GMT -4. The time now is 23:43.

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