Raised This Month: $ Target: $400
 0% 

Problem: with TE_DLIGHT 27


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Stephen
Senior Member
Join Date: Aug 2004
Old 02-28-2006 , 18:38   Problem: with TE_DLIGHT 27
Reply With Quote #1

Code:
public worldlight(id, level, cid)
{
	if(!cmd_access(id,level,cid,5))
        	return PLUGIN_HANDLED

	new user[33], space[1], r[4], g[4], b[4], bright[1], time[1], rate[1]
	read_argv(0, user, 32)

	read_argv(1, space, 1)//RADIUS
	new radius = str_to_num(space)

	read_argv(2, r, 3)//Colors
	read_argv(3, g, 3)
	read_argv(4, b, 3)
	new red = str_to_num(r)
	new green = str_to_num(g)
	new blue = str_to_num(b)

	read_argv(5, bright, 1)//Brightness
	new brightness = str_to_num(bright)

	read_argv(6, time, 1)//LifeTime
	new life = str_to_num(time)

	read_argv(7, rate, 1)//Decayrate
	new decayrate = str_to_num(rate)

	new origin[3]
	get_user_origin(id,origin)
	message_begin(MSG_BROADCAST,SVC_TEMPENTITY, origin)
	write_byte( TE_DLIGHT )
	write_coord( origin[0] ); //coord coord coord (position)
	write_coord( origin[1] );
	write_coord( origin[2] );
	write_byte( radius ) //Radius
	write_byte( red ) //Red
	write_byte( green ) //Green
	write_byte( blue ) //Blue
	write_byte( brightness ) //Brightness
	write_byte( life ) //Life
	write_byte( decayrate ) //Decay Rate
	message_end();

	return PLUGIN_HANDLED
}
This is the current snippet i use, BUT it throws me back out to the starting menu.
It does this once i reched the part where i input the BLUE in the console
Radius, red,green = no crash when i press button
radius, red,green, BLUE = crash when i press button
Stephen is offline
GHW_Chronic
SourceMod Donor
Join Date: Sep 2004
Location: Texas
Old 02-28-2006 , 18:50  
Reply With Quote #2

you do:

amx_command Chr 52 255 0 CRASH? While you are typing the command the server crashes?

And what is the "user" variable for? It appears to me that you don't use it in the snippet you gave us.
GHW_Chronic is offline
Send a message via AIM to GHW_Chronic
Jordan
Veteran Member
Join Date: Aug 2005
Old 02-28-2006 , 18:59  
Reply With Quote #3

Code:
read_argv(0, user, 32)

He uses it for that, but I'm not sure if it relates to anything else.
Jordan is offline
Stephen
Senior Member
Join Date: Aug 2004
Old 02-28-2006 , 18:59  
Reply With Quote #4

This is the snippet i use.

what i do in console is this

.fx.fxWorldLight (the i press enter so i get these displayed radius], [red], [green], [blue], [brightness], [float:lifetime], [float:decayrate])

then i type again .fx.fxWorldLight but with 10 then i press enter and nothing happens

i do the same again .fx.fxWorldLight 10 255 and i press enter nothing happens

.fx.fxWorldLight 10 255 0 = nothing happen after pressed
.fx.fxWorldLight 10 255 0 0 = crash

It crashes everytime on the fourth Number when i enter it or more then four.
______
if i dont use
read_argv(0, user, 32)

i get an compile warning/error
Stephen is offline
Stephen
Senior Member
Join Date: Aug 2004
Old 02-28-2006 , 19:23  
Reply With Quote #5

This is how i use it atm

Dont mide the unused includes, cause there is more whre is going to be used.

Code:
#include <amxmodx>
#include <engine>
#include <fakemeta>
#include <amxmisc>
#include <string>
#include <fun>

#define TE_DLIGHT 27
#define TE_ELIGHT 28

public plugin_init()
{
	register_plugin("stuff","Beta","Stephen")
	register_clcmd(".fx.fxWorldLight","worldlight",ADMIN_ALL,"[radius], [red], [green], [blue], [brightness], [float:lifetime], [float:decayrate]")

	return PLUGIN_CONTINUE;
}
//World Light
//===================
public worldlight(id, level, cid)
{
	if(!cmd_access(id,level,cid,5))
        	return PLUGIN_HANDLED

	new user[33], space[1], r[4], g[4], b[4], bright[1], time[1], rate[1]
	read_argv(0, user, 32)

	read_argv(1, space, 1)//RADIUS
	new radius = str_to_num(space)

	read_argv(2, r, 3)//Colors
	read_argv(3, g, 3)
	read_argv(4, b, 3)
	new red = str_to_num(r)
	new green = str_to_num(g)
	new blue = str_to_num(b)

	read_argv(5, bright, 1)//Brightness
	new brightness = str_to_num(bright)

	read_argv(6, time, 1)//LifeTime
	new life = str_to_num(time)

	read_argv(7, rate, 1)//Decayrate
	new decayrate = str_to_num(rate)

	new origin[3]
	get_user_origin(id,origin)
	message_begin(MSG_BROADCAST,SVC_TEMPENTITY, origin)
	write_byte( TE_DLIGHT )
	write_coord( origin[0] ); //coord coord coord (position)
	write_coord( origin[1] );
	write_coord( origin[2] );
	write_byte( radius ) //Radius
	write_byte( red ) //Red
	write_byte( green ) //Green
	write_byte( blue ) //Blue
	write_byte( brightness ) //Brightness
	write_byte( life ) //Life
	write_byte( decayrate ) //Decay Rate
	message_end();

	return PLUGIN_HANDLED
}
//Screen Fade
//===================
Stephen is offline
c0rdawg
Senior Member
Join Date: Jan 2006
Old 02-28-2006 , 19:26  
Reply With Quote #6

use the small tag instead of the code tag to display your plugin source
c0rdawg is offline
Send a message via AIM to c0rdawg Send a message via MSN to c0rdawg
Stephen
Senior Member
Join Date: Aug 2004
Old 02-28-2006 , 19:27  
Reply With Quote #7


Lol sry but i didnt understand that.
im not an pro in coding at all .

can you make an snippet ?
Stephen is offline
GHW_Chronic
SourceMod Donor
Join Date: Sep 2004
Location: Texas
Old 02-28-2006 , 19:28  
Reply With Quote #8

Code:
   if(!cmd_access(id,level,cid,5))            return PLUGIN_HANDLED
change to
Code:
   if(!cmd_access(id,level,cid,8))            return PLUGIN_HANDLED
should work. Because you were putting 0 in for
Code:
   write_byte( brightness ) //Brightness    write_byte( life ) //Life    write_byte( decayrate ) //Decay Rate
thus causing ur server to go "brightness 0? life 0? decayrate 0? WTF?! IM SO CONFUSED!"
GHW_Chronic is offline
Send a message via AIM to GHW_Chronic
Stephen
Senior Member
Join Date: Aug 2004
Old 02-28-2006 , 19:34  
Reply With Quote #9

ok i change the 5 to 8

Now i dont crash anymore when it comes to color blue.
^^

BUT when i type an higher number then 20 in Decayrate spot i get thrown out again in to the gamestartup screen

it says something with BadServerParseMessage or something like this.


BUT when it works the effect only stays for an short amount no matter how much time i put in.

=O i want these Fields customizable when i type them in the console ^^
Stephen is offline
Stephen
Senior Member
Join Date: Aug 2004
Old 03-01-2006 , 04:45  
Reply With Quote #10

Anyone knows how to make that better ?
And so that the Effect doesnt dissapear after 0.5 seconds ?

___
never mind i found that out now
Stephen 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 20:23.


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