onplayerdeath -
[NYRP]Mike. - 03.10.2009
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.
Re: onplayerdeath -
brett7 - 03.10.2009
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
Re: onplayerdeath -
[NYRP]Mike. - 03.10.2009
So, which should i hide on Public kill?
Re: onplayerdeath -
[NYRP]Mike. - 03.10.2009
-BUMP- Please Help.
Re: onplayerdeath -
_Vortex - 03.10.2009
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.
Re: onplayerdeath -
Enzo_Ferrari_V12 - 04.10.2009
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.