onplayerdeath
#1

Hello SA:MP forum, i was wondering how i could do this, what i want is if TEAM_PRIS kills TEAM_COP they gain TEAM_COPKeys and displays a textdraw, here is my code.

pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
    if(TEAM_PRIS[killerid] == 1)
    {
        SendClientMessage(playerid, COLOR_YELLOW, " You have now got Police Keys, You can open all doors");
        TEAM_COPKeys[playerid] = 1;
        GameTextForPlayer(playerid, "~p~Police Keys: ~g~GAINED", 2000, 1);
        TextDrawShowForPlayer(playerid, Text:Textdraw2);
        TextDrawHideForPlayer(playerid, Text:Textdraw6);
    }
    else
    {
        SendClientMessage(playerid, COLOR_YELLOW, " You have now lost your Police Keys.");
        TEAM_COPKeys[playerid] = 0;
        GameTextForPlayer(playerid, "~p~Police Keys: ~R~LOST", 2000, 1);
        TextDrawShowForPlayer(playerid, Text:Textdraw6);
        TextDrawHideForPlayer(playerid, Text:Textdraw2);
    }
    return 1;
}
Thanks.

-Mike.
Reply
#2

public OnPlayerDeath(playerid, killerid, reason)
{
if(TEAM_PRIS[killerid] == 1)
{
SendClientMessage(playerid, COLOR_YELLOW, " You have now got Police Keys, You can open all doors");
TEAM_COPKeys[playerid] = 1;
GameTextForPlayer(playerid, "~p~Police Keys: ~g~GAINED", 2000, 1);
TextDrawShowForPlayer(playerid, Text:Textdraw2);
SetTimer(kill, 60000, 1);
}
else
{
SendClientMessage(playerid, COLOR_YELLOW, " You have now lost your Police Keys.");
TEAM_COPKeys[playerid] = 0;
GameTextForPlayer(playerid, "~p~Police Keys: ~R~LOST", 2000, 1);
TextDrawShowForPlayer(playerid, Text:Textdraw6);
TextDrawHideForPlayer(playerid, Text:Textdraw2);
}
return 1;
}

public kill()
{
TextDrawHideForPlayer(playerid, Text:Textdraw6);

}

something like that you need some sort of timer not just show textdraw then instantly hide it
Reply
#3

So, which should i hide on Public kill?
Reply
#4

-BUMP- Please Help.
Reply
#5

Do NOT bump in such a short time.

If someone knew the answer, they'd answer. There's no reason to bump within 10 mins.
Reply
#6

omg LAWL you nub! lol Mike. You have to set a timer to hide the textdraw. Remember all those funtions are done within a second. So if it shows and then hidden within a second, you don't see it. Again, you need a timer to hide it.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)