Uhm how to...
#1

Well I am trying to make this
when a player dies he will receive a message
Quote:

You have been killed by KillerName.

KillerName < Name of the person that killed you.
Reply
#2

Add something like that under "OnPlayerDeath":

pawn Код:
SendClientMessage(playerid, COLOR_RED, "You have been killed by %s!", killerid);
Reply
#3

go to onplayerdeath
and get the name of the killerid and format and send the string
Reply
#4

pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
    new VictimName[24], KillerName[24], Msg[128];

    GetPlayerName(playerid, VictimName, sizeof(VictimName));
    GetPlayerName(killerid, KillerName, sizeof(KillerName));
    format(Msg, 128, "{FF0000}You've killed %s!", VictimName);
    SendClientMessage(killerid, 0xFFFFFFFF, Msg);
    format(Msg, 128, "{FF0000}%s has killed you!",KillerName);
    SendClientMessage(playerid, 0xFFFFFFFF, Msg);
    return 1;
}
Something like this would work.
Reply
#5

Ye, the other way would be like this:

pawn Код:
new deathstr [128];
format(deathstr, sizeof(deathstr), "You have been killed by %s!", killerid);
SendClientMessage(playerid, COLOR_RED);
Reply
#6

Quote:
Originally Posted by Twisted_Insane
Посмотреть сообщение
Add something like that under "OnPlayerDeath":

pawn Код:
SendClientMessage(playerid, COLOR_RED, "You have been killed by %s!", killerid);
Errmm, no. SendClientMessage is not a formatting function, and killerid isn't a string....
Reply
#7

Sorry, was a little confused! With which parameter would you define "killerid" then? Also, look at my second post...I've formatted the string and combinated it with SCM there.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)