I assume you are trying to lift the ramp for the players vehicle
You're almost there, but an easier way of doing would be getting the vehicle off %client.player
%vehicle = %client.player.getObjectMount();
But what if the player is not in a vehicle?
if(!isObject(%vehicle)
{
messageClient(%client,'',"You are not in a vehicle");
return;
}
Now that we know the he's in a vehicle lets toggle the ramp
if(%vehicle.rampDown)
{
%vehicle.playThread(1,"RampUp")
}
else
{
%vehicle.playThread(1,"RampDown")
}
Adding it all together we get
function serverCmdRamp(%client)
{
%vehicle = %client.player.getObjectMount();
if(!isObject(%vehicle)
{
messageClient(%client,'',"You are not in a vehicle");
return;
}
if(%vehicle.rampDown)
{
%vehicle.playThread(1,"RampUp")
}
else
{
%vehicle.playThread(1,"RampDown")
}
}
For simplicity's sake I left out things like checking if the vehicle is an osprey, spam protection, checking if the client is the driver, but I think you get the idea
this wasn't tested so there could be things wrong if there is point them out