[Tutorial] KillFeed

Results 1 to 7 of 7
  1. #1
    Proficient Member rollwow is offline
    MemberRank
    Sep 2013 Join Date
    LisbonLocation
    153Posts

    [Tutorial] KillFeed

    Dear,
    I Received pm's about how i added killfeed to the src i'm testing so i searched in RZ about killfeed and don't have a tutorial only one the "Randomized killfeed" and the old tutorial about killfeed the guy just removed it so here the Tutorial hope everyone like it.


    Go to your warz_server.sln

    Search For this:

    Code:
    void ServerGameLogic::DoKillPlayer(GameObject* sourceObj, obj_ServerPlayer* targetPlr, STORE_CATEGORIES weaponCat, bool forced_by_server, bool fromPlayerInAir, bool targetPlayerInAir )

    Now you will see this line:

    // vars


    Below that add this code:


    Code:
        char plr2msg[128] = {0};  // Remove this line if you use src WarZTHSrc2
        if(IsServerPlayer(sourceObj))
    {
        obj_ServerPlayer * killedByPlr = ((obj_ServerPlayer*)sourceObj);
        if (targetPlr->profile_.CustomerID == killedByPlr->profile_.CustomerID)
    {
        sprintf(plr2msg, "Commit Suicide");
        char chatmessage[128] = {0};
        PKT_C2C_ChatMessage_s n;
        sprintf(chatmessage, "%s Suicided.",targetPlr->loadout_->Gamertag);
        r3dscpy(n.gamertag, "<System>");
        r3dscpy(n.msg, chatmessage);
        n.msgChannel = 1;
        n.userFlag = 2;
        p2pBroadcastToAll(NULL, &n, sizeof(n), true);
    }
    else
    {
        sprintf(plr2msg, "KILLED BY %s", killedByPlr->loadout_->Gamertag);
    // Enable this below to if you have "Player exp from my other tutorial"
    //gServerLogic.AddPlayerReward(killedByPlr, RWD_PlayerKill, 0);// the 0 can be removed if your not using "Allright source"
        char chatmessage[128] = {0};
        PKT_C2C_ChatMessage_s n;
        sprintf(chatmessage, "%s Killed By %s.",targetPlr->loadout_->Gamertag,killedByPlr->loadout_->Gamertag);
        r3dscpy(n.gamertag, "<System>");
        r3dscpy(n.msg, chatmessage);
        n.msgChannel = 1;
        n.userFlag = 2;
        p2pBroadcastToAll(NULL, &n, sizeof(n), true);
    }
    }
        else if(sourceObj->isObjType(OBJTYPE_Zombie))
    {
        sprintf(plr2msg, "EATEN BY ZOMBIE");
        char chatmessage[128] = {0};
        PKT_C2C_ChatMessage_s n;
        sprintf(chatmessage, "Zombies ate %s",targetPlr->loadout_->Gamertag);
        r3dscpy(n.gamertag, "<System>");
        r3dscpy(n.msg, chatmessage);
        n.msgChannel = 1;
        n.userFlag = 2;
        p2pBroadcastToAll(NULL, &n, sizeof(n), true);
    }
    else
    {
        sprintf(plr2msg, "Commit Suicide"); 
    }


    If you use a old Src like Education and you don't see the line // vars

    Serach for this:

    Code:
    r3dOutToLog("%s killed by %s, forced: %d\n", targetPlr->userName, sourceObj->Name.c_str(), (int)forced_by_server);

    And add the code below that.



    Hope it helps everyone.
    Don't forgot to Like me :)


  2. #2
    Banned MUIT0L0K0 is offline
    BannedRank
    Jan 2014 Join Date
    Colorado V2Location
    110Posts

    Re: [Tutorial] KillFeed

    My Code


    char message[64] = {0}; sprintf(message, "%s killed by %s", targetPlr->userName, sourceObj->Name.c_str());
    PKT_C2C_ChatMessage_s n2;
    n2.userFlag = 0;
    n2.msgChannel = 1;
    r3dscpy(n2.msg, message);
    r3dscpy(n2.gamertag, "<system>");
    for(int i=0; i<MAX_PEERS_COUNT; i++)
    {
    if(peers_[i].status_ >= PEER_PLAYING && peers_[i].player)
    {
    net_->SendToPeer(&n2, sizeof(n2), i, true);
    }
    }
    }

  3. #3
    Enthusiast promix is offline
    MemberRank
    Sep 2014 Join Date
    26Posts

    Re: [Tutorial] KillFeed

    Please help me :(
    Im using Vusion source (http://forum.ragezone.com/f790/relea...e-code-923017/)


  4. #4
    Harro Syxn is offline
    MemberRank
    Mar 2013 Join Date
    767Posts

    Re: [Tutorial] KillFeed

    Try this...

    p2pBroadcastToAll(&n, sizeof(n), true);

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

    Re: [Tutorial] KillFeed

    Quote Originally Posted by promix View Post
    Please help me :(
    Im using Vusion source (http://forum.ragezone.com/f790/relea...e-code-923017/)


    Try
    Code:
    /*NULL,*/

  6. #6
    Harro Syxn is offline
    MemberRank
    Mar 2013 Join Date
    767Posts

    Re: [Tutorial] KillFeed

    Quote Originally Posted by lukasccb View Post
    Try
    Code:
    /*NULL,*/
    Thats pretty much what i just said lol......?

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

    Re: [Tutorial] KillFeed

    Quote Originally Posted by Syxn View Post
    Thats pretty much what i just said lol......?
    Sorry, did not even read right to your opinion =\



Advertisement