Raised This Month: $ Target: $400
 0% 

Need help with sprite plugin for TS


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
sephiroth_nightmare
Junior Member
Join Date: Apr 2005
Old 04-09-2005 , 16:57   Need help with sprite plugin for TS
Reply With Quote #1

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
sephiroth_nightmare is offline
XxAvalanchexX
Veteran Member
Join Date: Oct 2004
Location: abort73.com
Old 04-09-2005 , 22:06  
Reply With Quote #2

Change public spawn_sprite to public plugin_precache, and public myfunction to public spawn_sprite
__________________
No longer around. Thanks your support, everyone! As always:
THIS ONES FOR YOU
3000 PTS
XxAvalanchexX is offline
sephiroth_nightmare
Junior Member
Join Date: Apr 2005
Old 04-10-2005 , 05:41  
Reply With Quote #3

thanks for your help

but now that i have replaced them i get 2 errors during compile.

here is the code now

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 plugin_precache(id){    theSprite = precache_model("sprites/trans.spr"); } public spawn_sprite(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 }

the errors i get are these

Code:
symbol already defined "plugin_precache"
and

Code:
function header differs from prototype
is there a way to fix these error?

thanks
sephiroth_nightmare is offline
v3x
Veteran Member
Join Date: Oct 2004
Location: US
Old 04-10-2005 , 05:44  
Reply With Quote #4

Remove
Code:
public plugin_precache() {           return PLUGIN_CONTINUE }

And replace plugin_precache(id) with plugin_precache().
__________________
What am I doing these days? Well, I run my own Rust server. It's heavily modded. If you'd like to join, the ip is 167.114.101.67:28116

I also created a website called Rust Tools. It will calculate and tell you the raw amounts of resources needed to craft items.
v3x is offline
sephiroth_nightmare
Junior Member
Join Date: Apr 2005
Old 04-10-2005 , 06:55  
Reply With Quote #5

thanks it works now.

thanks for all your help.

i have one more question tho

remeber in team fortress when you saw a concussion granade explode and it had that like push out effect?

how would i be able to make that effect play once my sprite has finished playing.

so it would be like

sprite starts playing
sprite finishs playing
push out effect start


i hope you understand what i mean

thanks

*edit*

i also want the player to be frozen whilst this stuff is happening, and once its over the player can move again.
Also how can i get a sound to play when the sprite starts, and make it stop when the sprite stops?

thanks
sephiroth_nightmare is offline
sephiroth_nightmare
Junior Member
Join Date: Apr 2005
Old 04-11-2005 , 11:21  
Reply With Quote #6

*bump*

cany anyone help me with my above post? any help will be greatful

thanks
sephiroth_nightmare is offline
XxAvalanchexX
Veteran Member
Join Date: Oct 2004
Location: abort73.com
Old 04-11-2005 , 16:51  
Reply With Quote #7

Push out effect? Is it like a shockwave?
__________________
No longer around. Thanks your support, everyone! As always:
THIS ONES FOR YOU
3000 PTS
XxAvalanchexX is offline
Anpheus
Senior Member
Join Date: Aug 2004
Old 04-12-2005 , 08:13  
Reply With Quote #8

To do that, you need Fun With Vectors!

Still want to?
Anpheus is offline
sephiroth_nightmare
Junior Member
Join Date: Apr 2005
Old 04-12-2005 , 10:14  
Reply With Quote #9

Quote:
Originally Posted by XxAvalanchexX
Push out effect? Is it like a shockwave?
yea like a shockwave effect
sephiroth_nightmare is offline
XxAvalanchexX
Veteran Member
Join Date: Oct 2004
Location: abort73.com
Old 04-12-2005 , 15:33  
Reply With Quote #10

Code:
 #define TE_BEAMCYLINDER 21 // cylinder that expands to max radius over lifetime  // coord coord coord (center position)  // coord coord coord (axis and radius)  // short (sprite index)  // byte (starting frame)  // byte (frame rate in 0.1's)  // byte (life in 0.1's)  // byte (line width in 0.1's)  // byte (noise amplitude in 0.01's)  // byte,byte,byte (color)  // byte (brightness)  // byte (scroll speed in 0.1's)  new shockwave_sprite; public plugin_precache() {    shockwave_sprite = precache_model("sprites/shockwave.spr"); } public function(id) {    new origin[3];    get_user_origin(id,origin);    // beams of light!    message_begin(MSG_PAS,SVC_TEMPENTITY,origin);    write_byte(TE_BEAMCYLINDER);    write_coord(origin[0]); // start X    write_coord(origin[1]); // start Y    write_coord(origin[2] - 16); // start Z    write_coord(origin[0]); // something X    write_coord(origin[1]); // something Y    write_coord(origin[2] - 16 + 50); // something Z    write_short(shockwave_sprite); // sprite    write_byte(0); // startframe    write_byte(0); // framerate    write_byte(10); // life    write_byte(60); // width    write_byte(0); // noise    write_byte(255); // red    write_byte(255); // green    write_byte(255); // blue    write_byte(255); // brightness    write_byte(0); // speed    message_end(); }
__________________
No longer around. Thanks your support, everyone! As always:
THIS ONES FOR YOU
3000 PTS
XxAvalanchexX is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 09:53.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode