[Question] How to make this command [For 5165 Source]

04/01/2010 01:17 iLikeSkittles#1
Hello guys, I'm new at coding and was wondering how to make a command for the 5165 source which enables you to have unlimited stamina (For GMs only). Thanks.

This is wut I have did so far...

Code:
                   if (Cmd[0] == "/gmstamina")
                    {
                        if (!InfiniteStamina)
                        {
                            InfiniteStamina = true;
                        }
                        else
                        {
                            InfiniteStamina = false;
                        }
                         
                    }
I dunno where to define InfiniteStamina.

#EDIT

Okay I've tried doing this. I went to Character.cs and put this above if (Action == 250)

Code:
                    if (InfiniteStamina)
                        Stamina = 100;
And went back and changed the Chat.cs thing to

Code:
                    if (Cmd[0] == "/gmstamina")
                    {
                        if (!GC.MyChar.InfiniteStamina)
                        {
                            GC.MyChar.InfiniteStamina = true;
                        }
                        else
                        {
                            GC.MyChar.InfiniteStamina = false;
                        }
                         
                    }
Is it okay to do it like this??
04/01/2010 01:34 xScott#2
Gonna have to do checks on all skills that use stamina i believe, so if
Code:
InfiniteStamina = true;
then remove the stamina cost for the skill,
else
Stamina cost for skill as normal

Thats how i'd do it
04/01/2010 02:01 PeTe Ninja#3
no...

basically do this..

find out where you send it finally liek im pretty sure the new lotf doesn't require u to send a packet each time it sends at the end

find it there.. be like

if (InifiniteStamina)
Stamina = 100;
send stam.
04/01/2010 02:04 iLikeSkittles#4
So for example for this:
Code:
                if (AT != AttackType.Magic && Action == 250)
                {
                    if (Stamina > 30)
                        Stamina -= 30;
                    else
                        Stamina = 0;
                }
Do I just change it to this:

Code:
             if (AT != AttackType.Magic && Action == 250 && InfiniteStamina)
                {
                    if (Stamina > 30)
                        Stamina -= 30;
                    else
                        Stamina = 0;
                }
04/01/2010 14:56 copz1337#5
cheater learn how to fb/ss then you wouldn't need infinite stamina.
04/01/2010 18:03 .Guru#6
public bool InfiniteStamina;

since you asked where to define it
04/01/2010 20:54 iLikeSkittles#7
Quote:
Originally Posted by copz1337 View Post
cheater learn how to fb/ss then you wouldn't need infinite stamina.
When did say I wanted to FB/SS using infinite stamina? I could be using it for something else like mounts & guards.

I got it working 100%.

#request close