I'm trying to make msg according with death reason
#1

yo, I did this code :

Код:
public OnPlayerDeath(playerid, killerid, reason)
{
	
	ResetPlayerMoney(playerid);
	ResetPlayerWeapons(playerid);
	SendDeathMessage(killerid, playerid, reason);
	SendDeathMessage(playerid, reason);
	GivePlayerMoney(killerid, 10000);

	if(reason >= 1 || reason <= 46)
	{
    new string[156],pName[30],pName2[30];
	GetPlayerName(playerid, pName, 30);
	GetPlayerName(killerid, pName2, 30);
	format(string,sizeof(string),"SERVER PVP: %s matou %s",pName2,pName);
	SendClientMessageToAll(COR_ADICIONAL, string);
	}
	else if(reason >= 47) {
	new string[156],pName3[30];
	GetPlayerName(playerid, pName3, 30);
	format(string,sizeof(string),"SERVER PVP : %s se matou / morreu por explosгo", pName3);
	SendClientMessageToAll(COR_ADICIONAL, string);
	return 1;
	}
	
	
	return 1;
}
but nothing happens =s . I wanna that first msg :Server pvp: %s matou %s (killerid killed the playerid). For the other, %s se matou / morreu na explosгo.For the first all weapons, which I found here
http://weedarr.wikidot.com/gunlist // (reason 1 till 46) and for the /kill command / explosion, the reason 47 till end, anyone? =s
Reply
#2

Someone..
Reply
#3

Are you killing yourself or someone else is killing you?
Reply
#4

both of them.
Reply
#5

pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
   
    ResetPlayerMoney(playerid);
    ResetPlayerWeapons(playerid);
    SendDeathMessage(killerid, playerid, reason);
    SendDeathMessage(playerid, reason);
    GivePlayerMoney(killerid, 10000);

    if(killerid != INVALID_PLAYER_ID)
    {
    new string[156],pName[30],pName2[30];
    GetPlayerName(playerid, pName, 30);
    GetPlayerName(killerid, pName2, 30);
    format(string,sizeof(string),"SERVER PVP: %s matou %s",pName2,pName);
    SendClientMessageToAll(COR_ADICIONAL, string);
    }
    else if(killerid == INVALID_PLAYER_ID) {
    new string[156],pName3[30];
    GetPlayerName(playerid, pName3, 30);
    format(string,sizeof(string),"SERVER PVP : %s se matou / morreu por explosгo", pName3);
    SendClientMessageToAll(COR_ADICIONAL, string);
    return 1;
    }
   
   
    return 1;
}
Reply
#6

Didn't work =d , according to this link : http://weedarr.wikidot.com/gunlist , the weapons which players kill each other are 0 till 46, and 47 till 201 are death reason, such as drive by, and helicoptery.I wanted to use a message for reason 0 till 46, and another to 47 till 201, this is the problem.
Reply
#7

Quote:
Originally Posted by felipex
Посмотреть сообщение
Didn't work =d , according to this link : http://weedarr.wikidot.com/gunlist , the weapons which players kill each other are 0 till 46, and 47 till 201 are death reason, such as drive by, and helicoptery.I wanted to use a message for reason 0 till 46, and another to 47 till 201, this is the problem.
It simply reads if someone died per killer, or not, if not, you will get the second message, if yes, you will get the first message. Or try to use something like SendDeathMessage
Reply
#8

I tried it, but if I use just one message on "onplayerdeath", it will be so : %s matou %s , but if it's through the command /kill, will be so : (...) matou %s, but as I said, I tried it : if(reason >= 0 || reason <= 46) and nothing :S
Reply
#9

if you dont know, just tell me death reason list site, or then, the starting code, such as that : if(reason...
Reply
#10

somebody, wtf lol u_u'
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)