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