|
Author
|
Message
|
|
Junior Member
|

12-05-2014
, 15:39
Re: [HELP] How to do that once an added exp
|
#1
|
Quote:
Originally Posted by zmd94
Just try below. ;)
PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <colorchat>
#include <codmod>
#include <csx>
#define TASK_RESET 1666
new iPosition[33]
public plugin_init()
{
register_plugin("", "1.0", "")
register_event("DeathMsg", "event_DeathMsg", "a", "1>0")
}
public client_putinserver(id)
{
if(is_user_connected(id) && !is_user_bot(id))
{
set_task(1.0, "iHud", id+TASK_RESET, _, _, "b")
}
}
public client_disconnect(id)
{
remove_task(id+TASK_RESET)
}
public iHud(id)
{
id -= TASK_RESET
if(is_user_alive(id))
{
static iStats[8], iBody[8]
get_user_stats(id, iStats, iBody)
set_hudmessage(255, 255, 255, 0.15, 0.55)
show_hudmessage(id, "Frags: %d^nPosition: %s", iStats[0], iPosition)
}
}
public event_DeathMsg()
{
new iAttac; iAttac = read_data(1)
new iVictim; iVictim = read_data(2)
if(iVictim == Attac || !is_user_alive(Attac))
return
static iStats[8], iBody[8]
get_user_stats(Attac, iStats, iBody)
new iEXP = cod_get_user_xp(Attac)
new iFree = random_num(1, 30)
switch(iStats[0])
{
// If the player has 2 frags. If you want to configure to 6, just change
// number 2 to 6 and so on. ;)
case 2:
{
// Configure the position
format(iPosition, charsmax(iPosition), "Elo")
// Free EXP
cod_set_user_xp(Attac, iEXP + iFree);
// Print the message
ColorChat(Attac, GREEN, "^x01Free %i ^x01EXP for position %s", iFree, iPosition)
}
// If the player has 4 frags.
case 4:
{
format(iPosition, charsmax(iPosition), "Starter")
// Just continue. ;)
}
// Just continue. ;)
}
}
|
Code:
abec.sma(49) : error 017: undefined symbol "Attac"
abec.sma(53) : error 017: undefined symbol "Attac"
abec.sma(53) : warning 215: expression has no effect
abec.sma(53) : warning 215: expression has no effect
abec.sma(53) : error 001: expected token: ";", but found ")"
abec.sma(53) : error 029: invalid expression, assumed zero
abec.sma(53) : fatal error 107: too many error messages on one line
Many errors.. : /. Not compiled..
|
|
|
|