Raised This Month: $ Target: $400
 0% 

[HELP] How to do that once an added exp


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Forever Killer
Junior Member
Join Date: Dec 2014
Old 12-05-2014 , 15:39   Re: [HELP] How to do that once an added exp
Reply With Quote #1

Quote:
Originally Posted by zmd94 View Post
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(idiStatsiBody)

        
set_hudmessage(2552552550.150.55)
        
show_hudmessage(id"Frags: %d^nPosition: %s"iStats[0], iPosition)
    }
}  

public 
event_DeathMsg()
{
    new 
iAttaciAttac read_data(1)
    new 
iVictimiVictim read_data(2)
    
    if(
iVictim == Attac || !is_user_alive(Attac))
        return
    
    static 
iStats[8], iBody[8]
    
get_user_stats(AttaciStatsiBody)
    
    new 
iEXP cod_get_user_xp(Attac)
    new 
iFree random_num(130)
    
    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(iPositioncharsmax(iPosition), "Elo")
            
            
// Free EXP
            
cod_set_user_xp(AttaciEXP iFree);
            
            
// Print the message
            
ColorChat(AttacGREEN"^x01Free %i ^x01EXP for position %s"iFreeiPosition)
        }
        
// If the player has 4 frags.
        
case 4:
        {
            
format(iPositioncharsmax(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..
Forever Killer 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:27.


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