Who killed Who script. really need help
#1

hey guyz,
i need a script that says who killed who with what weapon like this:
http://imageshack.us/photo/my-images/580/fakedeath.jpg/

Only this above is a fakedeath command on my server.
This is what much servers have so yeah...

Sorry if bad English but im Dutch.
THNX for interest and maybe helping
Reply
#2

pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
    new name[MAX_PLAYER_NAME];
    new string[256];
    new deathreason[20];
    GetPlayerName(playerid, name, sizeof(name));
    GetWeaponName(reason, deathreason, 20);
    if (killerid == INVALID_PLAYER_ID)
    {
        switch (reason)
        {
            case WEAPON_DROWN:
            {
                format(string, sizeof(string), "*** %s drowned.)", name);
            }
            default:
            {
                if (strlen(deathreason) > 0)
                {
                    format(string, sizeof(string), "*** %s died. (%s)", name, deathreason);
                }
                else
                {
                    format(string, sizeof(string), "*** %s died.", name);
                }
            }
        }
    }
    else
    {
    new killer[MAX_PLAYER_NAME];
    GetPlayerName(killerid, killer, sizeof(killer));
    if (strlen(deathreason) > 0)
    {
        format(string, sizeof(string), "*** %s killed %s. (%s)", killer, name, deathreason);
    }
    else
    {
        format(string, sizeof(string), "*** %s killed %s.", killer, name);
    }
        SendClientMessageToAll(-1, string);
    }
    return 1;
}
Reply
#3

@Russell_
i get this error:

D:\Documents and Settings\ben\Mijn documenten\SAMP Server\gamemodes\LSF4A.pwn(451) : warning 217: loose indentation

line:
Код:
        SendClientMessageToAll(-1, string);
idk how to fix it
Reply
#4

okay found it there was 1 tab to much at that line
@Russull_
THNX for helping
Reply
#5

You're Welcome.
Reply
#6

@Russell_
i have only one thing.
i just tested the script and it works only it is a clientmessage and i mean when someone kills another that theres on the right of the screen a thing like this:
http://imageshack.us/photo/my-images/580/fakedeath.jpg/
Reply
#7

public OnPlayerDeath(playerid, killerid, reason)
{
SendDeathMessage(killerid, playerid, reason);
return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)