SA-MP Forums Archive
[FilterScript] Advanced Killingspree System! - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Filterscripts (https://sampforum.blast.hk/forumdisplay.php?fid=17)
+--- Thread: [FilterScript] Advanced Killingspree System! (/showthread.php?tid=275008)



Simple Killingspree System! - Chrillzen - 08.08.2011



Hi, I made this killingspree system, it's very simple. You have the tripple kill, mega kill, ultra kill and monster kill. Everytime you get a kill a gametext appears "Tripple Kill" or whatever. You get rewards for every killing spree like money and cookies. You can type /eat to eat a cookie. Eating a cookie will give you thirty health. You need to wait fifteen seconds between eating each cookie.

NOTE: Tested, fully working.




Re: Advanced Killingspree System! - TheArcher - 08.08.2011

Pretty nice.


Re: Advanced Killingspree System! - Chrillzen - 08.08.2011

Thanks, it's pretty simple and clean.


Re: Advanced Killingspree System! - Kitten - 08.08.2011

nice , but i don't get why you call it "Advanced" when there's noting in the script that make's it advanced and also the indentation is horrible.


Re: Advanced Killingspree System! - Chrillzen - 08.08.2011

Okay, show me a correct indention and i'll correct it.


Re: Advanced Killingspree System! - KeeDee - 08.08.2011

haha chrillzen w'sup that me salut693 so unban me from gang wars XD

Edit: Nice script


Re: Advanced Killingspree System! - Chrillzen - 08.08.2011

Quote:
Originally Posted by KeeDee
Посмотреть сообщение
haha chrillzen w'sup that me salut693 so unban me from gang wars XD

Edit: Nice script
Thanks and i don't play there anymore i just let the server be up until the host ends.

PM me if you want it for free.


Re: Advanced Killingspree System! - wups - 08.08.2011

Found a big bug.
Let's say, kill[killerid]=9;
pawn Код:
if(kill[killerid] >= 2) {
        SendClientMessage(killerid,COLOR_GREEN,"One more kill and you'll get tripple kill!");
    }
    if(kill[killerid] >= 3) {
        SendClientMessage(killerid,COLOR_GREEN,"You killed three players you got $10,000, 1 cookie and 20+ health!");
        new string[50];
        PlayerPlaySound(killerid, 1185, 258.4893,-41.4008,1002.0234);
        format(string, sizeof(string), "~w~tripple~r~kill");
        GameTextForPlayer(killerid, string, 3000, 6);
        SetPlayerHealth(killerid,Health+20);
        cookies[playerid] += 1;
        GivePlayerMoney(killerid, 10000);
    }
    if(kill[killerid] >= 5) {
        SendClientMessage(killerid,COLOR_GREEN,"One more kill and you'll get mega kill!");
    }
    if(kill[killerid] >= 6) {
        SendClientMessage(killerid,COLOR_GREEN,"Mega kill, you got 30,000, 2 cookies and 20+ health!");
        new string[50];
        PlayerPlaySound(killerid, 1185, 258.4893,-41.4008,1002.0234);
        format(string, sizeof(string), "~w~mega~r~kill");
        GameTextForPlayer(killerid, string, 3000, 6);
        SetPlayerHealth(killerid,Health+20);
        cookies[playerid] += 2;
        GivePlayerMoney(killerid, 30000);
    }
    if(kill[killerid] == 8) {
        SendClientMessage(killerid,COLOR_GREEN,"One more kill and you'll get ultra kill!");
    }
    if(kill[killerid] == 9) {
        SendClientMessage(killerid,COLOR_GREEN,"Ultra kill, you got 50,000, 3 cookies and 50+ health!");
        PlayerPlaySound(killerid, 1185, 258.4893,-41.4008,1002.0234);
        SetPlayerHealth(killerid,Health+50);
        cookies[playerid] += 3;
        new string[50];
        format(string, sizeof(string), "~w~ultra~r~kill");
        GameTextForPlayer(killerid, string, 3000, 6);
        GivePlayerMoney(killerid, 50000);
    }
kill[killerid] >= 2 ? True.
kill[killerid] >= 3 ? Also true.
....
So you will get money for all true statements, not to mention the flood about 1 more kill bla bla bla.
You should switch to Switch function.
pawn Код:
switch(kill[killerid])
{
    case 2:
   {
        SendClientMessage(killerid,COLOR_GREEN,"One more kill and you'll get tripple kill!");
    }
    case 3:
    {
        SendClientMessage(killerid,COLOR_GREEN,"You killed three players you got $10,000, 1 cookie and 20+ health!");
        new string[50];
        PlayerPlaySound(killerid, 1185, 258.4893,-41.4008,1002.0234);
        format(string, sizeof(string), "~w~tripple~r~kill");
        GameTextForPlayer(killerid, string, 3000, 6);
        SetPlayerHealth(killerid,Health+20);
        cookies[playerid] += 1;
        GivePlayerMoney(killerid, 10000);
    }
    case 5:
   {
        SendClientMessage(killerid,COLOR_GREEN,"One more kill and you'll get mega kill!");
    }
    case 6:
    {
        SendClientMessage(killerid,COLOR_GREEN,"Mega kill, you got 30,000, 2 cookies and 20+ health!");
        new string[50];
        PlayerPlaySound(killerid, 1185, 258.4893,-41.4008,1002.0234);
        format(string, sizeof(string), "~w~mega~r~kill");
        GameTextForPlayer(killerid, string, 3000, 6);
        SetPlayerHealth(killerid,Health+20);
        cookies[playerid] += 2;
        GivePlayerMoney(killerid, 30000);
    }
    ..........
}
Another bug:
GetPlayerHealth(playerid,Health); GetPlayerArmour(playerid,Armour);
Your finding the playerid health, and setting it to the killerid.


Re: Advanced Killingspree System! - Lorenc_ - 08.08.2011

rather than that I just made some small include, I wont bother releasing it, such a small script..

killstreak.inc
pawn Код:
/*
 *      Killstreak .inc by Lorenc
 *
 *      - For newbs that cannot be bothered to setup killstreak variables and stuff...
 *      - IS SO COOL!
 *
 *
*/


#include                        <a_samp>

#define KS_SHOW_WA_HAPPEN

#define KILLSTREAK_VAR          "killstreak_Killstreak"

forward KillstreakData(playerid, killstreak);

public OnPlayerDeath(playerid, killerid, reason)
{
    SetPVarInt( killerid, KILLSTREAK_VAR, GetPVarInt( killerid, KILLSTREAK_VAR ) + 1 );
    CallLocalFunction( "KillstreakData", "ddd", killerid, GetPVarInt( killerid, KILLSTREAK_VAR ), playerid);
    SetPVarInt( playerid, KILLSTREAK_VAR, 0 );
    return CallLocalFunction( "killstreak_OnPlayerDeath", "ddd", playerid, killerid, reason );
}

#if defined _ALS_OnPlayerDeath
    #undef OnPlayerDeath
#else
    #define _ALS_OnPlayerDeath
#endif
#define OnPlayerDeath killstreak_OnPlayerDeath
forward killstreak_OnPlayerDeath( playerid, killerid, reason );
Haven't tested it though should work, all you do is:

pawn Код:
public KillstreakData(playerid, killstreak, endedksplayer)
{
    /*
        - playerid = the person that made this call back call
        - killstreak = what killstreak he is on
        - endedksplayer = the player 'playerid' has killed to end there ks
    */

    switch(killstreak)
    {
        case 1: {} // KS 1
        case 2: {} // KS 2
        case 3: {} // KS 3
        case 4: {} // KS 4
    }
    return 1;
}
Its more tidy though because it uses PVars it'll be slightly inefficient, the point is I don't wanna hook so many functions to reset a variable..

Players can use this inside there GM without even the filterscript.


Re: Advanced Killingspree System! - Chrillzen - 08.08.2011

Quote:
Originally Posted by wups
Посмотреть сообщение
not to mention the flood about 1 more kill bla bla bla.
Flood? I would not call it flood, not everybody gets to monster kill, it's kind of hard.
Btw i made this fs simple, so newer players can look at the code and understand it.
And sorry for bugs it was like 4 Am when i realesed it.


Re: Advanced Killingspree System! - Davz*|*Criss - 08.08.2011

Nice Script.


Re: Advanced Killingspree System! - Chrillzen - 08.08.2011

Ok, i remade it using switch, it works great.

BTW: Just leave a suggestion and i'll make it.


Re: Advanced Killingspree System! - Kerlan - 07.10.2011

Looks Nice


Re: Advanced Killingspree System! - Lordzy - 24.03.2012

Nice system.
Quote:
Originally Posted by Chrillzen
Посмотреть сообщение
Flood? I would not call it flood, not everybody gets to monster kill, it's kind of hard.
Lol, I always get when I play.
I'm not bad in duels.


Re: Advanced Killingspree System! - mickos - 13.07.2012

pretty cool


Re: Advanced Killingspree System! - Er@x3r - 12.10.2012

nice work


Re: Advanced Killingspree System! - Chrillzen - 11.03.2014

updated