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 autoHeal, healAmount;
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)
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(id, healAmount)
client_print(id, print_chat,"You where healed by %i HP", healAmount)
}
else if(!get_pcvar_num(autoHeal))
{
client_print(id, print_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