Well everything else but the actual thing works. Instead of recieving a message it just recieves a blank message.
Code:
#include <amxmodx>
#include <amxmisc>
#define PLUGIN "Zombie Mod Includes"
#define VERSION "1.0 Final"
#define AUTHOR "Minimum"
// Hud Variables
new hudmsg1[64][128] // Hud Row 1 Information
new hudmsg2[64][128] // Hud Row 2 Information
new hudmsg3[64][128] // Hud Row 3 Information
new hudmsg4[64][128] // Hud Row 4 Information
public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)
// Cvars
register_cvar("zombie_statushud","Zombie Mod Console - 0.1.2 Final")
// Tasks
set_task(0.5,"zombiemodconsole",0,"",0,"b") // Zombie Mod Console
}
/*
Register Fake Natives
*/
public plugin_natives() {
register_library("gab_zombie")
register_native("hud_display","hud_redir",1)
server_print("Natives Called")
}
/*
Client Join Server Code
*/
public client_putinserver(id) {
format(hudmsg1[id],127,"Welcome to Gabion Studios Undead Zone.")
format(hudmsg2[id],127,"Say /motd for more info on this plugin.")
set_task(1.0,"userdrop",id)
return PLUGIN_HANDLED
}
/*
Client Disconnect Code (Since client_disconnect doesn't seem to work)
*/
public userdrop(id) {
if(!is_user_connected(id)) {
format(hudmsg1[id],127," ")
format(hudmsg2[id],127," ")
format(hudmsg3[id],127," ")
format(hudmsg4[id],127," ")
return PLUGIN_HANDLED
}
set_task(1.0,"userdrop",id)
return PLUGIN_HANDLED
}
/*
Hud Write Code
*/
public hud_print(id,message[]) {
if(id == 0) {
new x, players[32]
get_players(players,x)
for( new i = 0; i < x; i++ ) {
new playerindex = players[i]
format(hudmsg4[playerindex],127,"%s",hudmsg3[playerindex])
format(hudmsg3[playerindex],127,"%s",hudmsg2[playerindex])
format(hudmsg2[playerindex],127,"%s",hudmsg1[playerindex])
format(hudmsg1[playerindex],127,"%s",message)
}
return PLUGIN_HANDLED
}
format(hudmsg4[id],127,"%s",hudmsg3[id])
format(hudmsg3[id],127,"%s",hudmsg2[id])
format(hudmsg2[id],127,"%s",hudmsg1[id])
format(hudmsg1[id],127,"%s",message)
return PLUGIN_HANDLED
}
/*
Hud Native Redirect
*/
public hud_redir(id,message[]) {
hud_print(id,message)
return PLUGIN_HANDLED
}
/*
Hud Console Code
*/
public zombiemodconsole(id) {
new authid[32], num, players[32]
get_players(players,num)
for( new i = 0; i < num; i++ ) {
get_user_authid( players[i], authid, 31)
if(equali(authid,"BOT") || equali(authid,"UNKNOWN")) return PLUGIN_HANDLED
// Status Console
new sc_outputstat[128], playerindex
get_user_authid( players[i], authid, 31)
get_cvar_string("zombie_statushud",sc_outputstat,127)
set_hudmessage(0, 200, 0, 0.0, 0.65,0,0.0,99.9,0.0,0.0,2)
playerindex = players[i]
show_hudmessage( players[i], " %s ^n --- ^n %s ^n %s ^n %s ^n %s",sc_outputstat,hudmsg1[playerindex],hudmsg2[playerindex],hudmsg3[playerindex],hudmsg4[playerindex])
}
return PLUGIN_HANDLED
}