AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Show Money (https://forums.alliedmods.net/showthread.php?t=156387)

Groven 05-05-2011 17:09

Show Money
 
Hello,

I tried to do this so the money on CashMod shows in the right corner to.


PHP Code:

#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <cashmod>

#define PLUGIN "Cash Money"
#define VERSION "1.0"
#define AUTHOR "Ettan"

#define SURVIVE_MONEY 80
#define USER_MONEY 40

public plugin_init() 
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
register_event"DeathMsg""Event_DeathMsg""a" );
}

public 
Event_DeathMsg()
{
    new 
killer read_data(1);
    {
        
cs_set_user_money(killercs_get_user_money(killer)+SURVIVE_MONEY)
    }



SonicSonedit 05-06-2011 06:49

Re: Show Money
 
Instead of cs_set_user_money and cs_get_user_money
use cm_set_user_cash and cm_get_user_cash

Groven 05-06-2011 08:59

Re: Show Money
 
Will the plugin work then?

Edit: It wont work.

SonicSonedit 05-06-2011 12:22

Re: Show Money
 
Groven
What exactly do you want? To replace regular money with cashmod money? If yes, use this:
PHP Code:

#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <cashmod>

#define PLUGIN "Cash Money"
#define VERSION "1.0"
#define AUTHOR "Ettan"

#define SURVIVE_MONEY 80
#define USER_MONEY 40

public plugin_init() 
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
register_event"DeathMsg""Event_DeathMsg""a" );
}

public 
Event_DeathMsg()
{
    new 
killer read_data(1);
    {
        new 
cashmod_money=cm_get_user_cash(killer)
        
cashmod_money+=SURVIVE_MONEY
        cm_set_user_cash
(killercashmod_money)
        
cs_set_user_money(killercashmod_money)
    }



Groven 05-06-2011 18:07

Re: Show Money
 
Yes.

The real money on CS shows in the right corner.

The plugin didn't work.

SonicSonedit 05-07-2011 10:59

Re: Show Money
 
Try this:
PHP Code:

/* Plugin generated by AMXX-Studio */

#include <amxmodx>

#define PLUGIN "Money replace"
#define VERSION "0.0.0.0"
#define AUTHOR "authors"

new g_msgMoney

public plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
g_msgMoney=get_user_msgid("Money")
    
    
register_event("Money""event_Money""b")
}

public 
event_Money(id)
{        
    
message_begin(MSG_ONEg_msgMoney_id)
    
write_long(cm_get_user_cash(id))
    
write_byte(read_data(2))
    
message_end()
    
    return 
PLUGIN_HANDLED



Groven 05-07-2011 15:54

Re: Show Money
 
I am using CashMod.

So why no

PHP Code:

#include <cashmod> 

Trying the plugin right now.

Edit: Don't work.

SonicSonedit 05-07-2011 16:49

Re: Show Money
 
Works fine for me. Check your cashmod.

Groven 05-07-2011 18:39

Re: Show Money
 
What do you mean by check your cashmod?

I know that cashmod has so it shows in the right corner when you're dead.

I want it to show when you're alive to.

And updates it when u get Cash for killing and survive.

Emp` 05-08-2011 00:20

Re: Show Money
 
@SonicSonedit: Instead of blocking the event and then sending a new one, it would be better to use register_message and then use set_msg_arg_int to change the value.


All times are GMT -4. The time now is 04:22.

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