How do I show the person I killed in my Chatbox
#1

I want it like this when I kill someone: You got 2 score for killing [Person I killed] That's all!

Here's my code:

public OnPlayerDeath(playerid, killerid, reason)
{
SendDeathMessage(killerid, playerid, reason);
SetPlayerPos(playerid, 2134.5957,1332.6907,10.8251);
SetPlayerScore(killerid,GetPlayerScore(killerid)+2 );
for(new i=0; i<19; i++) TextDrawHideForPlayer(playerid,HealthBar[i]);
GivePlayerMoney(killerid, 2500);
SendClientMessage(killerid, COLOR_LIGHTBLUE, "You got 2500 Cash and 2 Score for killing);
SendClientMessage(playerid, COLOR_BRIGHTRED, "You just got killed!");
SetPlayerFacingAngle(playerid,0);
Reply
#2

pawn Code:
new str[128],pName[MAX_PLAYER_NAME];
GetPlayerName(playerid, pName, sizeof(pName));
format(str, sizeof(str), "You got 2 points for killing %s!", pName);
SendClientMessage(killerid, COLOR_LIGHTBLUE, str);
This should do.
Reply
#3

Quote:
Originally Posted by Eminem 2ka9
View Post
I want it like this when I kill someone: You got 2 score for killing [Person I killed] That's all!

Here's my code:

public OnPlayerDeath(playerid, killerid, reason)
{
SendDeathMessage(killerid, playerid, reason);
SetPlayerPos(playerid, 2134.5957,1332.6907,10.8251);
SetPlayerScore(killerid,GetPlayerScore(killerid)+2 );
for(new i=0; i<19; i++) TextDrawHideForPlayer(playerid,HealthBar[i]);
GivePlayerMoney(killerid, 2500);
SendClientMessage(killerid, COLOR_LIGHTBLUE, "You got 2500 Cash and 2 Score for killing);
SendClientMessage(playerid, COLOR_BRIGHTRED, "You just got killed!");
SetPlayerFacingAngle(playerid,0);
pawn Code:
public OnPlayerDeath( playerid, killerid, reason )
{
    SendDeathMessage( killerid, playerid, reason );
   
    SetPlayerPos( playerid, 2134.5957,1332.6907,10.8251 );
   
    SetPlayerScore( killerid,GetPlayerScore(killerid)+2 );
    for(new i=0; i<19; i++) TextDrawHideForPlayer(playerid,HealthBar[i]);
    GivePlayerMoney(killerid, 2500);
   
    new szName[ MAX_PLAYER_NAME ], szStr[ 60 ];
   
    GetPlayerName( playerid, szName, sizeof( szName ) );
   
    format( szStr, sizeof( szStr ), "You got +2 score for killing %s", szName ); // change this message to your own
   
    SendClientMessage( killerid, COLOR_LIGHTBLUE, szStr );
   
    SendClientMessage(playerid, COLOR_BRIGHTRED, "You just got killed!");
   
    SetPlayerFacingAngle(playerid,0);
Wow, I am late lol.

Hope this helps mate.

Regards,
FalconX
Reply
#4

Wow thanks, damn these forums are awesome!
Reply
#5

Quote:
Originally Posted by Eminem 2ka9
View Post
Wow thanks, damn these forums are awesome!
Glad it helped you mate!
Reply
#6

Quote:
Originally Posted by Eminem 2ka9
View Post
Wow thanks, damn these forums are awesome!
You're welcome
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)