Simple killerid problem
#1

So i want to make, when a player writes a command, it should show after then when somebody dies, that player killed him..
Example:
pawn Код:
new murderer[MAX_PLAYERS];
pawn Код:
if (strcmp("/rofl", cmdtext, true, 10) == 0)
    {
    murderer[playerid] = 1;
        return 1;
    }
pawn Код:
// NOW IN NEED HELP IN THIS LINE, killer should be that player who wrote /rofl
public OnPlayerDeath(playerid, killerid, reason)
{
        if(murderer[playerid] == 1) //should here be killerid?
        {
        SendDeathMessage(killerid,playerid, reason);
    }
    return 1;
}
Reply
#2

Yes, it needs to be killerid.
Reply
#3

pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
        if(murderer[killerid] == 1)
        {
                SendDeathMessage(killerid,playerid, reason);
}
return 1;
}
Hope that works
Reply
#4

pawn Код:
#include <a_samp>
#include <core>
#include <float>

#pragma tabsize 0
new nuker[MAX_PLAYERS];
main()
{
    print("\n----------------------------------");
    print("  Bare Script\n");
    print("----------------------------------\n");
}

public OnPlayerConnect(playerid)
{
    GameTextForPlayer(playerid,"~w~SA-MP: ~r~Bare Script",5000,5);
    return 1;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
    new idx;
    new cmd[256];
   
    cmd = strtok(cmdtext, idx);

    if(strcmp(cmd, "/kill", true) == 0)
        {
        nuker[playerid] = 1;
        SetPlayerHealth(playerid,0.0);
        return 1;
        }

    return 0;
}

public OnPlayerSpawn(playerid)
{
    SetPlayerInterior(playerid,0);
    TogglePlayerClock(playerid,0);
    return 1;
}

public OnPlayerDeath(playerid, killerid, reason)
{
    if(nuker[killerid] == 1)
        {
        SendDeathMessage(killerid,playerid, reason);
        }
    return 1;
}
// other stuff
this doesnt work, it doesnt appear on kill list.. and i just tried this GM without other FS's..
Reply
#5

what "Nuker?" lol kill cmd?
pawn Код:
if(strcmp(cmd, "/kill", true) == 0)
        {
        SetPlayerHealth(playerid,0.0);
        return 1;
        }

    return 0;
}
Reply
#6

Quote:
Originally Posted by Mr_Scripter
Посмотреть сообщение
what "Nuker?" lol kill cmd?
pawn Код:
if(strcmp(cmd, "/kill", true) == 0)
        {
        SetPlayerHealth(playerid,0.0);
        return 1;
        }

    return 0;
}
what? explanation please?
Reply
#7

bump =/
Reply
#8

bump
Reply
#9

bump
Reply
#10

bump
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)