(11-30-2013, 03:46 PM)Neo Wrote: Hey there
I've got a problem with the wheels again I found out how to execute code when the player interacts with a valve or so, but then you just need to click on it one time, and I want to do something when you spin the wheel to the limit. Is it possible? :/ I haven't found a function for this yet...
It would be very kind if someone could help me
here is an example you can copy paste:
///////OpenHeavyDoor///////
void OpenheavyDoor(string &in asEntity, int alState)
{
if(alState == 1) //Meaning wheel is "toutching" MAX
{
SetWheelStuckState("YOURWHEELNAME", 1, true); //Sets the wheel STUCK so you can't spin it anymore.
//STUFF YOU WANT TO HAPPEN IF WHEEL goes to MAX, can be empty if you only want something happen on MINUMUM.
}
if(alState == -1) //Meaning wheel is "toutching" MINIMUM
{
//STUFF YOU WANT TO HAPPEN IF WHEEL goes to MIMIMUM, can be empty if you only want something happen on MAX.
}
}
-----
void OpenheavyDoor(string &in asEntity, int alState)
The OpenheavyDoor copy paste this into your EDITOR -> YOURWHEEL -> ENTITIY-tab -> CONNECTCHANGESTATECALLBACK.
EXTRA EDIT:
// <-- If you remove those 2 slashes, that specific line will work, // is only for giving you an idea. so remove it if you want to use the function.
-
Have fun, if it didnt work, be free to ask here.