Liberty Unleashed
Scripting => Script Help => Topic started by: Mido_Pop on November 05, 2012, 01:57:09 pm
-
i need it with timer .
what is the error ?
function onPlayerCommand( plr, cmd, text )
{
if ( cmd == "fixit" )
{
NewTimer( "fix", 1, 1);
}
return 1;
}
function fix()
{
plr.Vehicle.Fix();
}
-
How obvious is the wiki supposed to be !?
Read this page thousands of times till you understand, it's plain obvious...
http://liberty-unleashed.co.uk/LUWiki/Squirrel/Functions/Timers/NewTimer (http://liberty-unleashed.co.uk/LUWiki/Squirrel/Functions/Timers/NewTimer)
1 second = 1000 miliseconds
-
Still doesn't explain why it's not working :P
You need to add a vehicle parameter, or the function fix() does not know what vehicle it needs to fix..
Something like:
function onPlayerCommand( plr, cmd, text )
{
if ( cmd == "fixit" )
{
NewTimer( "fix", 1000, 1, plr.Vehicle);
}
return 1;
}
function fix( veh )
{
veh.Fix();
}
-
thanks ( Thijn & Shadow ) :P :P
-
The "spamming" comment has been removed. This is a warning to others to drop that disgusting attitude. These forums exist for a reason, and helping people is one of them. If you don't like it, don't post here.
-
how can i make stop timer ???
like this :
StopTimer( "..", 1000, 1, ....);
-
how can i make stop timer ???
like this :
StopTimer( "..", 1000, 1, ....);
VehTimer <- NewTimer( "..", 1000, 1, ....);
VehTimer.Delete(); //Delete the timer.
VehTimer.Pause(); //Pause the timer.
VehTimer.Start(); //Resume the timer.