GameTextForPlayer - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: GameTextForPlayer (
/showthread.php?tid=391921)
GameTextForPlayer -
Socan - 12.11.2012
How do I lower down the following piece of code so it only sends for one second or less;
I've hardly ever used GameTextForPlayer
Код:
GameTextForPlayer(playerid,"~r~ERROR:~n~~y~No teamkilling", 3000, 1);
Re: GameTextForPlayer -
Socan - 12.11.2012
Plus I want it too send to the killer, not the player. Here is the full OnPlayerDeath:
Код:
public OnPlayerDeath(playerid, killerid, reason)
{
if(killerid != INVALID_PLAYER_ID)
{
if(GetPlayerTeam(killerid) == GetPlayerTeam(playerid))
{
GameTextForPlayer(playerid,"~n~~r~ERROR:~n~~y~No teamkilling", 3000, 1);
}
else
{
GameTextForPlayer(playerid,"~n~~g~Epic Shot!~n~~y~+3000", 3000, 1);
GivePlayerMoney(killerid, 3000);
}
}
SendDeathMessage(killerid, playerid, reason);
return 1;
}
Re: GameTextForPlayer -
DBan - 12.11.2012
pawn Код:
GameTextForPlayer(playerid, string, 3000, 1);
3000 is the time it shows in milliseconds. 6000 is how many milliseconds are in a minute.
For the second code you posted, to send it to the killer, do this:
pawn Код:
GameTextForPlayer(killerid, string, 3000, 1);
Above changes playerid to killerid, killerid is the person who killed playerid.
Use
https://sampwiki.blast.hk/wiki/GameTextForPlayer as a reference.
Re: GameTextForPlayer - Jarnu - 12.11.2012
To send message to killerid
Change :
pawn Код:
GameTextForPlayer(playerid,"~n~~g~Epic Shot!~n~~y~+3000", 3000, 1);
To
pawn Код:
GameTextForPlayer(killerid,"~n~~g~Epic Shot!~n~~y~+3000", 3000, 1);
Re: GameTextForPlayer -
Konstantinos - 12.11.2012
DBan and Jarnu told you about sending the message to the killerid instead of playerid, so I'm going to answer to your first question. The pre last parameter is the time which should be displayed for the text (in miliseconds).
pawn Код:
3000 ms = 3 seconds
// If you want 1 second, it would be:
1000 ms = 1 second
// If you want 0.5 second, it would be:
500 ms = 0.5 second
Re: GameTextForPlayer -
JaKe Elite - 12.11.2012
First of all,
You are sending the game text to the player who died not to player who killed the player who died. Which means playerid.
Send it to the player who killed the player who died. (Killer ID)
For the first question Dwane answer it all.