Raised This Month: $ Target: $400
 0% 

Script Problem need help fast!


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
glorian
BANNED
Join Date: Mar 2009
Location: Surfplace.se
Old 08-10-2009 , 18:02   Script Problem need help fast!
Reply With Quote #1

Hello i am working on a new XP Mod to hide n seek and i get those error when i compile.

[IMG]http://img37.**************/img37/7066/hnsxpmod.jpg[/IMG]

And here is my .SMA
Attached Files
File Type: sma Get Plugin or Get Source (hnsxpmod.sma - 446 views - 5.8 KB)
glorian is offline
Send a message via MSN to glorian
joaquimandrade
Veteran Member
Join Date: Dec 2008
Location: Portugal
Old 08-10-2009 , 18:04   Re: Script Problem need help fast!
Reply With Quote #2

If you get errors at compile you shouldn't be making mod's.
__________________
joaquimandrade is offline
glorian
BANNED
Join Date: Mar 2009
Location: Surfplace.se
Old 08-10-2009 , 18:05   Re: Script Problem need help fast!
Reply With Quote #3

Please help
glorian is offline
Send a message via MSN to glorian
xPaw
Retired AMX Mod X Moderator
Join Date: Jul 2008
Old 08-10-2009 , 18:09   Re: Script Problem need help fast!
Reply With Quote #4

register_plugin(hnsxpmod, 1.0, Glorian)

This line have errors, fix them and it will work.

EDIT: Hm no it wont, Mmmm learn basics of coding, then start making mods.
__________________
xPaw is offline
One
Veteran Member
Join Date: Oct 2008
Location: Hardstyle-eSports.de
Old 08-10-2009 , 18:14   Re: Script Problem need help fast!
Reply With Quote #5

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

#define CLASS_NOTHING 0
#define CLASS_Hegrenade 1
#define CLASS_Flashbang 2
#define CLASS_Smoke 3
#define CLASS_Deagle 5
#define MAXCLASSES 5
new msgtext
new PlayerClass[33]
new 
PlayerXP[33]
new 
PlayerLevel[33]
new const 
LEVELS[6] =      {
        
400,
        
400,
        
600,
        
1200,
        
3200,
        
4000
        
}
        new const 
CLASSES[MAXCLASSES] [] = {
        
"None",
        
"Hegrenade",
        
"Flashbang",
        
"Smoke",
        
"Deagle"    
    
}
public 
plugin_init() {
    
register_plugin("hnsxpmod""1.0""Glorian")
    
    
register_cvar("sv_hnsxpmod""1")
    
register_event("DeathMsg""DeathMsg""a")
    
register_cvar("xp_per_kill""30")
    
register_cvar("SaveXP""1")
    
register_menucmd(register_menuid("menu_ChooseClass"),1023,"DoChoosehnsxpmod");
    
register_event("ResetHUD""ResetHud""b")
    
msgtext get_user_msgid("StatusText")
    
register_clcmd("say /changeclass""ChangeClass")
    
register_clcmd("say_team /changeclass""ChangeClass")
    

    

         
}

public 
SaveXP(id)
{
    new 
authid[32];
    
    
get_user_authid(id,authid,31);
    
    new 
vaultkey[64], vaultdata[64];
    
    
format(vaultkey,63,"HNSXPMOD-%s-class",authid);
    
format(vaultdata,63,"%d",PlayerClass[id]);
    
set_vaultdata(vaultkey,vaultdata);
    
    
format(vaultkey,63,"HNSXPMOD-%s-xp",authid);
    
format(vaultkey,63,"%d",PlayerXP[id]);
    
set_vaultdata(vaultkey,vaultdata);
    
    
format(vaultkey,63,"HNSXPMOD-%s-level",authid);
    
format(vaultkey,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,"HNSXPMOD-%s-class",authid);
    
get_vaultdata(vaultkey,vaultdata,63);
    
PlayerClass[id] = str_to_num(vaultdata);
    
    
format(vaultkey,63,"HNSXPMOD-%s-xp",authid);
    
get_vaultdata(vaultkey,vaultdata,63);
    
PlayerXP[id] = str_to_num(vaultdata);
    
    
format(vaultkey,63,"HNSXPMOD-%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"[HNSXPMOD] XP Loaded!")
        
client_print(idprint_chat"[HNSXPMOD] You are a %s with level %s and %s XP"PlayerClass[id], PlayerLevel[id], PlayerXP[id])
         }
}

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

stock ChooseHnsxpmod(id)
{
    new 
menu[192]
    
    new 
keys MENU_KEY_0|MENU_KEY_1|MENU_KEY_2|MENU_KEY_3
    
    
    format
(menu191"Hnsxpmod: Choose Hnsxpmod^n^n1. Hegrenade^n2. Flashbang^n3. Smoke^n4")
    
    
show_menu(idkeysmenu, -1"menu_ChooseHnsxpmod")
    
    return 
PLUGIN_CONTINUE
}

