onplayerdeath message
#1

Hello Ive been trying to add this code to onplayerdeath but I get constantly errors! Can you help me put this together?

pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
    FadePlayerScreen(playerid, 0xFFFFFFCC, 6, 192);
    GameTextForPlayer(playerid,"~w~LOL, YOU DIED",1000,1);
    SendDeathMessage(killerid, playerid, reason);
    GameTextForPlayer(killerid,"~r~You Murderer!",4000,3);
    if( DMZone[killerid] >= 1 )
    {
        GivePlayerMoney(killerid, 1000);
    }
    if( DMZone[killerid] == 0 )
    {
        GivePlayerMoney(killerid, -2000);
        SendClientMessage(killerid, COLOR_RED, "Please don't kill others outside deathmatch zones. (-2000$)");
    }
    return 1;
}
I want this code to be added to this:

pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
    SendDeathMessage(killerid, playerid, reason);

    if(IsInDM[playerid] ==1)
    {
        SetPlayerScore(killerid,GetPlayerScore(killerid)+1);
        SetPlayerScore(playerid,GetPlayerScore(playerid)-1);
        GivePlayerMoney(killerid, 1800);
        GivePlayerMoney(playerid, -1000);
        return 1;
    }
    if(IsInDM[playerid] ==0)
    {
        SetPlayerScore(killerid,GetPlayerScore(killerid)-1);
        GivePlayerMoney(killerid, -2000);
        return 1;
    }
    IsInDM[playerid] = 0;
    nojump2[playerid] = 0;

    return 1;
}
EDIT: I really just want this to be added
FadePlayerScreen(playerid, 0xFFFFFFCC, 6, 192);
GameTextForPlayer(playerid,"~w~LOL, YOU DIED",1000,1);

Just that the screen will fade and show that message
Reply
#2

pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
    SendDeathMessage(killerid, playerid, reason);

    FadePlayerScreen(playerid, 0xFFFFFFCC, 6, 192);
    GameTextForPlayer(playerid,"~w~LOL, YOU DIED",1000,1);
    GameTextForPlayer(killerid,"~r~You Murderer!",4000,3);
    if( DMZone[killerid] >= 1 )
    {
        GivePlayerMoney(killerid, 1000);
    }
    if( DMZone[killerid] == 0 )
    {
        GivePlayerMoney(killerid, -2000);
        SendClientMessage(killerid, COLOR_RED, "Please don't kill others outside deathmatch zones. (-2000$)");
    }
    if(IsInDM[playerid] ==1)
    {
        SetPlayerScore(killerid,GetPlayerScore(killerid)+1);
        SetPlayerScore(playerid,GetPlayerScore(playerid)-1);
        GivePlayerMoney(killerid, 1800);
        GivePlayerMoney(playerid, -1000);
    }
    if(IsInDM[playerid] ==0)
    {
        SetPlayerScore(killerid,GetPlayerScore(killerid)-1);
        GivePlayerMoney(killerid, -2000);
    }
    IsInDM[playerid] = 0;
    nojump2[playerid] = 0;

    return 1;
}
Just like this?
Reply
#3

pawn Код:
C:\Users\Aрalsteinn\Desktop\Mine\gamemodes\XS.pwn(5067) : error 017: undefined symbol "FadePlayerScreen"
C:\Users\Aрalsteinn\Desktop\Mine\gamemodes\XS.pwn(5070) : error 017: undefined symbol "DMZone"
C:\Users\Aрalsteinn\Desktop\Mine\gamemodes\XS.pwn(5070) : warning 215: expression has no effect
C:\Users\Aрalsteinn\Desktop\Mine\gamemodes\XS.pwn(5070) : error 001: expected token: ";", but found "]"
C:\Users\Aрalsteinn\Desktop\Mine\gamemodes\XS.pwn(5070) : error 029: invalid expression, assumed zero
C:\Users\Aрalsteinn\Desktop\Mine\gamemodes\XS.pwn(5070) : fatal error 107: too many error messages on one line
Reply
#4

Have you defined the FadePlayerScreen and the DMZone in the filterscript?
Do you want to put two FS's together?
Reply
#5

I have defined seifader. When i define DMZone it gives me error: fatal error 100: cannot read from file: "DMZone"
Reply
#6

is it #include <CPLoader>?

edit nope thats not it
Reply
#7

I did something right I think. Only thing left is a warning
warning 235: public function lacks forward declaration (symbol "OnPlayerFadeFlashed")

How to fix that?
Reply
#8

Search for OnPlayerFadeFlashed and copy the line with the 'public' infront. Then paste it one line over the public one, and change in the new-pasted the 'public' to forward and add a ';' in the end of the forward line.
Got that?
Reply
#9

Nope, just because my english is limited :/ Is this something you can do?

Sorry, but I just dont understand what you mean because english is not my first language

edit: No wait, it compiled warning free Let me try it
Reply
#10

yay it worked. Well, kinda. When I kill myself it shows LOL, you died! But the screen does not flash
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)