Raised This Month: $ Target: $400
 0% 

Spawn event/hamsandwich.inc error!


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Simpler
Junior Member
Join Date: May 2009
Location: Sweden
Old 05-21-2009 , 15:48   Spawn event/hamsandwich.inc error!
Reply With Quote #1

Hi there,
I just started learning some basic scripting and i wanted to catch the spawn event. First i registered the "ResetHud" event but the plugin didn't work, nothing happened on spawn,, see source code:

PHP Code:
/* Script generated by Pawn Studio */

#include <hamsandwich>
#include <amxmodx>
#include <amxmisc>
#include <fun>

#define PLUGIN    "New Plugin"
#define AUTHOR    "Unknown"
#define VERSION    "1.0"

new autoHealhealAmount;

public 
plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
autoHeal register_cvar("amx_autoheal""1")
    
healAmount register_cvar("amx_healamount""40000")
    
    
register_event("ResetHud""PlayerSpawn""b")
    
//RegisterHam(Ham_Spawn, "player", "fwHamPlayerSpawnPost", 1)
}

public 
PlayerSpawn()
{
    if (
get_pcvar_num(autoHeal))
    {
        
set_user_health(idhealAmount)
        
        
client_print(idprint_chat,"You where healed by %i HP"healAmount)
    }
    
    else  if(!
get_pcvar_num(autoHeal))
    {
        
client_print(idprint_chat"Erorr!")
    }

If you see why it doesn't work please tell me, i really need to know what i do wrong. But i got another error that seems more confusing. I tried the hamsandwich version of catching the spawn event, but then i got errors again but those where from the hamsandwich.inc file. They were as following:

Quote:
Welcome to the AMX Mod X 1.8.1-300 Compiler.
Copyright (c) 1997-2006 ITB CompuPhase, AMX Mod X Team

C:\Program Files\AMX Mod X\files\base\scripting\include\hamsandwich.in c(47) : error 017: undefined symbol "AMXX_VERSION_NUM"
C:\Program Files\AMX Mod X\files\base\scripting\include\hamsandwich.in c(361) : error 017: undefined symbol "get_func_id"
C:\Program Files\AMX Mod X\files\base\scripting\include\hamsandwich.in c(361) : warning 215: expression has no effect
C:\Program Files\AMX Mod X\files\base\scripting\include\hamsandwich.in c(361) : warning 215: expression has no effect
C:\Program Files\AMX Mod X\files\base\scripting\include\hamsandwich.in c(361) : error 001: expected token: ";", but found ")"
C:\Program Files\AMX Mod X\files\base\scripting\include\hamsandwich.in c(361) : error 029: invalid expression, assumed zero
C:\Program Files\AMX Mod X\files\base\scripting\include\hamsandwich.in c(361) : fatal error 107: too many error messages on one line

Compilation aborted.
5 Errors.
Could not locate output file C:\Users\bRAVE\Desktop\Pawn Studio\Script Sma\autoHeal.amx (compile failed).

Compilation Time: 0,09 sec
That seems weird in my opinion, you got an idea why i get errors from the include file? Is it outdated or what can it be?

I'd really appreciate help!
/Simpler
Simpler is offline
Send a message via MSN to Simpler
 



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 01:34.


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