little problem
#1

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);
Reply
#2

Show us GetName?
Reply
#3

Here you go

Код:
stock GetName(playerid)
{
	new JName[MAX_PLAYER_NAME];
	GetPlayerName(playerid,JName,MAX_PLAYER_NAME);
	return JName;
}
Reply
#4

Where does killerid come from?
Reply
#5

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"
Reply
#6

I guess the /kill command is a suicide command? Well why not use this:

pawn Код:
if(killerid == playerid){
GameTextForPlayer(playerid,"You commited suicide...", 2000,4);
}
Reply
#7

killerid is the player who is killing and the playerid is the one who is getting killed by the killerid.
Reply
#8

Quote:
Originally Posted by iZN
Посмотреть сообщение
killerid is the player who is killing and the playerid is the one who is getting killed by the killerid.
Yes, so if he is doing /kill then he should be both the killer and the one who is killed, right? Otherwise he could just create his own function and override the /kill command.
Reply
#9

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;
}
Reply
#10

Quote:
Originally Posted by gotwarzone
Посмотреть сообщение
EDIT: Alonzo you're right. It just need to overdrive the /kill command

Код:
CMD:kill(playerid, params[])
{
	SetPlayerHealth(playerid, 0);
	return 1;
}
Great, so the problem is solved now?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)