Raised This Month: $51 Target: $400
 12% 

ammo pack exchange money problem...


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
mo4151
Junior Member
Join Date: Jul 2011
Old 02-05-2013 , 01:00   ammo pack exchange money problem...
Reply With Quote #1

This is my first sma...
Code:
#include <amxmodx>
#include <cstrike>
#include <zombieplague>

#define PLUGIN_NAME    "ammopacksexchangemoney"
#define PLUGIN_VERSION    "1.0"
#define PLUGIN_AUTHOR    "mo4151"

public plugin_init()
{
    register_plugin(PLUGIN_NAME, PLUGIN_VERSION, PLUGIN_AUTHOR)
}

public ammopacksexchangemoney(id)
{
        if (zp_get_user_ammo_packs(id) >= 1)
        cs_set_user_money(id,cs_get_user_money(id)+10000,1)
        zp_set_user_ammo_packs(id,zp_get_user_ammo_packs(id)-1,1)
        client_print(id,print_center,"you used 1 ammo pack to exchange $10000!")
    else
    {
        client_print(id,print_center,"Sorry... you don't have enough ammo pack.")
    }
        
}
I don't know where is wrong... who can tell me ??thx

Last edited by mo4151; 02-05-2013 at 01:02.
mo4151 is offline
gogicaa
Veteran Member
Join Date: Aug 2011
Location: //
Old 02-05-2013 , 08:54   Re: ammo pack exchange money problem...
Reply With Quote #2

ammopacksexchangemoney(id) is never called in plugin.
gogicaa is offline
TheDS1337
Veteran Member
Join Date: Jun 2012
Old 02-06-2013 , 16:44   Re: ammo pack exchange money problem...
Reply With Quote #3

try to use this :d
Code:
#include <amxmodx>
#include <cstrike>
#include <zombieplague>

#define PLUGIN_NAME    "ammopacksexchangemoney"
#define PLUGIN_VERSION    "1.0"
#define PLUGIN_AUTHOR    "mo4151"

public plugin_init()
{
    register_plugin(PLUGIN_NAME, PLUGIN_VERSION, PLUGIN_AUTHOR)

    // Say Command ( Client Command )
    register_clcmd( "say ap_to_money", ammopacksexchangemoney );
    register_clcmd( "say /ap_to_money", ammopacksexchangemoney );
}

public ammopacksexchangemoney(id)
{
    if (zp_get_user_ammo_packs(id) >= 1)
    {
        cs_set_user_money(id,cs_get_user_money(id)+10000,1)
        zp_set_user_ammo_packs(id,zp_get_user_ammo_packs(id)-1,1)
        client_print(id,print_center,"you used 1 ammo pack to exchange $10000!")
    }
    else
    {
        client_print(id,print_center,"Sorry... you don't have enough ammo pack.")
    }
        
}
So if the user say ap_to_money or /ap_to_money
TheDS1337 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 00:38.


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