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 #451200 is a reply to message #446321] |
Wed, 10 August 2011 13:57 |
iRANian
Messages: 4308 Registered: April 2011
Karma:
|
General (4 Stars) |
|
|
My version handles multiple people and doesn't crsah the FDS, JonWil's scripts uses timer numbers like that too. Your version will also give people free beacons if they enter the zone when their beacon "bullet count" is zero.
EDIT: Yeah, you're right. I didn't think about trying it that way. Gonna see if your function prevents that crash.
EDIT2: Nvm, the crash is something else that I resolved. What I have now is:
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))
{
//if (Has_Weapon(checkplayerobj, "CnC_Weapon_NukeBeacon_Player"))
if (Get_Total_Bullets(checkplayerobj, "CnC_Weapon_NukeBeacon_Player"))
{
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");
}
Commands->Start_Timer(obj,this,0.1,number);
}
else if (Get_Total_Bullets(checkplayerobj, "CnC_Weapon_IonCannonBeacon_Player"))
//else if (Has_Weapon(checkplayerobj, "CnC_Weapon_IonCannonBeacon_Player"))
{
const char* currentweapon = Get_Current_Weapon(checkplayerobj);
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");
}
Commands->Start_Timer(obj,this,0.1,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: Thu, 11 August 2011 06:46] Report message to a moderator
|
|
|
|
|
How to Turn the Ped on after a specific time
|
|
|
Re: How to Turn the Ped on after a specific time
By: iRANian on Thu, 28 April 2011 12:45
|
|
|
Re: How to Turn the Ped on after a specific time
|
|
|
Re: How to Turn the Ped on after a specific time
By: Hex on Thu, 28 April 2011 15:19
|
|
|
Re: How to Turn the Ped on after a specific time
|
|
|
Re: How to Turn the Ped on after a specific time
By: zunnie on Sat, 07 May 2011 06:20
|
|
|
Re: How to Turn the Ped on after a specific time
|
|
|
Re: How to Turn the Ped on after a specific time
By: iRANian on Wed, 10 August 2011 13:33
|
|
|
Re: How to Turn the Ped on after a specific time
|
|
|
Re: How to Turn the Ped on after a specific time
By: iRANian on Wed, 10 August 2011 13:57
|
|
|
Re: How to Turn the Ped on after a specific time
|
|
|
Re: How to Turn the Ped on after a specific time
By: iRANian on Thu, 11 August 2011 06:45
|
|
|
Re: How to Turn the Ped on after a specific time
|
|
|
Re: How to Turn the Ped on after a specific time
|
|
|
Re: How to Turn the Ped on after a specific time
By: iRANian on Thu, 11 August 2011 11:24
|
|
|
Re: How to Turn the Ped on after a specific time
|
|
|
Re: How to Turn the Ped on after a specific time
By: iRANian on Thu, 11 August 2011 12:56
|
|
|
Re: How to Turn the Ped on after a specific time
|
|
|
Re: How to Turn the Ped on after a specific time
By: iRANian on Thu, 11 August 2011 14:08
|
|
|
Re: How to Turn the Ped on after a specific time
|
|
|
Re: How to Turn the Ped on after a specific time
By: iRANian on Thu, 11 August 2011 22:37
|
|
|
Re: How to Turn the Ped on after a specific time
|
|
|
Re: How to Turn the Ped on after a specific time
By: iRANian on Thu, 11 August 2011 22:52
|
|
|
Re: How to Turn the Ped on after a specific time
|
Goto Forum:
Current Time: Sun Dec 29 09:58:55 MST 2024
Total time taken to generate the page: 0.00813 seconds
|