[FilterScript] [VS] Killing Spree
#1

[CENTER][B]
my first filterscript

pawn Код:
#include <a_samp>

new file[256];
new kills[MAX_PLAYERS] = 0;
new n[MAX_PLAYERS][MAX_PLAYER_NAME+1];

public OnFilterScriptInit()
{
    print("\n--------------------------------------");
    print("VS - filterscript: Killing Spree");
    print("--------------------------------------\n");
    return 1;
}

public OnFilterScriptExit()
{
    return 1;
}

public OnPlayerDeath(playerid, killerid, reason)
{
    kills[playerid] ++;
    kills[playerid] =0;
    GetPlayerName(playerid,n[playerid],MAX_PLAYER_NAME);
   
    if(kills[killerid] == 1)
    {
        format(file, 128, "~r~( %s )\n 1 Kill", n[playerid]);
        GameTextForAll(file, 2000,3);
    }
    if(kills[killerid] == 2)
    {
        PlayAudioStreamForPlayer(playerid,"http://k003.kiwi6.com/hotlink/j60i1k2ki1/double_kill.mp3");//2 kills
        ClearPlayerChatBox(playerid);
        format(file, 128, "~r~( %s )\n 2 Kills", n[playerid]);
        GameTextForAll(file, 2000,3);
    }
    if(kills[killerid] == 3)
    {
        PlayAudioStreamForPlayer(playerid,"http://k003.kiwi6.com/hotlink/mxb5998qkx/thirple_kill.mp3");//3 kills
        ClearPlayerChatBox(playerid);
        format(file, 128, "~r~( %s )\n 3 Kills", n[playerid]);
        GameTextForAll(file, 2000,3);
    }
    if(kills[killerid] == 4)
    {
        PlayAudioStreamForPlayer(playerid,"http://k003.kiwi6.com/hotlink/1lx28y6247/kill_joy_kill.mp3");//4 kills
        ClearPlayerChatBox(playerid);
        format(file, 128, "~r~( %s )\n 4 Kills", n[playerid]);
        GameTextForAll(file, 2000,3);
    }
    if(kills[killerid] == 5)
    {
        PlayAudioStreamForPlayer(playerid,"http://k003.kiwi6.com/hotlink/n0a8cvk57g/killing_frezy_kill.mp3");//5 kills
        ClearPlayerChatBox(playerid);
        format(file, 128, "~r~( %s )\n 5 Kill", n[playerid]);
        GameTextForAll(file, 2000,3);
    }
    if(kills[killerid] == 6)
    {
        PlayAudioStreamForPlayer(playerid,"http://k003.kiwi6.com/hotlink/uj4qxc08gf/rampage_kill.mp3");//6 kills
        ClearPlayerChatBox(playerid);
        format(file, 128, "~r~( %s )\n 6 Kills", n[playerid]);
        GameTextForAll(file, 2000,3);
    }
    if(kills[killerid] == 7)
    {
        PlayAudioStreamForPlayer(playerid,"http://k003.kiwi6.com/hotlink/i9v5xhxj68/untouchable_kill.mp3");//7 kills
        ClearPlayerChatBox(playerid);
        format(file, 128, "~r~( %s )\n 7 Kills", n[playerid]);
        GameTextForAll(file, 2000,3);
    }
    if(kills[killerid] == 8)
    {
        PlayAudioStreamForPlayer(playerid,"http://k003.kiwi6.com/hotlink/770c0wse49/killpopo_kill.mp3");//8 kills
        ClearPlayerChatBox(playerid);
        format(file, 128, "~r~( %s )\n 8 Kills", n[playerid]);
        GameTextForAll(file, 2000,3);
    }
    if(kills[killerid] == 9)
    {
        PlayAudioStreamForPlayer(playerid,"http://k003.kiwi6.com/hotlink/mcws4ioj0q/runingriot_kill.mp3");//9 kills
        ClearPlayerChatBox(playerid);
        format(file, 128, "~r~( %s )\n 9 Kills", n[playerid]);
        GameTextForAll(file, 2000,3);
    }
    if(kills[killerid] == 10)
    {
        PlayAudioStreamForPlayer(playerid,"http://k003.kiwi6.com/hotlink/y19b1e586i/perfection_kill.mp3");//10 kills
        ClearPlayerChatBox(playerid);
        format(file, 128, "~r~( %s )\n 10 Kills", n[playerid]);
        GameTextForAll(file, 2000,3);
    }
    return 1;
}

