L 05/14/2004 - 04:50:51: [AMXX] Run time error 22 on line 0 (plugin "spawnprotection.amx")
and here is the code... im guessing i screwed it up when trying to make it 5 seconds
Code:
/* Credits : Thanks to Xeroblood , JJkiller and KingPin for helping
* making this plugin.
*
* Installing : Download .SMA to Scripting folder , run compiler , copy the
* file from Compiled folder and paste in Plugins folder , add the plugin name
* in the Amxx plugins.ini ie) : spawnprotection.amx.
*
* Use : After you install it , join the game and type this in the console :
* Amx_god 1 and a message like this , "SPAWN PROTECTION IS ENABLED" will
* appear in read in the middle of the screen for ten seconds giving all
* players godmode.
*/
#define GOD_TIME 5.0
#include <amxmodx>
#include <fun>
public plugin_init()
{
register_plugin("Spawn Protection","0.1","Peli")
register_cvar("amx_god","1")
register_event("ResetHUD","god_on","b")
}
public god_on()
{
if (!(get_cvar_num("amx_god") == 1))
return PLUGIN_HANDLED
new players[32], numberofplayers
get_players(players,numberofplayers)
for (new i=1;i<=numberofplayers;i++)
set_user_godmode(i,1)
set_hudmessage( 255, 0, 0, -1.0, -1.0, 0, 6.0, 10.0, 0.5, 1.5, 4 )
show_hudmessage(0, "SPAWN PROTECTION IS ENABLED")
set_task(5.0,"god_off")
return PLUGIN_HANDLED
}
public god_off(id)
{
new players[32], numberofplayers
get_players(players,numberofplayers)
for (new i=1;i<=numberofplayers;i++)
set_user_godmode(i,0)
return PLUGIN_CONTINUE
}