[FilterScript] Advanced Killingspree System!
#1



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.

Reply
#2

Pretty nice.
Reply
#3

Thanks, it's pretty simple and clean.
Reply
#4

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.
Reply
#5

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

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

Edit: Nice script
Reply
#7

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.
Reply
#8

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.
Reply
#9

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.
Reply
#10

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.
Reply
#11

Nice Script.
Reply
#12

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

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

Looks Nice
Reply
#14

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.
Reply
#15

pretty cool
Reply
#16

nice work
Reply
#17

updated
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)