killing medals script
#1

hi i'm searching a killing medal script or if can some one give me an idea about how to creat one
when i say killing medal is for example
1 kill = first kill
2 kills in a row = double kill
3 kills in a row = triple kill
4 kills in a row = kill tacular
4 kills in a row = killing spree
5 kills in a row = kill frenzy
6 kills in a row = kill atrocity
7 kills in a row = kill manjarow
8 kills in a row = killtastrophe
9 kills in a row = untouchable
10 kills in a row = killionaire
(halo medals lol )
hop that you understand what i mean
Reply
#2

Full filterscript, I just made it on my own .
I made it when you get 2 or more kills, you get spree counting, because it's stupid to put for 1 kill lol.

Just paste this into a new, blank filterscript, compile, and use.

pawn Код:
// Killing spree system by Mean
#include < a_samp >

new gPlayerKills[ MAX_PLAYERS ];

public OnPlayerConnect( playerid ) return gPlayerKills[ playerid ] = 0;

public OnPlayerDeath( playerid, killerid, reason )
{
    new string[ 70 ], name[ 24 ];
    GetPlayerName( killerid, name, 24 );
    gPlayerKills[ killerid ]++;
    gPlayerKills[ playerid ] = 0;
    if( gPlayerKills[ killerid ] == 2 ) format( string, sizeof string, "%s made a double kill! ", name );
    if( gPlayerKills[ killerid ] == 3 ) format( string, sizeof string, "%s made a triple kill! ", name );
    if( gPlayerKills[ killerid ] == 4 ) format( string, sizeof string, "%s is on a killing spree! ", name );
    if( gPlayerKills[ killerid ] == 5 ) format( string, sizeof string, "%s is a kill frenzy! ", name );
    if( gPlayerKills[ killerid ] == 6 ) format( string, sizeof string, "%s is a kill atrocity!", name );
    if( gPlayerKills[ killerid ] == 7 ) format( string, sizeof string, "%s is a kill manjarow!", name );
    if( gPlayerKills[ killerid ] == 8 ) format( string, sizeof string, "%s is a killtastrophe!", name );
    if( gPlayerKills[ killerid ] == 9 ) format( string, sizeof string, "%s is untouchable!", name );
    if( gPlayerKills[ killerid ] == 10 ) format( string, sizeof string, "%s is a killionaire!", name );
    if( gPlayerKills[ killerid ] > 10 ) format( string, sizeof string, "%s is still a killionaire! ( %d kills )", name, gPlayerKills[ killerid ] );
    // You can add more :D.
    return SendClientMessageToAll( 0xAAAAAA, string );
}

public OnPlayerCommandText( playerid, cmdtext[ ] )
{
    if( !strcmp( cmdtext, "/spree", true, 6 ) || !strcmp( cmdtext, "/streak", true, 7 ) )
    {
        new str[ 55 ];
        format( str, sizeof str, "You are currently on a killing spree of %d kills.", gPlayerKills[ playerid ] );
        return SendClientMessage( playerid, 0xAAAAAA, str );
    }
    return 0;
}
Easy .

EDIT: Note that it's untested, but it should work, I can't find anything wrong .
Reply
#3

You can use a filterscript
Reply
#4

Quote:
Originally Posted by admigo
Посмотреть сообщение
You can use a filterscript
Actually, the script I posted is a filterscript o_O.
Reply
#5

LOL sorry i diddnt know
Reply
#6

Quote:
Originally Posted by Mean
Посмотреть сообщение
Actually, the script I posted is a filterscript o_O.
i just mad one ... vrey very short one & simple tell me what you think about it pls
Код:
public OnPlayerSpawn(playerid)
{
      SetPVarInt(playerid, "kills", 0);
}
public OnPlayerDeath(playerid, killerid, reason)
{
        if(team[playerid] == 2)
	{
		SetPVarInt(killerid, "kills", GetPVarInt(killerid, "kills")+1);
		if (GetPVarInt(killerid, "kills") == 2) Audio_Play(killerid, 1, false, false, false);
		if (GetPVarInt(killerid, "kills") == 3) Audio_Play(killerid, 4, false, false, false);
		if (GetPVarInt(killerid, "kills") == 4) Audio_Play(killerid, 2, false, false, false);
		if (GetPVarInt(killerid, "kills") == 5) Audio_Play(killerid, 6, false, false, false);
		if (GetPVarInt(killerid, "kills") >= 6) Audio_Play(killerid, 7, false, false, false);
         }
}
Reply
#7

That should work
Reply
#8

Make use of the switch function, damn. I find it so ugly when people have scripts that are filled with useless if statements.
Reply
#9

Quote:
Originally Posted by Vince
Посмотреть сообщение
Make use of the switch function, damn. I find it so ugly when people have scripts that are filled with useless if statements.
what's the unless function in my script
Reply
#10

He means:
pawn Код:
switch( GetPVarInt( killerid, "kills" ) )
{
    case 2: // 2 kills
    {
        // Stuff here
    }
    case 3: // 3 kills
    {
        // stuff here
    }
    // ETC
}
Instead of
pawn Код:
if( GetPVarInt( killerid, "kills" ) == 2 )
{
    // Stuff here
}
if( GetPVarInt( killerid, "kills" ) == 3 )
{
    // Stuff here
}
// ETC
I prefer IFs, I use switch only in dialogs and stuff, since it's just abit faster.
Also, you forgot to put OnPlayerDeath
pawn Код:
SetPVarInt( playerid, "kills", 0 );
So if player dies, his spree gets restarted.

EDIT: Nevermind, you reset it in OnPlayerSpawn..
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)