[Tutorial] Kill/Death System Code

Page 1 of 3 123 LastLast
Results 1 to 15 of 33
  1. #1
    My Status --> LukasCCB is offline
    MemberRank
    Apr 2013 Join Date
    CracolandiaLocation
    1,190Posts

    [Tutorial] Kill/Death System Code

    the code virtually source is ready, but just have some basic changes.
    Thank @Yuri-BR for sharing this code, only it is already in the source.
    I'll just teach to put the code in flash.

    Go to Data folder
    LangPack/NameLang.lang

    Search
    Code:
    
    
    Code:
    $FR_SURVIVOR_SCREEN_CREATE_KILLED_CIVILIANS=CIVILIANS KILLED
    


    Add

    Code:
    $FR_HeadShot_Ratio=HEADSHOT RATIO
    $FR_KDR=KILL DEATH RATIO
    $FR_ACCURACY=ACCURACY




    Now, go to FrontEnd.fla

    \src\classes\warz\frontend
    Open Frontend.as

    Search
    Code:
    public    function addClientSurvivor (Name:String, health:Number, xp:int, timeplayed:int,
    Add final line

    Code:
    , kdrS:int, hsrS:int, accyS:int)
    like this, don't forgot ',' symbol
    Spoiler:




    Now
    Go to src\classes\warz\dataObjects

    Open Survivor.as

    Search and edit

    Code:
    public    var    civiliansKilled:int;
    Add

    Code:
    public    var    kdrS:int;
            public    var    hsrS:int;
            public    var    accyS:int;
    Search
    Code:
    public    function Survivor (Name:String, health:Number, xp:int, timeplayed:int,
    Change or add
    Code:
    kdrS:int, hsrS:int, accyS:int
    Like this (don't forgot ',' symbol)
    Spoiler:




    Search
    Code:
    this.civiliansKilled = civiliansKilled;
    Add

    Code:
    this.kdrS = kdrS;
                this.hsrS = hsrS;
                this.accyS = accyS;
    Now, open FrontEnd.fla and go to
    _Survivors>Survivors
    Right Click and EDIT
    Add in TEXT

    PHP Code:
    KDRTitle
    HeadShotTitle
    AccuracyTitle 
    and add in RED line TEXT

    PHP Code:
    kdrS
    hsrS
    accyS 
    Now, Open src\classes\warz\frontend
    SurvivorsScreen.as

    Search
    Code:
    Survivors.KilledCivTitle.text = "$FR_SURVIVOR_SCREEN_CREATE_KILLED_CIVILIANS";
    Add

    Code:
    Survivors.HeadShotTitle.text = "$FR_HeadShot_Ratio";
                Survivors.KDRTitle.text = "$FR_KDR";
                Survivors.AccuracyTitle.text = "$FR_ACCURACY";
    Search

    Code:
    Survivors.KilledCiv.text = "";
    Add

    Code:
    Survivors.HeadShotTitle.text = "";
    Code:
                    Survivors.KDRTitle.text = "";
    
    Survivors.AccuracyTitle.text = "";
    Go to FrontEndDebug
    Search
    Code:
    api.addClientSurvivor(
    Add final line
    Code:
    0.00, 0.00, 0);


    Search

    Code:
    Survivors.KilledCivTitle.visible = false;
    Add
    Code:
    Survivors.HeadShotTitle.visible = false;
    Code:
                    Survivors.KDRTitle.visible = false;
    
    Survivors.AccuracyTitle.visible = false;


    Search
    Code:
    Survivors.KilledCivTitle.visible = true;
    Add
    Code:
    Survivors.HeadShotTitle.visible = true;
    Code:
                Survivors.KDRTitle.visible = true;
    
    Survivors.AccuracyTitle.visible = true;


    Search
    Code:
    Survivors.LastMap.text = survivor.lastMap;
    Add

    Code:
    Survivors.kdrS.text = String (survivor.kdrS);
                Survivors.hsrS.text = String (survivor.hsrS);
                Survivors.accyS.text = String (survivor.accyS);
    Publish and Test

    Now in WarZ.sln
    Search and uncomment
    Code:
    sprintf(kdrS, "%.2f", getRatio(float(slot.Stats.KilledSurvivors + slot.Stats.KilledBandits), float(slot.Stats.Deaths)));
    Now, change all this func.

    Code:
    // Kill/Death System Code \ RaGEZONE
        char kdrS[32];
        sprintf(kdrS, "%.2f", getRatio(float(slot.Stats.KilledSurvivors + slot.Stats.KilledBandits), float(slot.Stats.Deaths)));
        var[23].SetString(kdrS); // kdr
    
    
        char hsrS[32];
        sprintf(hsrS, "%.2f", getRatio(float(slot.Stats.ShotsHeadshots), float(slot.Stats.ShotsFired)));
        var[24].SetString(hsrS); // hsr
    
    
        char accyS[32];
        sprintf(accyS, "%.2f", getRatio(float(slot.Stats.ShotsHits), float(slot.Stats.ShotsFired)*100.0f)); // accuracy
        var[25].SetString(accyS); // accyS
    var[26].SetInt(slot.Stats.Deaths); // died*/
    in 23 change to 26
    Code:
    gfxMovie.Invoke("_root.api.addClientSurvivor", var, 23);
    Build and test

    Finish
    Last edited by LukasCCB; 17-10-16 at 12:26 PM.


  2. #2
    Yuri-BR#1559 Yuri-BR is offline
    DeveloperRank
    Apr 2013 Join Date
    ☣️❤️Location
    1,040Posts

    Re: [Tutorial] Kill/Death System Code

    to enable in client just uncomment these lines

    in FrontEndWarZ.cpp

    Code:
    /*char kdrS[32];
    sprintf(kdrS, "%.2f", getRatio(float(slot.Stats.KilledSurvivors + slot.Stats.KilledBandits), float(slot.Stats.Deaths)));
    var[23].SetString(kdrS); // kdr
    char hsrS[32];
    sprintf(hsrS, "%.2f", getRatio(float(slot.Stats.ShotsHeadshots), float(slot.Stats.ShotsFired)));
    var[24].SetString(hsrS); // hsr
    var[25].SetInt(int(getRatio((float)slot.Stats.ShotsHits, (float)slot.Stats.ShotsFired)*100.0f)); // accuracy
    var[26].SetInt(slot.Stats.Deaths); // died*/
    - - - Updated - - -

    and remember that the kdr and hsr is a floating point
    Last edited by Yuri-BR; 20-03-16 at 09:04 PM.

  3. #3
    Enthusiast srbalboa is offline
    MemberRank
    Nov 2015 Join Date
    30Posts

    Re: [Tutorial] Kill/Death System Code

    I Have this error lukas please help-me




  4. #4
    Apprentice nuypk48 is offline
    MemberRank
    Jan 2014 Join Date
    Bangkok, ThailaLocation
    12Posts

    Re: [Tutorial] Kill/Death System Code

    help Me!!!!
    It does not change

  5. #5
    Yuri-BR#1559 Yuri-BR is offline
    DeveloperRank
    Apr 2013 Join Date
    ☣️❤️Location
    1,040Posts

    Re: [Tutorial] Kill/Death System Code

    Quote Originally Posted by srbalboa View Post
    I Have this error lukas please help-me



    adds at the end, three new arguments and assign any values
    Last edited by Yuri-BR; 26-03-16 at 10:51 PM.

  6. #6
    Account Upgraded | Title Enabled! GetRektBambi is offline
    MemberRank
    Oct 2015 Join Date
    268Posts

    Re: [Tutorial] Kill/Death System Code

    Quote Originally Posted by Yuri-BR View Post
    adds at the end, three new arguments and assign any values
    3 values, however if memory serves me correct, the first 2 need to be string based so.. something like

    "GetRektBambi","IsSexyyyyy",0
    will be sufficient!

  7. #7
    Yuri-BR#1559 Yuri-BR is offline
    DeveloperRank
    Apr 2013 Join Date
    ☣️❤️Location
    1,040Posts

    Re: [Tutorial] Kill/Death System Code

    Quote Originally Posted by GetRektBambi View Post
    3 values, however if memory serves me correct, the first 2 need to be string based so.. something like



    will be sufficient!
    yes, as I said above, kdr and hsr and a floating point, and with two digits after point, so it is being set as a string

    Code:
    /*char kdrS[32];
    sprintf(kdrS, "%.2f", getRatio(float(slot.Stats.KilledSurvivors + slot.Stats.KilledBandits), float(slot.Stats.Deaths)));
    var[23].SetString(kdrS); // kdr
    char hsrS[32];
    sprintf(hsrS, "%.2f", getRatio(float(slot.Stats.ShotsHeadshots), float(slot.Stats.ShotsFired)));
    var[24].SetString(hsrS); // hsr
    var[25].SetInt(int(getRatio((float)slot.Stats.ShotsHits, (float)slot.Stats.ShotsFired)*100.0f)); // accuracy
    var[26].SetInt(slot.Stats.Deaths); // died*/
    api.addClientSurvivor(..., "0.00", "0.00", 0);
    Last edited by Yuri-BR; 26-03-16 at 11:54 PM.

  8. #8
    My Status --> LukasCCB is offline
    MemberRank
    Apr 2013 Join Date
    CracolandiaLocation
    1,190Posts

    Re: [Tutorial] Kill/Death System Code

    no mistakes, only lack of attention, it's all in the tutorial.

  9. #9
    Enthusiast McGrumpy is offline
    MemberRank
    Aug 2015 Join Date
    39Posts

    Re: [Tutorial] Kill/Death System Code

    how to fix this problem

  10. #10
    Yuri-BR#1559 Yuri-BR is offline
    DeveloperRank
    Apr 2013 Join Date
    ☣️❤️Location
    1,040Posts

    Re: [Tutorial] Kill/Death System Code

    Quote Originally Posted by McGrumpy View Post
    how to fix this problem
    Quote Originally Posted by Yuri-BR View Post
    adds at the end, three new arguments and assign any values
    api.addClientSurvivor(..., "0.00", "0.00", 0);

  11. #11
    Enthusiast McGrumpy is offline
    MemberRank
    Aug 2015 Join Date
    39Posts

    Re: [Tutorial] Kill/Death System Code

    Like this

  12. #12
    Account Upgraded | Title Enabled! GetRektBambi is offline
    MemberRank
    Oct 2015 Join Date
    268Posts

    Re: [Tutorial] Kill/Death System Code

    Quote Originally Posted by McGrumpy View Post
    Like this
    errr no! LOL

    The ... Stood for what was previously in the function arguments. Therefore append, "0.00","0.00",0 after the aguments and before the );

  13. #13
    Enthusiast McGrumpy is offline
    MemberRank
    Aug 2015 Join Date
    39Posts

    Re: [Tutorial] Kill/Death System Code

    Can you help me i don't know what you guys saying here i try to fix it but its not work can you tell me normally how to fix pls

  14. #14
    Yuri-BR#1559 Yuri-BR is offline
    DeveloperRank
    Apr 2013 Join Date
    ☣️❤️Location
    1,040Posts

    Re: [Tutorial] Kill/Death System Code

    Quote Originally Posted by McGrumpy View Post
    Can you help me i don't know what you guys saying here i try to fix it but its not work can you tell me normally how to fix pls
    you must add only what is in red

    Code:
    api.addClientSurvivor("Sagor", 100, 666, Math.random() * 100000, 0, 1, 0, 0, 0, 1, 100, 100, 100, 100, 36, 32, 0, 0, 0, "Good", "Hell", true, 100000, "0.00", "0.00", 0);

  15. #15
    Enthusiast McGrumpy is offline
    MemberRank
    Aug 2015 Join Date
    39Posts

    Re: [Tutorial] Kill/Death System Code

    Yuri look i have now this new errors


    can you maybe send me the full of "FrontendDebug.as" if you can Yuri and thanks for trying to help =D



Page 1 of 3 123 LastLast

Advertisement