Energy system on RP

Results 1 to 3 of 3
  1. #1
    Apprentice explote09 is offline
    MemberRank
    Nov 2012 Join Date
    13Posts

    Energy system on RP

    Using this RP emulator, very new to coding etc. When you shoot using the command, everytime its supposed to take 2 energy each shot but doesnt.

    This is the code for it:

    Code:
    Instance.BroadcastMessage(RoomChatComposer.Compose(Actor.Id, "*Shoots " + Username + " with their G3 causing " + HitPoint + " damage! [-2e]*", 0, ChatType.Shout));
                                        Instance.BroadcastMessage(RoomChatComposer.Compose(TargetActor.Id, "[" + Target.Health + "/100]", 0, ChatType.Shout));
                                        Session.CharacterInfo.UpdateScore(MySqlClient, +reward);
                                        Session.CharacterInfo.UpdateWantedLVL(MySqlClient, 1);
                                        Session.CharacterInfo.UpdateEnergy(MySqlClient, -2);
    Anyone have any idea? please and thanks
    Last edited by explote09; 19-03-15 at 09:40 PM.


  2. #2
    Check http://arcturus.pw The General is offline
    DeveloperRank
    Aug 2011 Join Date
    7,608Posts

    Re: Energy system on RP

    Because you're not updating the attribute for the user object? You're only updating the values in the database (Which is also bad practice to every time)

  3. #3
    Proficient Member jaden83 is offline
    MemberRank
    Oct 2014 Join Date
    DESKTOP-2FLLV85Location
    176Posts

    Re: Energy system on RP

    Quote Originally Posted by explote09 View Post
    Using this RP emulator, very new to coding etc. When you shoot using the command, everytime its supposed to take 2 energy each shot but doesnt.

    This is the code for it:

    Code:
    Instance.BroadcastMessage(RoomChatComposer.Compose(Actor.Id, "*Shoots " + Username + " with their G3 causing " + HitPoint + " damage! [-2e]*", 0, ChatType.Shout));
                                        Instance.BroadcastMessage(RoomChatComposer.Compose(TargetActor.Id, "[" + Target.Health + "/100]", 0, ChatType.Shout));
                                        Session.CharacterInfo.UpdateScore(MySqlClient, +reward);
                                        Session.CharacterInfo.UpdateWantedLVL(MySqlClient, 1);
                                        Session.CharacterInfo.UpdateEnergy(MySqlClient, -2);
    Anyone have any idea? please and thanks
    Session.CharacterInfo.Energy -= 2; ??? and I don't recommend using reality, If you're looking for someone to help you with your emulator situation then you can PM me on ragezone



Advertisement