Hi, am new to AMX coding, and i need some help with my plugin, i have been working on it all day, and i need to to bring a sprite onto the screen (covering the player) once the player tyeps the command in the console, now my problem is that when i get in game, i type the command in the console and it gives me an error
Code:
L 04/09/2005 - 21:55:39: [AMXX] Native error in "precache_model" on line 20 (file "ssjtransform.sma")
and am not sure how to fix it, here is my plugin code
Code:
#include <amxmodx>
#include <fun>
new PLUGIN[]="ssjtransform"
new AUTHOR[]="PvtHudson"
new VERSION[]="1.00"
public plugin_init()
{
register_clcmd("amx_ssjtrans","spawn_sprite")
register_plugin(PLUGIN, VERSION, AUTHOR)
return PLUGIN_CONTINUE
}
new theSprite;
public spawn_sprite(id){
theSprite = precache_model("sprites/trans.spr");
}
public myfunction(id) {
new spriteorigin[3];
get_user_origin(id,spriteorigin);
message_begin(MSG_BROADCAST,SVC_TEMPENTITY);
write_byte(17);
write_coord(spriteorigin[0]);
write_coord(spriteorigin[1]);
write_coord(spriteorigin[2]);
write_short(theSprite);
write_byte(20);
write_byte(200);
message_end();
}
public plugin_precache()
{
return PLUGIN_CONTINUE
}
now im going to guess theres alot wrong with my code, i have been looking in this forum for about 2 hours for help and snippets that might help me with my code.
can any one correct my code for me?
thanks
Pvthudson/Sephiroth_nightmare