public 
DoChooseHnsxpmod(idkey)
{
    
    if(
key == 0
    {
        
        if(
PlayerClass[id] == CLASS_Hegrenade
        {
            
            
client_print(idprint_chat"[HNSXPMOD] You allready got Hegrenade!")
            
            
ChooseHnsxpmod(id)
            
            return 
PLUGIN_HANDLED
        
}
        
        
PlayerClass[id] = CLASS_Hegrenade
             
          
}
      
      
    if(
key == 1) {
         
         if(
PlayerClass[id] == CLASS_Flashbang) {
              
              
client_print(idprint_chat"[HNSXPMOD] You allready got a Flashbang!")
              
ChooseAnimal(id)
              return 
PLUGIN_HANDLED
         
}
                   
         
PlayerClass[id] = CLASS_Flashbang
         client_print
(idprint_chat"[HNSXPMOD] You now got a Flashbang!")
    }
    
    if(
key == 2) {
         
         if(
PlayerClass[id] == CLASS_Smoke) {
              
              
client_print(idprint_chat"[HNSXPMOD] You allready got a Smoke!")
              
ChooseAnimal(id)
              return 
PLUGIN_HANDLED
         
}
                   
         
PlayerClass[id] = CLASS_Smoke
         client_print
(idprint_chat"[HNSXPMOD] You now got a Smoke!")
    }    

    if(
key == 3) {
         
         if(
PlayerClass[id] == CLASS_Deagle) {
              
              
client_print(idprint_chat"[HNSXPMOD] You allready got a Deagle!")
              
ChooseAnimal(id)
              return 
PLUGIN_HANDLED
         
}
         
PlayerClass[id] = CLASS_Deagle
         client_print
(idprint_chat"[HNSXPMOD] You now got a Deagle!")
    }
     
     
    
ShowHUD(id)
    
    return 
PLUGIN_HANDLED
}
public 
ChooseAnimal(id)
{
    
//add here your code
}
public 
ResetHUD(id)
{
    
    if(
get_cvar_num("sv_hnsxpmod") == 0) {
        return 
PLUGIN_HANDLED
        
         
}
     
     
    if(
PlayerClass[id] == CLASS_NOTHING) {
        
        
ChooseHnsxpmod(id)
        return 
PLUGIN_HANDLED
        
         
}
    return 
PLUGIN_HANDLED
}

public 
DeathMsg ()
{
    
    if(
get_cvar_num("sv_hnsxpmod") == 0) {
        return 
PLUGIN_HANDLED
         
}
     
    
    new 
attacker read_data(1)
    
    if(
PlayerClass[attacker] == CLASS_NOTHING) {
        return 
PLUGIN_HANDLED
         
}
     
    if(
PlayerLevel[attacker] == 6) {
        return 
PLUGIN_HANDLED
         
}
     
     
    
PlayerXP[attacker] += get_cvar_num("XP_per_kill")
    
    if(
PlayerXP[attacker] >= LEVELS[PlayerLevel[attacker]]) {
        
        
PlayerLevel[attacker] +=1
        
        client_print
(attackerprint_chat"[HNSXPMOD] Congratulations! You are now level %i!"PlayerLevel[attacker])
        
        if(
get_cvar_num("SaveXP") == 1) {
            
            
SaveXP(attacker)
            
             }
         
         
        
ShowHUD(attacker)
        
         }
     
     
    
ShowHUD(attacker)
     
    return 
PLUGIN_CONTINUE
}

public 
ShowHUD(id)
{
    new 
HUD[51]
    
    
format(HUD50"[%s]Level: %i XP: %i"CLASSES[PlayerClass[id]], PlayerLevel[id], PlayerXP[id])
    
    
message_begin(MSG_ONEmsgtext, {0,0,0}, id)
    
write_byte(0)
    
write_string(HUD)
    
message_end()
    return
}
    
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1053\\ f0\\ fs16 \n\\ par }
*/ 
there was more errors then 100000

he did for example: client_print[

first step : try to learn the constructions
__________________
One is offline
Send a message via ICQ to One Send a message via AIM to One Send a message via MSN to One Send a message via Yahoo to One Send a message via Skype™ to One
glorian
BANNED
Join Date: Mar 2009
Location: Surfplace.se
Old 08-10-2009 , 18:15   Re: Script Problem need help fast!
Reply With Quote #6

Ty man!

EDIT:

I got a error when i start the server and this appear:


L 08/08/2009 - 22:463: Function "DoChoosehnsxpmod" was not found
L 08/08/2009 - 22:463: [AMXX] Displaying debug trace (plugin "hnsxpmod.amxx")
L 08/08/2009 - 22:463: [AMXX] Run time error 19: function not found
L 08/08/2009 - 22:463: [AMXX] [0] hnsxpmod.sma::plugin_init (line 39)

Last edited by glorian; 08-10-2009 at 18:48.
glorian is offline
Send a message via MSN to glorian
Old 08-10-2009, 18:17
crazyeffect
This message has been deleted by crazyeffect. Reason: late
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 08-10-2009 , 21:08   Re: Script Problem need help fast!
Reply With Quote #7

Quote:
Originally Posted by joaquimandrade View Post
If you can't fix the get errors you get at compile you shouldn't be making mod's.
E.g. If you have to post for the simplest of errors (as the case happens to be).
__________________
fysiks 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 02:17.


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