OnPlayerDeath
#1

Hello!

I got this script;
Код:
 public OnPlayerDeath(playerid, killerid, reason)
{
	isInMg[playerid] = 0;
	SetPlayerPos(playerid, -1916.8977,293.7148,40.7085);
	SetPlayerVirtualWorld(playerid, 0);
	SetPlayerInterior(playerid, 0);
	SendClientMessage(playerid, lightgreen,"{B4B5B7}.: You've been removed from The Hunger Games. :.");
	new jstring[128];
	new playername[MAX_PLAYER_NAME];
	GetPlayerName(playerid, playername, sizeof(playername));
	format(jstring, sizeof(jstring), ".: {B4B5B7}( %s ) has died in The Hunger Games! The last man standing is the winner! {9ACD32}:.", playername);
	SendClientMessageToAll(lightgreen, jstring);
	SendDeathMessage(killerid, playerid, reason);
	GivePlayerMoney(playerid, 10000);
    return 1;
}
When a player dies, it says, for example; ( Kudoz ) has died in The Hunger Games! .... blah blah ", but I want it like, IF a player is "isInMg[playerid] = 1;", then it says that, but when it is "isInMg[playerid] = 0;" , then it will just SendDeathMessage. It was kinda hard to explain, but I hope you understood
Reply
#2

You should really learn how to check variables
pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
    if(isInMg[playerid] = 1)
    {
        isInMg[playerid] = 0;
        SetPlayerPos(playerid, -1916.8977,293.7148,40.7085);
        SetPlayerVirtualWorld(playerid, 0);
        SetPlayerInterior(playerid, 0);
        SendClientMessage(playerid, lightgreen,"{B4B5B7}.: You've been removed from The Hunger Games. :.");
        new jstring[128];
        new playername[MAX_PLAYER_NAME];
        GetPlayerName(playerid, playername, sizeof(playername));
        format(jstring, sizeof(jstring), ".: {B4B5B7}( %s ) has died in The Hunger Games! The last man standing is the winner! {9ACD32}:.", playername);
        SendClientMessageToAll(lightgreen, jstring);
        SendDeathMessage(killerid, playerid, reason);
        GivePlayerMoney(playerid, 10000);
    }
    return 1;
}
Reply
#3

Nice, thanks! But if they die outside the hunger games, will it SendDeathMessage?
Reply
#4

Yep, it will.
Reply
#5

Alright, thanks.
Reply
#6

pawn Код:
if(isInMg[playerid] == 1)
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)