| Blockland Forums > Modification Help |
| Vehicle Spawning |
| << < (5/6) > >> |
| heedicalking:
I still do not see what the could be. It seems %a isn't being recognized if it echoes NO!!!. |
| Scout31:
--- Code: ---$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); } --- End code --- %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. |
| heedicalking:
I will try that. For some reason Brian Smith knew you were going to post next? |
| Scout31:
--- Quote from: heedicalking on September 21, 2010, 07:31:58 PM ---I will try that. For some reason Brian Smith knew you were going to post next? --- End quote --- Skype. |
| heedicalking:
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. |
| Navigation |
| Message Index |
| Next page |
| Previous page |