Author Topic: Vehicle Spawning  (Read 1694 times)

%spawnbrick wait what the doesn't even exist. I am so confused right now. I've read, understood, and wrote much more difficult scripts than this but I just cannot figure this out. I am going to try the dump thing now I guess.
That was just an example, god dammit.
%brick

You're hopeless.

That was just an example, god dammit.
%brick

You're hopeless.
Tried that too.

Stick echo(%brick.getName()); in there somewhere.

I started over and it is going good so far. I want to know how I can make it so when the vehicle dies, is auto respawned, or the respawn button is hit, it gets set to "NONE" and nothing happens.

Code: [Select]
$VehicleCost["Rowboatarmor"] = "300 0"; //First is Wood, Second is Steel
$VehicleCost["RowboatPlayer"] = "300 0"; //First is Wood, Second is Steel
$VehicleCost["PlayerRowboatarmor"] = "300 0"; //First is Wood, Second is Steel
$VehicleCost["Jeepvehicle"] = "300 0";


function Buyvehicle(%brick,%vehicle)
{
%a = getWord($VehicleCost[%vehicle],0);
%b = getWord($VehicleCost[%vehicle],1);
if(%a !$= "")
{
if(%client.Colonies["Wood"] >= %a && %client.Colonies["Steel"] >= %b)
{
echo("YES IT WORKS");
}
else
{
echo("DERP NOT ENOUGH STUFZ");
}
}
else echo("NO!!!");
}
package SpawnColoniesPlayer
{

function fxDtsBrick::spawnVehicle(%brick,%vehicle)
{
Parent::spawnVehicle(%brick,%vehicle);
echo(%brick.vehicle.Getdatablock().Costwood);
%newvehicle = %brick.vehicle.Getdatablock();
Buyvehicle(%brick,%newvehicle);
Buyvehicle(%brick,%vehicle);
echo(%brick.vehicle.Costwood);

}
It echoes no both times.
« Last Edit: September 21, 2010, 05:12:52 PM by heedicalking »

I still do not see what the could be. It seems %a isn't being recognized if it echoes NO!!!.

Code: [Select]
$VehicleCost["Rowboatarmor"] = "300 0"; //First is Wood, Second is Steel
$VehicleCost["RowboatPlayer"] = "300 0"; //First is Wood, Second is Steel
$VehicleCost["PlayerRowboatarmor"] = "300 0"; //First is Wood, Second is Steel
$VehicleCost["Jeepvehicle"] = "300 0";


function Buyvehicle(%brick,%vehicle)
{
%a = getWord($VehicleCost[%vehicle],0);
%b = getWord($VehicleCost[%vehicle],1);
if(%a !$= "")
{
if(%client.Colonies["Wood"] >= %a && %client.Colonies["Steel"] >= %b)
{
echo("YES IT WORKS");
}
else
{
echo("DERP NOT ENOUGH STUFZ");
}
}
else echo("NO!!!");
}
package SpawnColoniesPlayer
{

function fxDtsBrick::spawnVehicle(%brick,%vehicle)
{
Parent::spawnVehicle(%brick,%vehicle);
echo(%brick.vehicle.Getdatablock().Costwood);
%newvehicle = %brick.vehicle.GetDatablock().getname();
Buyvehicle(%brick,%newvehicle);
Buyvehicle(%brick,%vehicle.getname());
echo(%brick.vehicle.Costwood);

}
%newvehicle = %brick.vehicle.GetDatablock();
%newvehicle = %brick.vehicle.GetDatablock().getname();

Buyvehicle(%brick,%vehicle);
Buyvehicle(%brick,%vehicle.getname());

You forgot that you were getting the datablock, but checking the name when the getDatablock returned a number.

I will try that. For some reason Brian Smith knew you were going to post next?

I will try that. For some reason Brian Smith knew you were going to post next?
Skype.

Now i need to know how to get the client of the person who spawned the vehicle or the brick owner's client, and how to set the vehicle to nothing, then I should be good.

%vehicle.client, or %brick.client might work.

%vehicle.client, or %brick.client might work.
That worked.
Now i need to know how to get the client of the person who spawned the vehicle or the brick owner's client, and how to set the vehicle to nothing, then I should be good.