Raised This Month: $ Target: $400
 0% 

Plugin not compiling


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
SaM.ThE.MaN
Senior Member
Join Date: Jan 2010
Old 05-21-2010 , 15:50   Plugin not compiling
Reply With Quote #1

Hi,
I have completely rewritten this plugin , the plugin works and each time i lvl up it says congratulations for lvling up , but when i type /me for it to show me my lvl and XP , it says :
[Leveler] You are level and XP
Here is the code:

PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <vault>
#include <core>
#include <fun>

#define PLUGIN "Level Plugin"
#define VERSION "0.1"
#define AUTHOR "SaMThEMaN"

new PlayerXP[33]
new 
PlayerLevel[33]

new const 
LEVELS[6] = 
{
    
1
    
2
    
4
    
8,
    
16,
    
32
}

new 
msgtext

public plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
register_cvar("sv_Leveler""1")
    
register_event("DeathMsg""DeathMsg""a"
    
register_clcmd("say /me""Level")
    
register_clcmd("say_team /me""Level")
    
register_cvar("XP_per_kill""1")
}

public 
Level(id)
{
client_print(idprint_chat"[Leveler] You are level %d and %d XP"PlayerLevel[id], PlayerXP[id])
}

public 
SaveXP(id)
{
    new 
authid[32]; 
    
get_user_authid(id,authid,31); 

    new 
vaultkey[64], vaultdata[64]; 

    
format(vaultkey,63,"Plvl-%s-xp",authid); 
    
format(vaultdata,63,"%d",PlayerXP[id]); 
    
set_vaultdata(vaultkey,vaultdata); 

    
format(vaultkey,63,"Plvl-%s-level",authid); 
    
format(vaultdata,63,"%d",PlayerLevel[id]); 
    
set_vaultdata(vaultkey,vaultdata);


public 
LoadXP(id)
{
    new 
authid[32]; 
    
get_user_authid(id,authid,31); 

    new 
vaultkey[64], vaultdata[64];

    
format(vaultkey,63,"Plvl-%s-xp",authid); 
    
get_vaultdata(vaultkey,vaultdata,63); 
    
PlayerXP[id] = str_to_num(vaultdata);   

    
format(vaultkey,63,"Plvl-%s-level",authid); 
    
get_vaultdata(vaultkey,vaultdata,63);
    
PlayerLevel[id] = str_to_num(vaultdata);  


public 
client_connect(id)
{
    if(
get_cvar_num("SaveXP") == 1) {
       
         
LoadXP(id)

         
client_print(idprint_chat"[Leveler] XP Loaded!")
         
client_print(idprint_chat"[Leveler] You are level %d and %d XP"PlayerLevel[id], PlayerXP[id])
    }
}

public 
client_disconnect(id)
{
    if(
get_cvar_num("SaveXP") == 1) {
    
         
SaveXP(id)
    }
}

public 
DeathMsg()
{
if(
get_cvar_num("sv_Leveler") == 0
{
return 
PLUGIN_HANDLED
}
    new 
attacker read_data(1)

    
PlayerXP[attacker] += get_cvar_num("XP_per_kill")

    if(
PlayerXP[attacker] >= LEVELS[PlayerLevel[attacker]]) {
    
PlayerLevel[attacker] += 1

    client_print
(attackerprint_chat"[Leveler] Congratulations! You are now level %d!"PlayerLevel[attacker])
    if(
get_cvar_num("SaveXP") == 1) {
 
             
SaveXP(attacker)
         }
 }  
    return 
PLUGIN_CONTINUE


Last edited by SaM.ThE.MaN; 05-22-2010 at 04:35.
SaM.ThE.MaN is offline
wrecked_
Veteran Member
Join Date: Jan 2010
Location: New York (GMT-5)
Old 05-21-2010 , 15:52   Re: Plugin not compiling
Reply With Quote #2

You didn't completely rewrite it... that's the tutorial without the animal names or whatever.

Post the errors.
__________________
[ Paid Requests ]
DO NOT PM ME ABOUT BLOCKMAKER
NO PRIVATE SUPPORT
wrecked_ is offline
Brreaker
Senior Member
Join Date: Oct 2009
Location: Constanta, Romania
Old 05-21-2010 , 16:04   Re: Plugin not compiling
Reply With Quote #3

http://forums.alliedmods.net/showpos...65&postcount=7

You could read this although...
__________________
There are 10 kinds of people.Those who understand binary, and those who don't.
Also, for those who understand binary, there is a donation tab too!
No steam || PM support!
Brreaker is offline
Send a message via MSN to Brreaker Send a message via Yahoo to Brreaker
wrecked_
Veteran Member
Join Date: Jan 2010
Location: New York (GMT-5)
Old 05-21-2010 , 16:18   Re: Plugin not compiling
Reply With Quote #4

Quote:
Originally Posted by Brreaker View Post
You didn't fix all of his issues. You forgot about fixing the health on spawn, PlayerClass, the useless class name const, ...
__________________
[ Paid Requests ]
DO NOT PM ME ABOUT BLOCKMAKER
NO PRIVATE SUPPORT
wrecked_ is offline
Brreaker
Senior Member
Join Date: Oct 2009
Location: Constanta, Romania
Old 05-21-2010 , 16:34   Re: Plugin not compiling
Reply With Quote #5

I know, it's not 100% fixed, but I think it's better than the original version...-,-
__________________
There are 10 kinds of people.Those who understand binary, and those who don't.
Also, for those who understand binary, there is a donation tab too!
No steam || PM support!
Brreaker is offline
Send a message via MSN to Brreaker Send a message via Yahoo to Brreaker
SaM.ThE.MaN
Senior Member
Join Date: Jan 2010
Old 05-21-2010 , 16:57   Re: Plugin not compiling
Reply With Quote #6

I fixed it and it works but i still have one problem, i have written it in my first post,
wreked i had another script before , now i made this one , which means i completely change it , u can even take a look.

Last edited by SaM.ThE.MaN; 05-21-2010 at 16:59.
SaM.ThE.MaN is offline
SaM.ThE.MaN
Senior Member
Join Date: Jan 2010
Old 05-21-2010 , 17:01   Re: Plugin not compiling
Reply With Quote #7

ok ill go hit the bet, cya guys tomorrow , help me fix it and the saving thing , it doesnt save and load lol . or perhaps it works only on servers.
SaM.ThE.MaN is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 05-21-2010 , 20:19   Re: Plugin not compiling
Reply With Quote #8

Learn to use proper % when formatting.
http://www.amxmodx.org/funcwiki.php?go=func&id=49
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
SaM.ThE.MaN
Senior Member
Join Date: Jan 2010
Old 05-22-2010 , 03:30   Re: Plugin not compiling
Reply With Quote #9

Ok its working but , it doesnt save or load, by the way can i release this?

Last edited by SaM.ThE.MaN; 05-22-2010 at 03:42.
SaM.ThE.MaN is offline
SaM.ThE.MaN
Senior Member
Join Date: Jan 2010
Old 05-22-2010 , 07:06   Re: Plugin not compiling
Reply With Quote #10

Ok i got the whole thing fixed ,
I have an issue on the Save and load area :
If i disconnect from the server it saves my score, but , if i close and open the server everything goes away.
So can anyone give me an idea how to save it Permanently and load it.
Thank you

Last edited by SaM.ThE.MaN; 05-22-2010 at 16:09.
SaM.ThE.MaN 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 03:36.


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