Raised This Month: $12 Target: $400
 3% 

TE_BEAMENTS problem


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
r4ndomz
Senior Member
Join Date: Jul 2009
Location: The Hood
Old 12-07-2010 , 19:51   TE_BEAMENTS problem
Reply With Quote #1

Id like to call the message TE_BEAMENTS, but when i added the code and compiled, i get an error about the sprite i used.


Top of plugin
PHP Code:
new const gszSpriteLightning[] = "sprites/lgtning.spr" 
plugin_precache
PHP Code:
precache_model(gszSpriteLightning); 
Event_PlayerDamage
PHP Code:
            message_begin(MSG_BROADCASTSVC_TEMPENTITY//message begin
            
write_byte(TE_BEAMENTS)
            
write_short(iAttacker// start entity
            
write_short(iVictim// end entity
            
write_short(gszSpriteLightning// sprite index
            
write_byte(1// starting frame
            
write_byte(1// frame rate in 0.1's
            
write_byte(10// life in 0.1's
            
write_byte(50// line width in 0.1's
            
write_byte(5// noise amplitude in 0.01's
            
write_byte(255// Red
            
write_byte(0// Green
            
write_byte(0// Blue
            
write_byte(100// brightness
            
write_byte(0// scroll speed in 0.1's
            
message_end() 

Quote:
//AMXXPC compile.exe
// by the AMX Mod X Dev Team


//// Salvation.sma
// C:\Documents and Settings\r4ndom\Desktop\USB\compiler1\Salvati on.sma(607) : e
rror 035: argument type mismatch (argument 1)
// C:\Documents and Settings\r4ndom\Desktop\USB\compiler1\Salvati on.sma(1264) :
warning 203: symbol is never used: "gPlayerBinds"
// C:\Documents and Settings\r4ndom\Desktop\USB\compiler1\Salvati on.sma(1264) :
warning 203: symbol is never used: "gStunCircleAmount"
//
// 1 Error.
// Could not locate output file C:\Documents and Settings\r4ndom\Desktop\USB\com
piler1\compiled\Salvation.amx (compile failed).
//
// Compilation Time: 0.61 sec
// ----------------------------------------

Press enter to exit ...
Ignore the warnings, i know why they are there.
__________________
HideNSeek bug fixed here:http://forums.alliedmods.net/showpos...&postcount=951

PM me if you want a nice HideNSeek shop
NEED PLUGIN TESTERS PM ME
r4ndomz is offline
Send a message via Skype™ to r4ndomz
Emp`
AMX Mod X Plugin Approver
Join Date: Aug 2005
Location: Decapod 10
Old 12-07-2010 , 20:37   Re: TE_BEAMENTS problem
Reply With Quote #2

sprite index is the value returned by precache_model when precaching the sprite.
Emp` is offline
Send a message via AIM to Emp` Send a message via MSN to Emp` Send a message via Yahoo to Emp` Send a message via Skype™ to Emp`
r4ndomz
Senior Member
Join Date: Jul 2009
Location: The Hood
Old 12-08-2010 , 07:24   Re: TE_BEAMENTS problem
Reply With Quote #3

Quote:
Originally Posted by Emp` View Post
sprite index is the value returned by precache_model when precaching the sprite.
What should I do then?
__________________
HideNSeek bug fixed here:http://forums.alliedmods.net/showpos...&postcount=951

PM me if you want a nice HideNSeek shop
NEED PLUGIN TESTERS PM ME
r4ndomz is offline
Send a message via Skype™ to r4ndomz
drekes
Veteran Member
Join Date: Jul 2009
Location: Vault 11
Old 12-08-2010 , 07:28   Re: TE_BEAMENTS problem
Reply With Quote #4

PHP Code:
new gszSpriteLightning;

gszSpriteLightning precache_model("sprites/lgtning.spr"); 
__________________

Quote:
Originally Posted by nikhilgupta345 View Post
You're retarded.
drekes is offline
Send a message via MSN to drekes
Emp`
AMX Mod X Plugin Approver
Join Date: Aug 2005
Location: Decapod 10
Old 12-08-2010 , 14:02   Re: TE_BEAMENTS problem
Reply With Quote #5

Quote:
Originally Posted by drekes View Post
PHP Code:
new gszSpriteLightning;

gszSpriteLightning precache_model("sprites/lgtning.spr"); 
If you are going to use that kind of notation, please use it correctly.

It is not a string, so it should be: giSpriteLightning
Emp` is offline
Send a message via AIM to Emp` Send a message via MSN to Emp` Send a message via Yahoo to Emp` Send a message via Skype™ to Emp`
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 12-08-2010 , 15:21   Re: TE_BEAMENTS problem
Reply With Quote #6

Quote:
Originally Posted by Emp` View Post
If you are going to use that kind of notation, please use it correctly.

It is not a string, so it should be: giSpriteLightning
I think he was just telling him what to change so it would compile and work properly.
I agree that if hungarian notation is kept then drop the sz and optionally add a notation for it (i, p, etc.).
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
r4ndomz
Senior Member
Join Date: Jul 2009
Location: The Hood
Old 12-08-2010 , 16:01   Re: TE_BEAMENTS problem
Reply With Quote #7

Quote:
Originally Posted by drekes View Post
PHP Code:
new gszSpriteLightning;

gszSpriteLightning precache_model("sprites/lgtning.spr"); 
I used emit_sound with the sounds im using, and i have no problems. Is it different with sounds and sprites?
__________________
HideNSeek bug fixed here:http://forums.alliedmods.net/showpos...&postcount=951

PM me if you want a nice HideNSeek shop
NEED PLUGIN TESTERS PM ME
r4ndomz is offline
Send a message via Skype™ to r4ndomz
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 12-08-2010 , 16:10   Re: TE_BEAMENTS problem
Reply With Quote #8

Quote:
Originally Posted by r4ndomz View Post
I used emit_sound with the sounds im using, and i have no problems. Is it different with sounds and sprites?
Notice that write_short() takes an integer value (short is a specific length of an integer data type) and not an array.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
r4ndomz
Senior Member
Join Date: Jul 2009
Location: The Hood
Old 12-08-2010 , 16:15   Re: TE_BEAMENTS problem
Reply With Quote #9

Quote:
Originally Posted by Exolent[jNr] View Post
Notice that write_short() takes an integer value (short is a specific length of an integer data type) and not an array.
Either way, mine or the way that drekes posted, arent both of them NOT an integer?
__________________
HideNSeek bug fixed here:http://forums.alliedmods.net/showpos...&postcount=951

PM me if you want a nice HideNSeek shop
NEED PLUGIN TESTERS PM ME
r4ndomz is offline
Send a message via Skype™ to r4ndomz
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 12-08-2010 , 16:19   Re: TE_BEAMENTS problem
Reply With Quote #10

The way drekes posted is correct because it uses the sprite index that is returned from precaching the sprite model.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] 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 02:54.


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