Give money at kill
#1

Hi everyone, so i have a Zombie Mod server but i wan't that if a player kills another player, he earns money, but the killed guy doesn't lose his money.
So how can i do that, could you explain me please?
I'm french but i try to speak in an acceptable english so sorry for my errors ^^
Here is my OnPlayerDeath :

Код:
public OnPlayerDeath(playerid, killerid, reason)
{

	if(oncp[playerid] == 1)
	{
	  OnPlayerLeaveCheckpoint(playerid);
	}
  new string[128];
	new raisondelamort[20];
	GetWeaponName(reason, raisondelamort, 20);
  if (killerid == INVALID_PLAYER_ID)
	{
	SendDeathMessage(INVALID_PLAYER_ID,playerid,reason);

	if (reason == WEAPON_DROWN)
	{
	format(string, sizeof(string), "*** %s a coulй.", nom(playerid));
	}
	else {
	if (strlen(raisondelamort) > 0)
	{
	format(string, sizeof(string), "*** %s est tombй de haut. (%s)", nom(playerid), raisondelamort);
	}
	else {
	format(string, sizeof(string), "*** %s s'est tuй.", nom(playerid));
	}
	}
	amsg(Rouge, string);
}
  if(gTeam[playerid] == gTeam[killerid])
{
	msg(Blanc,playerid,"Attention ! Tu as tuй quelqu'un de ton йquipe!");
}
	else{
	format(string, sizeof(string), "$$$ Ah ah tu as tue %s $$$",nom(playerid));
	msg(killerid,Jaune, string);
	format(string, sizeof(string), "$$$ Tu t'es fait tuer par %s $$$",nom(killerid));
	msg(playerid,Bleu, string);
}
	SendDeathMessage(killerid,playerid,reason);
	format(string, sizeof(string), "%s vient de tuer %s avec un %s",nom(killerid), nom(playerid),raisondelamort);
	msg(killerid,Jaune, string);
	amsg(Rouge, string);
	return 1;
}
Reply
#2

pawn Код:
GivePlayerMoney(killerid,1000);
Add this to OnPlayerDeath
Reply
#3

Ok i will try thank you.
Reply
#4

It works! =D
Thank you very much!! =D
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)