Raised This Month: $ Target: $400
 0% 

[HELP] How to do that once an added exp


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Forever Killer
Junior Member
Join Date: Dec 2014
Old 12-03-2014 , 13:08   [HELP] How to do that once an added exp
Reply With Quote #1

Hi, in first of my help thread i want to sorry all for my english... ;D

My trouble is, in plugin i writing to cod mod and i can't set that add experience just one time...
Now experience added all of time, and this is my problem.. I want to do that once an added exp..

How it is to operate:
I have two kills i gets 'Elo' rank and just random from 0-30 exp gives to me just once time... If i have two kills...

Code of plugin:
Code:
#include <amxmodx>
#include <amxmisc>
#include <csx>
#include <codmod>
#include <colorchat>

#define PLUGIN "EXP for ranks"
#define VERSION "1.0"
#define AUTHOR "Forever Killer "

#define TASK 666

public plugin_init() {
    register_plugin(PLUGIN, VERSION, AUTHOR)
}

public client_connect(id)
{
    if(is_user_bot(id))
        return
 
    new param[1]
    param[0] = id
 
    set_task(1.0,"rank",TASK+id,param,1,"b")
}
public client_disconnect(id)
    if(task_exists(TASK+id))
    remove_task(TASK+id)

public rank(param[])
{
    new id = param[0]
	new exp = cod_get_user_xp(id);
 
    static stats[8], body[8]
    get_user_stats(id, stats, body)
 
    new ranga[30]	
 
    if ( stats[0] >= 0 && stats[0] <= 2) format(ranga,29,"Elo")
	if ( stats[0] >= 3 && stats[0] <= 4) format(ranga,29,"Starter")
	{
	new losowy = random(30);
	cod_set_user_xp(id, exp+losowy);
	ColorChat(id, GREEN, "^x01Gives %i ^x01EXP for rank %s", losowy, ranga);
	}

    set_hudmessage(255, 255, 255, 0.15, 0.55)
    show_hudmessage(id, "Frags: %d^nRank: %s",stats[0], ranga)
}  
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ ansicpg1250\\ deff0\\ deflang1045{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ f0\\ fs16 \n\\ par }
*/
Somebody can help me? If u don't understand my english just ask.. I will try to clarify...
Forever Killer is offline
 



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:27.


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