AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   XP Mode problem. (https://forums.alliedmods.net/showthread.php?t=171837)

Napoleon_be 11-11-2011 11:52

XP Mode problem.
 
Hi everyone,

I'm creating a Knife XP Mod for my knife server but i have a problem.
Everytime someone kills me or i kill someone or i just die, i get a weird output wich is "[XP] You received 159294563 points for a kill!". While receiving this message, i'm not getting any points + the output is wrong because i set the points to 8 for a kill. Could someone help me?

PHP Code:

public eDeath() {
    new 
iKiller read_data(1)
    new 
headshot read_data(3)
    
    if(
headshot) {
        
iPlayerXP[iKiller] += get_pcvar_num(iKillHSXP)
        
ColorChat(iKillerGREEN"%s^x01 You received^x03 %d^x01 XP Points for a Headshot!"iPrefixiKillHSXP)
    }
    
    
iPlayerXP[iKiller] += get_pcvar_num(iKillXP)
    
ColorChat(iKillerGREEN"%s^x01 You received^x03 %d^x01 XP Points for a Kill!"iPrefixiKillXP)
    
    
SaveData(iKiller)


PHP Code:

register_event("DeathMsg""eDeath""a"


kotinha 11-11-2011 15:43

Re: XP Mode problem.
 
In client_print() you're using the cvar pointer instead of the cvar value...

Napoleon_be 11-11-2011 15:48

Re: XP Mode problem.
 
How should i fix this then?

Devil259 11-11-2011 19:48

Re: XP Mode problem.
 
Code:
ColorChat(iKiller, GREEN, "%s^x01 You received^x03 %d^x01 XP Points for a Kill!", iPrefix, iKillXP)

->

Code:
ColorChat(iKiller, GREEN, "%s^x01 You received^x03 %d^x01 XP Points for a Kill!", iPrefix, get_pcvar_num( iKillXP ))


All times are GMT -4. The time now is 14:20.

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