Jump to content

how disable infinite run?


Kenix

Recommended Posts

Posted

Do you mean like Stamina? if so, i don't think there's a way to disable that, maybe make an script?

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted
Do you mean like Stamina? if so, i don't think there's a way to disable that, maybe make an script?

yes i mean Stamina.

  
addEventHandler("onPlayerJoin", root, 
function( ) 
   setPedStat(source,22,999) -- and 0 , 999 still a player runs indefinitely. 
end 
) 
  

I'm not sure this code please help who knows.

http://vk.com/the_kenix

Вопросы задавайте на форуме, не пишите мне в личку.

Please don't pm me.

Posted
setPedStat(source,22,0) can't help i think (: may be 'onPlayerSpawn'?

still infinite run :(

http://vk.com/the_kenix

Вопросы задавайте на форуме, не пишите мне в личку.

Please don't pm me.

Posted

Try this:

function stats() 
setPedStat(source,22,999) 
setTimer(stats,2000,1) 
end 
addEventHandler("onPlayerJoin",getRootElement(),stats) 

Omg Im crazy i started help all :P

;)
Posted

I don't think MTA has this included, i think the Stamina won't affect anything, i would use Karlis idea.

stamina = 100 
  
addEventHandler ( "onClientPlayerSpawn", getLocalPlayer(), 
function () 
stamina = 100 
setTimer(checkKey,700,0) 
setTimer(updateStamina,1000,0) 
end) 
  
function checkKey() 
if ( getControlState ( "sprint" ) ) and stamina ~= 0 then 
stamina = stamina -1 
end 
if ( stamina == 0 ) then 
setControlState( "sprint", false ) 
  end 
end 
  
function updateStamina() 
if stamina ~= 100 and getControlState ( "sprint" ) == false then 
stamina = stamina +1 
  end 
end 

Works (tested).

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted
I don't think MTA has this included, i think the Stamina won't affect anything, i would use Karlis idea.
stamina = 100 
  
addEventHandler ( "onClientPlayerSpawn", getLocalPlayer(), 
function () 
stamina = 100 
setTimer(checkKey,700,0) 
setTimer(updateStamina,1000,0) 
end) 
  
function checkKey() 
if ( getControlState ( "sprint" ) ) and stamina ~= 0 then 
stamina = stamina -1 
end 
if ( stamina == 0 ) then 
setControlState( "sprint", false ) 
  end 
end 
  
function updateStamina() 
if stamina ~= 100 and getControlState ( "sprint" ) == false then 
stamina = stamina +1 
  end 
end 

Works (tested).

yep, thats exactly what i was going to write today(had to go yesterday)...i guess no more need

EDIT:i don't see a way that the button is enabled again?

Posted

Somehow it auto enables, lol.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

No problem.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...