SA-MP Forums Archive
Simple killerid problem - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Simple killerid problem (/showthread.php?tid=244815)



Simple killerid problem - nejc001 - 28.03.2011

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;
}



Re: Simple killerid problem - Jochemd - 28.03.2011

Yes, it needs to be killerid.


Re: Simple killerid problem - GNGification - 28.03.2011

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


Re: Simple killerid problem - nejc001 - 29.03.2011

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..


Re: Simple killerid problem - Mr_Scripter - 29.03.2011

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

    return 0;
}


Re: Simple killerid problem - nejc001 - 29.03.2011

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?


Re: Simple killerid problem - nejc001 - 02.04.2011

bump =/


Re: Simple killerid problem - nejc001 - 09.04.2011

bump


Re: Simple killerid problem - nejc001 - 16.04.2011

bump


Re: Simple killerid problem - nejc001 - 23.04.2011

bump