Hello alliedmodders.
This time I have tried to do a plugin with the one that shows you an image .tga but when I write /tga the server shutting down:
Fatal Error
Code:
PHP Code:
#define PLUGIN "Mostrando_TGA"
#define VERSION "1.0"
#define AUTHOR "iG_os"
#include <amxmodx>
#define SVC_DIRECTOR 51 // come from util.h
#define DRC_CMD_BANNER 9 // come from hltv.h
#define TGASUM 1
#define is_valid_player(%1) (1 <= %1 <= 32)
new szTga[TGASUM][] ={ "gfx/monsterstereo.tga" }
new bool:Tga[33];
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)
register_clcmd("say /tga", "mostrar_tga")
register_clcmd("say /notga", "nomostrar_tga")
}
public plugin_precache()
{
for (new i=0; i<TGASUM; i++)
precache_generic(szTga[i])
}
public nomostrar_tga(id) Tga[id] = false;
public mostrar_tga(id)
{
Tga[id] = true;
if(is_valid_player(id) && is_user_connected(id) && Tga[id]) {
new index = 1
message_begin( MSG_ONE, SVC_DIRECTOR, _, id )
write_byte( strlen( szTga[index]) + 2 ) // command length in bytes
write_byte( DRC_CMD_BANNER )
write_string( szTga[index] ) // banner file
message_end()
}
}
public client_putinserver(id) Tga[id] = false;
public client_disconnect(id) Tga[id] = false;