Author Topic: [Solved] Finding when a player dismounts a vehicle + waiting to call...  (Read 567 times)

I need to know what function is called when any player dismounts any vehicle. (like vehicle::what)
Also: how do I wait to call a function? like, wait 1000 ms then call a function
Also also: how do I set a player's camera to be locked on a moving vehicle?
Also also also: How do I set a vehicle that's already been colored to be transparent?
« Last Edit: November 11, 2014, 10:29:28 PM by superdupercoolguy »

Armor::onDismount

schedule(1000, 0, functionName, arg1, arg2, ...);

%client.camera.setOrbitMode(%vehicle, getWords(%vehicle.getTransform(), 3, 6), 0.5, 8, 8, 1); %client.camera.mode = "Orbit"; %client.setControlObject(%client.camera);

%vehicle.setNodeColor("ALL", "1 1 1 0.5");

Wow, thanks! That was an incredibly fast response that will hopefully solve all the issues I was having or knew I'd have on my mod!
EXCEPT: How do I make a vehicle outright vanish. Setting opaque to 0 will cause you to see the sky through it. I need the vehicle to vanish completely but still be colliding.
ALSO: How do I change the player's camera back?
setCameraNormal event works
Also: getting a weird syntax error on ln 3:
Code: [Select]
function armor::onDismount(%this, %obj, %a, %b) {
Parent::onDismount(%this, %obj, %a, %b);
if (%player.oldPos) {
%player.setTransform(%oldPos);
%player.oldPos = false;
}
}
« Last Edit: November 11, 2014, 08:58:00 PM by superdupercoolguy »

1. Your code executes just fine for me
2. Although your condition, if(%player.oldPos) is syntactically correct, it will result in errors, as you're attempting to evaluate a string as a boolean. This could result in returning false, even though as oldPos is set. Change it to if(%player.oldPos !$= "")
« Last Edit: November 11, 2014, 09:19:57 PM by Headcrab Zombie »

Hmmm, perhaps it's something executed before it causing issues?
Code: [Select]
function Player::TARDIS_Cam(%player) {
%player.client.camera.setOrbitMode(%player.TARDIS.vehicle, getWords(%player.TARDIS.vehicle.getTransform(), 3, 6), 0.5, 8, 8, 1);
%player.client.camera.mode = "Orbit";
%player.client.setControlObject(%player.client.camera);
}

function armor::onDismount(%this, %obj, %a, %b) {
Parent::onDismount(%this, %obj, %a, %b);
if (%player.oldPos !$=" ") {
%player.setTransform(%oldPos);
%player.oldPos = false;
}
}
it's not in a package. does it matter?
« Last Edit: November 11, 2014, 09:40:49 PM by superdupercoolguy »

Nope
Are you developing out of a zip file? If so, don't; use a normal folder and zip it up when/if you release it


By using a normal folder.

wow. I feel like an idiot for zipping it up all this time o.o thanks lol