Raised This Month: $ Target: $400
 0% 

Show Money


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Groven
AlliedModders Donor
Join Date: Apr 2011
Location: Sweden
Old 05-05-2011 , 17:09   Show Money
Reply With Quote #1

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


Last edited by Groven; 05-05-2011 at 17:31.
Groven is offline
SonicSonedit
Veteran Member
Join Date: Nov 2008
Location: Silent Hill
Old 05-06-2011 , 06:49   Re: Show Money
Reply With Quote #2

Instead of cs_set_user_money and cs_get_user_money
use cm_set_user_cash and cm_get_user_cash
__________________

SonicSonedit is offline
Groven
AlliedModders Donor
Join Date: Apr 2011
Location: Sweden
Old 05-06-2011 , 08:59   Re: Show Money
Reply With Quote #3

Will the plugin work then?

Edit: It wont work.

Last edited by Groven; 05-06-2011 at 09:20.
Groven is offline
SonicSonedit
Veteran Member
Join Date: Nov 2008
Location: Silent Hill
Old 05-06-2011 , 12:22   Re: Show Money
Reply With Quote #4

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

__________________

SonicSonedit is offline
Groven
AlliedModders Donor
Join Date: Apr 2011
Location: Sweden
Old 05-06-2011 , 18:07   Re: Show Money
Reply With Quote #5

Yes.

The real money on CS shows in the right corner.

The plugin didn't work.
Groven is offline
SonicSonedit
Veteran Member
Join Date: Nov 2008
Location: Silent Hill
Old 05-07-2011 , 10:59   Re: Show Money
Reply With Quote #6

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

__________________

SonicSonedit is offline
Groven
AlliedModders Donor
Join Date: Apr 2011
Location: Sweden
Old 05-07-2011 , 15:54   Re: Show Money
Reply With Quote #7

I am using CashMod.

So why no

PHP Code:
#include <cashmod> 
Trying the plugin right now.

Edit: Don't work.

Last edited by Groven; 05-07-2011 at 16:25.
Groven is offline
SonicSonedit
Veteran Member
Join Date: Nov 2008
Location: Silent Hill
Old 05-07-2011 , 16:49   Re: Show Money
Reply With Quote #8

Works fine for me. Check your cashmod.
__________________

SonicSonedit is offline
Groven
AlliedModders Donor
Join Date: Apr 2011
Location: Sweden
Old 05-07-2011 , 18:39   Re: Show Money
Reply With Quote #9

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.
Groven is offline
Emp`
AMX Mod X Plugin Approver
Join Date: Aug 2005
Location: Decapod 10
Old 05-08-2011 , 00:20   Re: Show Money
Reply With Quote #10

@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.
Emp` is offline
Send a message via AIM to Emp` Send a message via MSN to Emp` Send a message via Yahoo to Emp` Send a message via Skype™ to Emp`
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 04:23.


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