[FilterScript] [FS] Simple Script for Stuntserver by Schock
#9

Alright, very nice filterscript, here is a improvement:

On OnPlayerDeath you are creating the string each time, you could save a few more bytes by easily creating it once, so it would look like:

pawn Code:
public OnPlayerDeath(playerid, killerid, reason)
{
    new string[128], player[MAX_PLAYER_NAME];
    if(GetPlayerWeapon(killerid) == 38)
    {
        GetPlayerName(playerid, player, sizeof(player));

        format(string, sizeof(string), "%s died! Server Banned his attacker (reason: Minigun)", player);
        SendClientMessageToAll(YELLOW, string);
        Ban(killerid);
    }
    // ...
instead of:
pawn Code:
public OnPlayerDeath(playerid, killerid, reason)
{
    if(GetPlayerWeapon(killerid) == 38)
    {
        new string[128], player[MAX_PLAYER_NAME];
        GetPlayerName(playerid, player, sizeof(player));

        format(string, sizeof(string), "%s died! Server Banned his attacker (reason: Minigun)", player);
        SendClientMessageToAll(YELLOW, string);
        Ban(killerid);
    }
    //....
Anyways, great filterscript

EDIT: This is no big deal though, its just that it saves bytes, thanks to Y_Less ;p
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 2 Guest(s)