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

[REQ] Help with GXM


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
zDac
Member
Join Date: Jan 2013
Old 11-03-2014 , 08:05   [REQ] Help with GXM
Reply With Quote #1

Hi, can someone help me, how can I get gun, buying with xp? for example:

A player writes /buygun in chat, and he gets AWP, but he spends his xp, not money. The value of gun can be changed by CVar.
__________________
Learning AMXX.
zDac is offline
Send a message via Skype™ to zDac
zmd94
Veteran Member
Join Date: Nov 2013
Location: Malaysia (9w2zow).
Old 11-03-2014 , 09:30   Re: [REQ] Help with GXM
Reply With Quote #2

Firstly, you have to install XP system in your server.
zmd94 is offline
zDac
Member
Join Date: Jan 2013
Old 11-03-2014 , 11:02   Re: [REQ] Help with GXM
Reply With Quote #3

I've did it.
__________________
Learning AMXX.
zDac is offline
Send a message via Skype™ to zDac
zmd94
Veteran Member
Join Date: Nov 2013
Location: Malaysia (9w2zow).
Old 11-03-2014 , 11:41   Re: [REQ] Help with GXM
Reply With Quote #4

This is just an example:
PHP Code:
#include <amxmodx>
#include <cstrike>
#include <fun>
#include <YourXP.inc> // Your EXP need to have dynamic native so that we can use it in other plugin

public plugin_init()
{
    
register_plugin("Simple""1.0""Pro7")
    
    
// The command to buy the gun
    
register_clcmd("say /buygun""Simple")
    
register_clcmd("say_team /buygun""Simple")
}

public 
Simple(id)
{    
    
// "get_user_exp" is the dynamic native that to get the player EXP
    // So, we make a check whether the player has the minimum EXP to 
    // buy the gun. 50 is the value of the gun.
    
if (get_user_exp(id) > 50)
    {
        
// "del_user_exp" is the dynamic native that we used to deduct player
        // EXP. Below, when player say /buygun his EXP will be deducted 
        // by 50.
        
del_user_exp(id50)
        
        
// Then we give the weapon
        
give_item(id,"weapon_sg550")
        
give_item(id,"ammo_556nato")
        
give_item(id,"ammo_556nato")
        
give_item(id,"ammo_556nato")
    }
    
// If the player do not have minimum EXP, then he cannot buy it
    
else
    {
        
// We tell the player that he cannot buy the gun
        
client_print(idprint_chat"[Test] Sorry, you do not have minimum EXP to buy the gun!")
    }


Last edited by zmd94; 11-03-2014 at 11:50.
zmd94 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 15:20.


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