Need to add more than one ship?
Posted: November 5th, 2011, 2:25 pm
I have a code for a space ship, at the moment I can only add one..I'm looking to add more but it shows an error 'getent used with one or more enitity' how can i make it so i can have multiple ships? This is the start of the code, and the only bit that needs changing, im not released it all because it wasn't scripted or belong to me BUT i do have permission to use it.
Code: Select all
mainfi()
{
level.spaceFighterHealth = 1000;
//thread constant_gravity();
spacefighter_trigs = getEnt("spacefighter_trig", "targetname");
spacefighter_trigs thread waitForPilot();
}
waitForPilot()
{
fighter = getEnt("fighter", "targetname");
fighter.isSpaceFighter = true;
fighter thread preFlight();
while(1)
{
self waittill("trigger", player);
if(fighter.hasPilot)
continue;
if(isDefined(player.isPiloting))
continue;
if(player.sessionstate != "playing")
continue;
if(!isAlive(player) || !isPlayer(player))
continue;
if(isDefined(player.pers["isBot"]))
continue;
if(player getStance() == "prone")
continue;
fighter.hasPilot = true;
fighter.owner = player;
player.isPiloting = true;
player thread pilotFighter(fighter);
}
}