Renegade Public Forums
C&C: Renegade --> Dying since 2003™, resurrected in 2024!
Home » Renegade Discussions » Mod Forum » How to Turn the Ped on after a specific time
Re: How to Turn the Ped on after a specific time [message #451197 is a reply to message #446321] Wed, 10 August 2011 13:33 Go to previous messageGo to previous message
iRANian is currently offline  iRANian
Messages: 4308
Registered: April 2011
Karma:
General (4 Stars)
iran_scripts.cpp:
#include "scripts.h"
#include "engine.h"
#include "iran_scripts.h"

void Iran_Beaconing_Prevention_Zone::Entered(GameObject *obj,GameObject *enter) 
{																		 
	Commands->Start_Timer(obj,this,0.1,Commands->Get_ID(enter));
}

void Iran_Beaconing_Prevention_Zone::Timer_Expired(GameObject *obj,int number)
{
	GameObject* checkplayerobj = Commands->Find_Object(number);
	if ( IsInsideZone(obj,checkplayerobj)) 
	{
		Commands->Start_Timer(obj,this,0.5,number);		
		const char* currentweapon = Get_Current_Weapon(checkplayerobj);
		if (strcmp(currentweapon, "CnC_Weapon_NukeBeacon_Player") == 0 && Get_Current_Bullets(checkplayerobj) > 0) 
		{
			Remove_Weapon(checkplayerobj,"CnC_Weapon_NukeBeacon_Player");
			Grant_Powerup(checkplayerobj,"CnC_POW_Nuclear_Missle_Beacon");
		}
		else if (strcmp(currentweapon,"CnC_Weapon_IonCannonBeacon_Player") == 0 && Get_Current_Bullets(checkplayerobj) > 0) 
		{
			Remove_Weapon(checkplayerobj,"CnC_Weapon_IonCannonBeacon_Player");
			Grant_Powerup(checkplayerobj,"CnC_POW_IonCannonBeacon_Player");
		}	
	}
}


iran_scripts.h:
class Iran_Beaconing_Prevention_Zone : public ScriptImpClass {
	void Entered(GameObject *obj,GameObject *enter);
	void Timer_Expired(GameObject *obj,int number);
};


Long time and well respected Renegade community member, programmer, modder and tester.

Scripts 4.0 private beta tester since May 2011.

My Renegade server plugins releases

[Updated on: Wed, 10 August 2011 14:04]

Report message to a moderator

 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Need someone familiar with vehicle boning
Next Topic: Having some issues modifying the Airstrip waypoints serverside
Goto Forum:
  


Current Time: Wed Dec 18 13:19:22 MST 2024

Total time taken to generate the page: 0.00963 seconds