Unreachable Code
#10

Quote:
Originally Posted by Blackazur
Посмотреть сообщение
I tested it it appear not on the Screen, the Public is "OnPlayerDeath", is the Problem that it is an Filterscript, should i add it in my main Gamemode?
For it to appear, you must have the killer and you yourself. Test it with someone, not by yourself alone.

Just for an example:
pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
    SendDeathMessage(killerid, playerid, reason); // Shows the kill in the killfeed/deathlog/death window
 
    if(killerid != INVALID_PLAYER_ID) // Valid killer, give cash+score
    {
        new str[24];
        format(str, sizeof(str), "+4000$, +2 Score");
        GameTextForPlayer(killerid,str,3000,3);
 
        GivePlayerMoney(killerid, +4000);
        GivePlayerScore(killerid, +2);
    }
 
    // Outside the check, handle stuff for playerid
    // if killerid was INVALID_PLAYER_ID the player killed themselves (i.e. falling)
    new st[24];
        format(st, sizeof(st), "You died -3000$!");
        GameTextForPlayer(playerid,st,3000,3);
    GivePlayerMoney(playerid, -3000);
   
   
   
    return 1;
}
Reply


Messages In This Thread
Unreachable Code - by Blackazur - 25.01.2013, 20:53
Re: Unreachable Code - by Roach_ - 25.01.2013, 20:58
AW: Unreachable Code - by Blackazur - 25.01.2013, 21:10
Re: Unreachable Code - by Roach_ - 25.01.2013, 21:13
AW: Unreachable Code - by Blackazur - 25.01.2013, 21:52
Re: Unreachable Code - by Neil. - 25.01.2013, 21:56
AW: Unreachable Code - by Blackazur - 25.01.2013, 22:01
Re: AW: Unreachable Code - by Neil. - 25.01.2013, 22:07
AW: Unreachable Code - by Blackazur - 25.01.2013, 22:11
Re: AW: Unreachable Code - by Neil. - 25.01.2013, 22:15

Forum Jump:


Users browsing this thread: 2 Guest(s)