Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

Welcome, Guest!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

Sign in to follow this  
[-HOH-]szymek777

Script

Recommended Posts

Source file: (be sure to include engine.h and scripts.h)

void zbl_Zone_Enter_Send_Custom_Object::Entered(GameObject *o, GameObject *enterer){	if (Get_Player_Type(enterer) == Get_Int_Parameter("Player_Type"))	{		int ID = Get_Int_Parameter("ID");		int message = Get_Int_Parameter("Message");		int param = Get_Int_Parameter("Param");		Send_Custom(ID, message, param, enterer);	}}

Header file:

class zbl_Send_Custom_Base abstract{protected:	void Send_Custom(int ID, int message, int param, GameObject *sender, float delay = 0.0f)	{		GameObject *o = Commands->Find_Object(ID);		if (o)		{			Commands->Send_Custom_Event(sender, o, message, param, delay);		}	}};class zbl_Zone_Enter_Send_Custom_Object : public ScriptImpClass, zbl_Send_Custom_Base{public:	void Entered(GameObject *o, GameObject *enterer);};

Registrant: (including my macro)

#define Register_Script(ClassName,Params) ScriptRegistrant<ClassName> ClassName##_Registrant(#ClassName,Params)Register_Script(zbl_Zone_Enter_Send_Custom_Object, "Player_Type:int,ID:int,Message:int,Param:int");

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use and Privacy Policy.