If it is at all possible could some body help me convert this plugin of mine to amxx or help me convert it
Code:
/* AMX Mod script.
*
* (c) 2003, AZZ KICKER with *LOTS* of help from Assault
* This file is provided as is (no warranties).
* Client Command-
* say - godme, /godme
* say - who, /who
*/
#include <amxmod>
#include <amxmisc>
#define MSG_OFF 0
#define MSG_DEAD 1
#define MSG_LATER 2
#define MSG_BUSY 3
#define MSG_ENABLED 4
#define MSG_DISABLED 5
#define GODLIKE_TIME 10.0
new szGodlikeMan[32]
new p_NoGod[32]
new bGamesEnabled = 1
new Tab_szMessage[6][] = {"[AMX] <Godmode Dealer> Admin has disabled godme. Bug him to re-enable it.",
"[AMX] <Godmode Dealer> You can't be GODLIKE, U R DEAD.",
"[AMX] <Godmode Dealer> Try later. You have been GODLIKE, give someone else a chance.",
"[AMX] <Godmode Dealer> I'm busy with someone else, please wait.",
"[AMX] Admin has triggered Godmode, Godmode is now Enabled",
"[AMX] Admin has triggered Godmode, Godmode is now Disabled"}
public admin_godme(id,level,cid)
{
if ( !cmd_access(id,level,cid,1) )
{
return PLUGIN_HANDLED
}
if (read_argc() < 2 )
{
client_print(id,print_console,"[AMX] Usage: amx_invisme < on | off > Currently: %s", bGamesEnabled ? "ON" : "OFF")
}
else
{
new arg[12]
read_argv(1,arg,11)
if ( equal(arg,"on", 2) )
{
bGamesEnabled = 1
console_print(id,"[AMX] Godmode is now ON")
client_print(0,print_chat, Tab_szMessage[MSG_ENABLED] )
}
else if ( equal(arg,"off", 3) )
{
bGamesEnabled = 0
console_print(id,"[AMX] Godmode is now OFF")
client_print(0,print_chat, Tab_szMessage[MSG_DISABLED] )
if ( szGodlikeMan[0] != 0 )
{
remove_task(100)
new godlike_id[1]
godlike_id[0] = get_user_index(szGodlikeMan)
times_up(godlike_id)
}
}
else
{
client_print(id,print_console,"[AMX] Usage: amx_invisme < on | off > Currently: %s", bGamesEnabled ? "ON" : "OFF")
}
}
return PLUGIN_HANDLED
}
public godmecmd(id)
{
if ( !is_user_alive(id) && bGamesEnabled )
{
client_print(id,print_chat, Tab_szMessage[MSG_DEAD] )
}
else if ( p_NoGod[id] && bGamesEnabled )
{
client_print(id,print_chat, Tab_szMessage[MSG_LATER] )
}
else if ( szGodlikeMan[0] != 0 && bGamesEnabled )
{
client_print(id,print_chat, Tab_szMessage[MSG_BUSY] )
}
else if ( bGamesEnabled )
{
godilize(id)
}
else
{
client_print(id,print_chat, Tab_szMessage[MSG_OFF] )
}
}
public HandleSay(id)
{
new Speech[255]
read_args(Speech,254)
if ( equali(Speech, "^"godme^"") || equali(Speech, "^"/godme^"") )
{
if ( !is_user_alive(id) && bGamesEnabled )
{
client_print(id,print_chat, Tab_szMessage[MSG_DEAD] )
}
else if ( p_NoGod[id] && bGamesEnabled )
{
client_print(id,print_chat, Tab_szMessage[MSG_LATER] )
}
else if ( szGodlikeMan[0] != 0 && bGamesEnabled )
{
client_print(id,print_chat, Tab_szMessage[MSG_BUSY] )
}
else if ( bGamesEnabled )
{
godilize(id)
}
else
{
client_print(id,print_chat, Tab_szMessage[MSG_OFF] )
}
}
if ( equali(Speech, "^"who^"") || equali(Speech, "^"/who^"") )
{
WhoIsGODLIKE(id)
}
}
public godilize(id)
{
set_hudmessage(200,100,0, 0.03, 0.62, 2, 0.02, 5.0, 0.01, 0.1, 61)
new Float:delay = get_cvar_float("amx_godmedelay")
if ( delay < GODLIKE_TIME )
{
delay = GODLIKE_TIME
}
get_user_name(id,szGodlikeMan,31)
p_NoGod[id] = 1
set_user_godmode(id,1)
client_print(id,print_chat, "[AMX] <Godmode Dealer> %s, You are now GODLIKE",szGodlikeMan )
show_hudmessage(0,"Beware, %s is GODLIKE now!",szGodlikeMan)
new parm[1]
parm[0] = id
set_task(GODLIKE_TIME,"times_up",100,parm,1)
set_task(delay,"ResetGodmeUse",101,parm,1)
}
public Player_Died(id)
{
new szPlayername[32]
get_user_name(id,szPlayername,31)
console_print(0,"[GODME] GODLIKE Name : %s Dead Player Name %s Match : %s",szGodlikeMan,szPlayername,equali(szGodlikeMan,szPlayername) ? "YES" : "NO")
if ( equali(szPlayername,szGodlikeMan) )
{
new parm[1]
parm[0] = id
console_print(0,"[GODME] id = %d",parm[0])
get_user_name(id,szPlayername,31)
console_print(0,"[GODME] Which is %s",szPlayername)
times_up(parm)
remove_task(100)
}
}
public ResetGodmeUse(id[])
{
p_NoGod[id[0]] = 0
if ( bGamesEnabled )
{
client_print(id[0],print_chat,"[AMX] <Godmode Dealer> Cooldown Period Ended, You May Be GODLIKE Again")
}
}
public times_up(id[])
{
set_hudmessage(200,100,0, 0.03, 0.62, 2, 0.02, 5.0, 0.01, 0.1, 62)
set_user_godmode(id[0])
client_print(id[0],print_chat, "[AMX] <Godmode Dealer> %s, You are no longer GODLIKE",szGodlikeMan )
show_hudmessage(0,"[AMX] <Godmode Dealer> %s is no longer GODLIKE, who's next ?",szGodlikeMan)
szGodlikeMan[0] = 0
}
public WhoIsGODLIKE(id)
{
if ( szGodlikeMan[0] != 0 )
{
client_print(id,print_chat,"[AMX] <Godmode Dealer> %s is GODLIKE, watch out !", szGodlikeMan)
}
else
{
client_print(id,print_chat,"[AMX] <Godmode Dealer> No one is GODLIKE right now")
}
}
public client_infochanged(id)
{
if ( szGodlikeMan[0] != 0 )
{
new godlike_id = get_user_index(szGodlikeMan)
if ( !godlike_id )
{
new szPlayername[32]
get_user_name(id,szPlayername,31)
szGodlikeMan = szPlayername
}
}
}
public plugin_init()
{
register_plugin("Godme","1.0","AZZ KICKER")
register_cvar("amx_godmedelay", "250")
register_event("DeathMsg","Player_Died", "b")
register_clcmd("amx_godme", "admin_godme", ADMIN_LEVEL_H, "<on|off>: Turns godme on or off.")
register_clcmd("say", "HandleSay")
register_clcmd("team_say", "HandleSay")
register_clcmd("godme", "godmecmd")
register_clcmd("godmeinfo","godmeinfo",-1,"Godme plugin info")
}