So I've been trying to manipulate my old vehicle sound mod so it only activated when the driver entered the vehicle, and stopped when the driver got out.
Here's what I'm using. No errors, it just does nothing.
function Rodeo::onMount(%this,%obj,%player)
{
%vehicle = %player.getMountObject();
if(isObject(%vehicle.getMountNodeObject(0).client))
{
schedule(1000,0,"RodeoSpeedCheck",%this,%obj);
serverPlay3d(RodeoStart,%obj.getposition());
}
}
function Rodeo::onunMount(%this,%obj,%player)
{
%vehicle = %player.getMountObject();
if(isObject(%vehicle.getMountNodeObject(0).client))
{
cancel(%this,RodeoSpeedCheck);
serverPlay3d(RodeoStop,%obj.getposition());
}
}
EDIT:
stuff, this should be in coding help. Uhh.. locking/moving.