Re: Can you spot the glitch? [message #485645 is a reply to message #485624] |
Tue, 04 February 2014 14:48 |
Stallion
Messages: 222 Registered: April 2006
Karma:
|
Recruit |
|
|
This script is in the process of being reverse engineered from Iran_Beaconing_Prevention_Zone which functions properly for the ions and nukes. It would seem I have a lot to do in order to get it functioning even though I changed so little. I got the registrant worked out so now it'll let me put in the preset, but you guys see some of the other stuff.
I'll look into the stuff you guys put, and see what I can do.
here's a copy of his script:
#include "general.h"
#include "scripts.h"
#include "VehicleGameObj.h"
#include "engine.h"
#include "iran_scripts.h"
void Iran_Beaconing_Prevention_Zone::Entered(GameObject *obj,GameObject *enter)
{
Commands->Start_Timer(obj,this,0.1f,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 (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)
{
Commands->Select_Weapon(checkplayerobj,"");
Commands->Select_Weapon(checkplayerobj,"CnC_Weapon_NukeBeacon_Player");
}
Commands->Start_Timer(obj,this,0.5,number);
}
else if (Get_Total_Bullets(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)
{
Commands->Select_Weapon(checkplayerobj,"");
Commands->Select_Weapon(checkplayerobj,"CnC_Weapon_IonCannonBeacon_Player");
}
Commands->Start_Timer(obj,this,0.5,number);
}
}
}
void Iran_Beaconing_Prevention_Zone::Remove_Weapon_Safely(GameObject *obj,const char *WeaponName)
{
const char *CurrentWeapon = Get_Current_Weapon(obj);
if (CurrentWeapon)
{
if (!_stricmp(CurrentWeapon,WeaponName))
{
if (Has_Weapon(obj,"Weapon_Pistol_Player"))
{
Commands->Select_Weapon(obj,"Weapon_Pistol_Player");
Remove_Weapon(obj,WeaponName);
Commands->Select_Weapon(obj,"Weapon_Pistol_Player");
}
else
{
Grant_Powerup(obj, "POW_Pistol_Player");
Commands->Select_Weapon(obj,"Weapon_Pistol_Player");
Remove_Weapon(obj,WeaponName);
Commands->Select_Weapon(obj,"Weapon_Pistol_Player");
}
}
}
}
ScriptRegistrant<Iran_Beaconing_Prevention_Zone> Iran_Beaconing_Prevention_Zone_Registrant("Iran_Beaconing_Prevention_Zone", "");
Level edit is my play ground
|
|
|