Posts: 512
Threads: 121
Joined: Sep 2013
I don't understand why when I do /kill it still show "You were killed by" but without a name and without a killer coz obviously I did /kill. And for the gametext there should have no gametext will apear when I do /kill, how?
OnPlayerDeath
Код:
new Batz[128];
format(Batz, sizeof(Batz), "~r~You were killed by ~y~%s", GetName(killerid)); //If Death Show Killer Id
GameTextForPlayer(playerid,Batz, 2000,4);
format(Batz, sizeof(Batz), "~g~You killed %s ~y~+ $2500", GetName(playerid)); //Show Victims name
GameTextForPlayer(killerid,Batz, 2000,4);
Posts: 512
Threads: 121
Joined: Sep 2013
Here you go
Код:
stock GetName(playerid)
{
new JName[MAX_PLAYER_NAME];
GetPlayerName(playerid,JName,MAX_PLAYER_NAME);
return JName;
}
Posts: 532
Threads: 12
Joined: Oct 2013
Reputation:
0
Where does killerid come from?
Posts: 512
Threads: 121
Joined: Sep 2013
Quote:
Originally Posted by AlonzoTorres
Where does killerid come from?
|
it came from
Код:
public OnPlayerDeath(playerid, killerid, reason)
I wonder why I became a killer when I do /kill
Edit: actually not a killer coz if I am the killer it will show like
"You were killed by mynamehere"
Posts: 2,368
Threads: 27
Joined: Jun 2010
Reputation:
0
killerid is the player who is killing and the playerid is the one who is getting killed by the killerid.
Posts: 512
Threads: 121
Joined: Sep 2013
On topic now. I just want to remove and fix the "You were killed by" when I use /kill - suicide. Thats all mate. I made a ss to understand fully.
Код:
new Batz[128];
format(Batz, sizeof(Batz), "~r~You were killed by ~y~%s", GetName(killerid)); //If Death Show Killer Id
GameTextForPlayer(playerid,Batz, 2000,4);
format(Batz, sizeof(Batz), "~g~You killed %s ~y~+ $2500", GetName(playerid)); //Show Victims name
GameTextForPlayer(killerid,Batz, 2000,4);
EDIT: Alonzo you're right. It just need to overdrive the /kill command
Код:
CMD:kill(playerid, params[])
{
SetPlayerHealth(playerid, 0);
return 1;
}