Raised This Month: $ Target: $400
 0% 

Problem: With creating EntityLight with custom Fields.


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Stephen
Senior Member
Join Date: Aug 2004
Old 02-28-2006 , 14:36   Problem: With creating EntityLight with custom Fields.
Reply With Quote #1

Quote:
register_clcmd(".fx.fxEntityLight","EntityLig ht",ADMIN_ALL,"[coord], [coord], [coord], [Radius], [Red], [Green], [Blue], [Life], [DecayRate]")
Quote:

//Entity Light
//===================
public EntityLight(id, level, cid)
{
if(!cmd_access(id,level,cid,2))
return PLUGIN_HANDLED

new szArg0[32]
read_argv(1,szArg0,31)
new szArg1[32]
read_argv(1,szArg1,31)
new szArg2[32]
read_argv(1,szArg2,31)
new szArg3[32]
read_argv(1,szArg3,31)
new szArg4[32]
read_argv(1,szArg4,31)
new szArg5[32]
read_argv(1,szArg5,31)
new szArg6[32]
read_argv(1,szArg6,31)

if( !strlen(szArg0)|| !strlen(szArg1)|| !strlen(szArg2)|| !strlen(szArg3)|| !strlen(szArg4)|| !strlen(szArg5)|| !strlen(szArg6))
return PLUGIN_HANDLED

new spriteorigin4[3]
get_user_origin(id, spriteorigin4)
message_begin(MSG_BROADCAST,SVC_TEMPENTITY)
write_byte( TE_ELIGHT )
write_short( id )
write_coord( szArg0[0] ); //coord coord coord (position)
write_coord( szArg0[1] );
write_coord( szArg0[2] );
write_coord( szArg1 ) //coord radius
write_byte( szArg2 ) //Red
write_byte( szArg3 ) //Green
write_byte( szArg4 ) //Blue
write_byte( szArg5 ) //Life
write_coord( szArg6 ) //Decay Rate
message_end();

return PLUGIN_HANDLED
}
I wondered how i could make it so that when i wanna create that light that i can summon it in the color i want.
So i can enter custom number before it shows up.
Stephen is offline
c0rdawg
Senior Member
Join Date: Jan 2006
Old 02-28-2006 , 14:56  
Reply With Quote #2

isn't it this

Code:
write_byte( szArg2 ) //Red write_byte( szArg3 ) //Green write_byte( szArg4 ) //Blue
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 , 14:58  
Reply With Quote #3


Hmm.
Sry but i dont understand what you mean.
Stephen is offline
c0rdawg
Senior Member
Join Date: Jan 2006
Old 02-28-2006 , 15:01  
Reply With Quote #4

well thats the code for changing the color, so you have to just make a command to write the colors you want to that
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 , 15:06  
Reply With Quote #5

Erm
Can you make an example of what you exactly meant this to be ?

Cause i thought its done with

new szArg1[32]
read_argv(1,szArg1,31)
new szArg2[32]
read_argv(1,szArg2,31)
new szArg3[32]
read_argv(1,szArg3,31)
new szArg4[32]
read_argv(1,szArg4,31)
new szArg5[32]
read_argv(1,szArg5,31)
new szArg6[32]
read_argv(1,szArg6,31)


And these Lines give me errors in compiling
write_coord( szArg1 ) //coord radius
write_byte( szArg2 ) //Red
write_byte( szArg3 ) //Green
write_byte( szArg4 ) //Blue
write_byte( szArg5 ) //Life
write_coord( szArg6 ) //Decay Rate
Stephen is offline
c0rdawg
Senior Member
Join Date: Jan 2006
Old 02-28-2006 , 15:09  
Reply With Quote #6

for each szArg1[32] you are setting them to the first argument, you need it to be like

Code:
new szArg1[32] read_argv(1,szArg1,31) new szArg2[32] read_argv(2,szArg2,31) new szArg3[32] read_argv(3,szArg3,31) new szArg4[32] read_argv(4,szArg4,31) new szArg5[32] read_argv(5,szArg5,31) new szArg6[32] read_argv(6,szArg6,31)
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 , 15:19  
Reply With Quote #7

hmm ok.

I still get the same errors by compiling.
onthese Lines
Code:
write_coord( szArg1 ) //coord radius
write_byte( szArg2 ) //Red
write_byte( szArg3 ) //Green
write_byte( szArg4 ) //Blue
write_byte( szArg5 ) //Life
write_coord( szArg6 ) //Decay Rate
Full code
Code:
#include <amxmodx>
#include <engine>
#include <fakemeta>
#include <amxmisc>
#include <fun>

#define TE_ELIGHT 28

public plugin_init()
{
	register_plugin("stuff","Beta","Stephen")
	register_clcmd(".fx.fxEntityLight","EntityLight",ADMIN_ALL,"[coord], [coord], [coord], [Radius], [Red], [Green], [Blue], [Life], [DecayRate]")
	
	return PLUGIN_CONTINUE;
}
//Entity Light
//===================
public EntityLight(id, level, cid)
{
	if(!cmd_access(id,level,cid,2))
        	return PLUGIN_HANDLED

    	new szArg0[32]
	read_argv(0,szArg0,31)

	new szArg1[32]
	read_argv(1,szArg1,31)	

	new szArg2[32]
	read_argv(2,szArg2,31)

	new szArg3[32]
	read_argv(4,szArg3,31)

	new szArg4[32]
	read_argv(4,szArg4,31)

	new szArg5[32]
	read_argv(5,szArg5,31)

	new szArg6[32]
	read_argv(6,szArg6,31)

    	if(!strlen(szArg0)||!strlen(szArg1)||!strlen(szArg2)||!strlen(szArg3)||!strlen(szArg4)||!strlen(szArg5)||!strlen(szArg6))
        return PLUGIN_HANDLED

    	new spriteorigin4[3]
	get_user_origin(id, spriteorigin4)
	message_begin(MSG_BROADCAST,SVC_TEMPENTITY)	
	write_byte( TE_ELIGHT )
	write_short( id )
	write_coord( szArg0[0] ); //coord coord coord (position)
	write_coord( szArg0[1] );
	write_coord( szArg0[2] );
	write_coord( szArg1 ) //coord radius
	write_byte( szArg2 ) //Red
	write_byte( szArg3 ) //Green
	write_byte( szArg4 ) //Blue
	write_byte( szArg5 ) //Life
	write_coord( szArg6 ) //Decay Rate
	message_end();

    	return PLUGIN_HANDLED
}
Stephen is offline
c0rdawg
Senior Member
Join Date: Jan 2006
Old 02-28-2006 , 15:29  
Reply With Quote #8

whats the error?
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 , 15:34  
Reply With Quote #9

The errors are "argument type mismatch <argument 1>

And to be true i dont know what decay rate is. I think its the speed of the Vanishing entity light.
Stephen is offline
c0rdawg
Senior Member
Join Date: Jan 2006
Old 02-28-2006 , 15:40  
Reply With Quote #10

hmmm, well i think it reads that arguments as strings, so you might have to do str_to_num for your rgb stuff
c0rdawg is offline
Send a message via AIM to c0rdawg Send a message via MSN to c0rdawg
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:28.


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