SA-MP Forums Archive
[HELP] Send Death Message With Weapon Name..? - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: [HELP] Send Death Message With Weapon Name..? (/showthread.php?tid=99104)



[HELP] Send Death Message With Weapon Name..? - TraNe15 - 25.09.2009

i need something like this when player death..
Код:
new gunname[32], string[64], fName[MAX_PLAYER_NAME], sName[MAX_PLAYER_NAME];
  GetWeaponName(reason,gunname,sizeof(gunname));
  GetPlayerName(playerid,fName,MAX_PLAYER_NAME);
  GetPlayerName(killerid,sName,MAX_PLAYER_NAME);
  format(string,sizeof(string),"%s got 1 point for killing %s. %s.",sName,fName,gunname);
But;
Код:
GetWeaponName(reason,gunname,sizeof(gunname));
Isn't work for me :S How can i send death message with weapon name? Or is my script true?

Like;
Код:
TraNe15 got 1 points for killing blabla. Weapon:Ak-47
Thanks For Helps...

-TraNe15-


Re: [HELP] Send Death Message With Weapon Name..? - MadeMan - 25.09.2009

Is this all of your script or do you have SendClientMessage too?


Re: [HELP] Send Death Message With Weapon Name..? - TraNe15 - 25.09.2009

Let me show it;

Код:
public OnPlayerDeath(playerid,killerid,reason)
{
  //Normal kill
  new gunname[32], string[64], fName[MAX_PLAYER_NAME], sName[MAX_PLAYER_NAME];
  GetWeaponName(reason,gunname,sizeof(gunname));
  GetPlayerName(playerid,fName,MAX_PLAYER_NAME);
  GetPlayerName(killerid,sName,MAX_PLAYER_NAME);
  format(string,sizeof(string),"%s got 1 point for killing %s. %s.",sName,fName,gunname);
  SendClientMessageToAll(COLOR_HL2,string);
  SetPlayerScore(killerid, GetPlayerScore(killerid) + 1);
  return 1;
}



Re: [HELP] Send Death Message With Weapon Name..? - matt2127 - 25.09.2009

GetWeaponName is bugged I believe, there is a variable/function sort that you can find in some GM's released on the forums which can help you bypass this .


Re: [HELP] Send Death Message With Weapon Name..? - TraNe15 - 25.09.2009

Do you know one? i dont want to downlaod all GM in sa-mp forum


Re: [HELP] Send Death Message With Weapon Name..? - MadeMan - 25.09.2009

Does your code send the message? If it does, what does it say?


Re: [HELP] Send Death Message With Weapon Name..? - TraNe15 - 25.09.2009

Yes it sends the message except weapon name.
It sends like this;
Код:
MadeMan got 1 point for killing TraNe15. .
(Just a dot)


-TraNe15-


Re: [HELP] Send Death Message With Weapon Name..? - MadeMan - 25.09.2009

What weapons did you try?


Re: [HELP] Send Death Message With Weapon Name..? - TraNe15 - 25.09.2009

Just /kill worked for me.. And i tried with barrels.. But i didnt try on a person.. Can you join my server for 1-2 minutes just for testing?


Re: [HELP] Send Death Message With Weapon Name..? - MadeMan - 25.09.2009

Quote:
Originally Posted by TraNe15
Just /kill worked for me.. And i tried with barrels.. But i didnt try on a person.. Can you join my server for 1-2 minutes just for testing?
Sure. What's the IP?