AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   get user money with fakemeta? (https://forums.alliedmods.net/showthread.php?t=47267)

The Specialist 11-13-2006 17:42

get user money with fakemeta?
 
is there a way to get and set users money with fakemta? I dont see a pev function for it ? thanks :)

XxAvalanchexX 11-13-2006 19:00

Re: get user money with fakemeta?
 
Code:
 #if cellbits == 32     #define OFFSET_CSMONEY  115  #else     #define OFFSET_CSMONEY  140  #endif  #define OFFSET_LINUX       5  stock fm_cs_set_user_money(id,money,flash=1)  {      set_pdata_int(id,OFFSET_CSMONEY,money,OFFSET_LINUX);      message_begin(MSG_ONE,get_user_msgid("Money"),{0,0,0},id);      write_long(money);      write_byte(flash);      message_end();  }  stock fm_cs_get_user_money(id)  {      return get_pdata_int(id,OFFSET_CSMONEY,OFFSET_LINUX);  }

This is how I would do it, except that you would want to store the Money message id somewhere instead of getting it every time.

The Specialist 11-13-2006 20:20

Re: get user money with fakemeta?
 
now would that be more efficiant then using cs_get_user_money to get and set a users money ? if not then ill just keep the cstrike way thansk ++karma:up:



EDIT : Ah i see now . It all makes sence. vEN should add that to fm_util pack :up: thanks again AvALANCHE

k007 11-13-2006 20:35

Re: get user money with fakemeta?
 
i think it's better using the cs function

The Specialist 11-13-2006 20:51

Re: get user money with fakemeta?
 
me too . Id like to use the fakemeta way so i wont have to add any more modules to my "weapon Jam" plugin , but the version i tried with avalnches way crashed my server :cry: thanks any ways I gave you karma anyways :up:

XxAvalanchexX 11-13-2006 20:57

Re: get user money with fakemeta?
 
Whoops. The first argument is a long, not a byte. Use the new code.

VEN 11-14-2006 14:24

Re: get user money with fakemeta?
 
Quote:

vEN should add that to fm_util pack
I've thought about porting cstrike module to FM but i don't think it will worth it. Though, i've ported some natives like ones which control deaths/money/armor/vip/mapzones a while ago, it can be found in the source code of some of my official plugins.

I'd rather make some on requests, but maybe will port them.


All times are GMT -4. The time now is 06:58.

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