Move()
if(usr.busy == 1)
src << "You are busy doing something else!"
return
..()
else
if(usr.swimming <= 11 && usr.swimming >= 1)
if(usr.icon_state == "swimming")
sleep(60)
usr.stamina -= rand(1, 2)
usr.swimming += usr.swimmingmod*0.1
return..()
if(usr.swimming <= 21 && usr.swimming >= 11)
if(usr.icon_state == "swimming")
sleep(55)
usr.stamina -= rand(1, 2)
usr.swimming += usr.swimmingmod*0.1
return..()
if(usr.swimming <= 31 && usr.swimming >= 21)
if(usr.icon_state == "swimming")
sleep(50)
usr.stamina -= rand(1, 2)
usr.swimming += usr.swimmingmod*0.1
..()
Problem description:I know that someone is going to tell me how inefficient and crappy my coding is, but until now, it had seemed like this worked properly. I'll probably end up having to rewrite it after some advice given to me.
Okay, onto the actual problem. This is a swimming protocol, to deal with the whole "Swimming" issue. It has worked so far, until I actually implemented a way of "Gaining" swimming.
Whenever I move, if a player continues to press that directional button while waiting for their character to move, they'll gain as if they had moved that much.
Is there a way to fix this? Thank you. Advice would be appreciated.
One question though. Why are you checking if the usr icon state is swimming when you never set it to swimming.. You are probably doing this somewhere in the code though so nevermind.
[EDIT] Also remember, no usr in procs. I fixed that though.