stock ClearPlayerChatBox(playerid)
{
    SendClientMessage(playerid,0," ");
    SendClientMessage(playerid,0," ");
    SendClientMessage(playerid,0," ");
    SendClientMessage(playerid,0," ");
    SendClientMessage(playerid,0," ");
    SendClientMessage(playerid,0," ");
    SendClientMessage(playerid,0," ");
    SendClientMessage(playerid,0," ");
    SendClientMessage(playerid,0," ");
    SendClientMessage(playerid,0," ");
    SendClientMessage(playerid,0," ");
    SendClientMessage(playerid,0," ");
    SendClientMessage(playerid,0," ");
    SendClientMessage(playerid,0," ");
    SendClientMessage(playerid,0," ");
    SendClientMessage(playerid,0," ");
    SendClientMessage(playerid,0," ");
    SendClientMessage(playerid,0," ");
    SendClientMessage(playerid,0," ");
    SendClientMessage(playerid,0," ");
    return 1;
}
Reply
#2

Simple nice... not hardworking next time make something new that ppl will be horrified

edit: not discouraging or telling ur script is bad ... but i am telling that its easy to make but its ok that its ur first release
Reply
#3

thank you i guess
Reply
#4

heyy
Reply
#5

Nysh!

Simple
Reply
#6

im not VS but i know him if thats your question he asked me to post this for him
Reply
#7

pawn Код:
stock ClearPlayerChatBox(playerid)
{
    SendClientMessage(playerid,0," ");
    SendClientMessage(playerid,0," ");
    SendClientMessage(playerid,0," ");
    SendClientMessage(playerid,0," ");
    SendClientMessage(playerid,0," ");
    SendClientMessage(playerid,0," ");
    SendClientMessage(playerid,0," ");
    SendClientMessage(playerid,0," ");
    SendClientMessage(playerid,0," ");
    SendClientMessage(playerid,0," ");
    SendClientMessage(playerid,0," ");
    SendClientMessage(playerid,0," ");
    SendClientMessage(playerid,0," ");
    SendClientMessage(playerid,0," ");
    SendClientMessage(playerid,0," ");
    SendClientMessage(playerid,0," ");
    SendClientMessage(playerid,0," ");
    SendClientMessage(playerid,0," ");
    SendClientMessage(playerid,0," ");
    SendClientMessage(playerid,0," ");
    return 1;
}
Better:

pawn Код:
stock ClearPlayerChatBox(playerid)
{
for( new i = 0; i < MAX_PLAYERS; i++ )
{
SendClientMessage( i, -1, "" );
}
    return 1;
}
Reply
#8

Quote:
Originally Posted by MovieDrifting
Посмотреть сообщение
pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
    kills[playerid] ++;
    kills[playerid] =0;
mhm
Reply
#9

Quote:
Originally Posted by RaZzZzoR
Посмотреть сообщение
pawn Код:
stock ClearPlayerChatBox(playerid)
{
    SendClientMessage(playerid,0," ");
    SendClientMessage(playerid,0," ");
    SendClientMessage(playerid,0," ");
    SendClientMessage(playerid,0," ");
    SendClientMessage(playerid,0," ");
    SendClientMessage(playerid,0," ");
    SendClientMessage(playerid,0," ");
    SendClientMessage(playerid,0," ");
    SendClientMessage(playerid,0," ");
    SendClientMessage(playerid,0," ");
    SendClientMessage(playerid,0," ");
    SendClientMessage(playerid,0," ");
    SendClientMessage(playerid,0," ");
    SendClientMessage(playerid,0," ");
    SendClientMessage(playerid,0," ");
    SendClientMessage(playerid,0," ");
    SendClientMessage(playerid,0," ");
    SendClientMessage(playerid,0," ");
    SendClientMessage(playerid,0," ");
    SendClientMessage(playerid,0," ");
    return 1;
}
Better:

pawn Код:
stock ClearPlayerChatBox(playerid)
{
for( new i = 0; i < MAX_PLAYERS; i++ )
{
SendClientMessage( i, -1, "" );
}
    return 1;
}
This wont clear player's chatbox. Replace MAX_PLAYERS with 128 and i with playerid by SendClientMessage.
Reply
#10

Quote:
Originally Posted by RaZzZzoR
Посмотреть сообщение
Better:

pawn Код:
stock ClearPlayerChatBox(playerid)
{
for( new i = 0; i < MAX_PLAYERS; i++ )
{
SendClientMessage( i, -1, "" );
}
    return 1;
}
No, it's not better. It just takes less lines of code. If you compare the speed between his version and yours, his will be faster. Not to mention that yours doesn't even work, but I'm talking about the looping method.
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)