/lastkill and /lastdeath -
Luis54321 - 21.05.2014
Hey Guys,
I want to have the Commands /lastkill and /lastdeath to see which Player was killed from some outher Player.
Can you help me?
Sorry for my bad english iґm from Germany
Re: /lastkill and /lastdeath -
Rittik - 21.05.2014
Insert this code under OnPlayerDeath
Код:
SendDeathMessage(killerid,playerid,reason);
AW: /lastkill and /lastdeath -
Luis54321 - 21.05.2014
I know that Code but i donґt want it on the left site
I want it with an Command for Admin
Re: /lastkill and /lastdeath -
JFF - 21.05.2014
And onplayerdeath
pawn Код:
lastkillid = killerid;
lastdeathid = playerid;
pawn Код:
CMD:lastkill(playerid, params[])
{
new string[128];
format(string,sizeof(string),"Last Kill: %s(%d)",GetName(lastkillid),lastkillid);
SendClientMessage(playerid, -1, string);
return 1;
}
CMD:lastdeath(playerid,params[])
{
new string[128];
format(string,sizeof(string),"Last Death: %s(%d)",GetName(lastdeathid),lastdeathid);
SendClientMessage(playerid,-1,string);
return 1;
}
pawn Код:
stock GetName(playerid)
{
new getthename[MAX_PLAYER_NAME];
GetPlayerName(playerid,getthename,sizeof(getthename));
return getthename;
}
Is that what u want?
AW: /lastkill and /lastdeath -
Luis54321 - 21.05.2014
Yes but for for every player with /lastkill [ID] and than <Killer> has killed <Name>
and /lastdeath [ID] <User> was killed from <Killer>
Re: /lastkill and /lastdeath -
JFF - 21.05.2014
OnPlayerDeath
pawn Код:
lastkillid[playerid] = killerid;
pawn Код:
CMD:lastdeath(playerid, params[])
{
new string[128];
new ID;
if(sscanf(params,"u", ID)) return SendClientMessage(playerid,-1,"USAGE: /lastkill <PlayerName/ID>");
format(string,sizeof(string),"%s(%d) was killed by %s(%d)",GetName(ID),ID,GetName(lastkillid),lastkillid);
SendClientMessage(playerid, -1, string);
return 1;
}
That what u want?
AW: /lastkill and /lastdeath -
Luis54321 - 21.05.2014
Yes and with /lastkill too
Re: /lastkill and /lastdeath -
JFF - 21.05.2014
pawn Код:
lastdeathid[MAX_PLAYERS];
lastkillid[MAX_PLAYERS];
Onplayerdeath
pawn Код:
lastdeathid[killerid] = playerid;
lastkillid[playerid] = killerid;
pawn Код:
CMD:lastdeath(playerid, params[])
{
new string[128];
new ID;
if(sscanf(params,"u", ID)) return SendClientMessage(playerid,-1,"USAGE: /lastkill <PlayerName/ID>");
format(string,sizeof(string),"%s(%d) was killed by %s(%d)",GetName(ID),ID,GetName(lastkillid),lastkillid);
SendClientMessage(playerid, -1, string);
return 1;
}
CMD:lastkill(playerid, params[])
{
new string[128];
new ID;
if(sscanf(params,"u", ID)) return SendClientMessage(playerid,-1,"USAGE: /lastkill <PlayerName/ID>");
format(string,sizeof(string),"%s(%d) has killed %s(%d)",GetName(ID),ID,GetName(lastdeathid),lastdeathid);
SendClientMessage(playerid, -1, string);
return 1;
}
AW: /lastkill and /lastdeath -
Luis54321 - 21.05.2014
Can you do it with strcmp and the adminvar is
if(PlayerInfo[playerid][pAdmin] >= 1337) please?
Re: /lastkill and /lastdeath -
JFF - 21.05.2014
i am not good at strcmp buy ill give it a try
and why are u still using strcmp when theres zcmd and ycmd etc..
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
if(!strcmp(cmdtext, "/lastkill", true, 9))
{
new string[128];
new ID;
if(PlayerInfo[playerid][pAdmin] >= 1337) return SendClientMessage(playerid,-1,"You are not high enough to use this command");
if(!sscanf(cmdtext[10], "u", ID))
{
format(string,sizeof(string),"%s(%d) was killed by %s(%d)",GetName(ID),ID,GetName(lastkillid),lastkillid);
SendClientMessage(playerid, -1, string);
return 1;
}
SendClientMessage(playerid, -1, "USAGE: /Example <PlayerName/ID>");
return 1;
}
return 0;
}
same goes for the lastdeath