06.02.2018, 14:01
OnPlayerDeath Callback
timer
Ok so, how to make a global timer that will disappear this EARNS[playerid] Textdraw for everyone? just noticed that the player with id 0 disappears but the id 1 doesnt. Also how do i make randomized points score like 6,10,14,7,9 etc..? I guess that i need to create some cases for do that. Some help how to write the code?
PHP код:
EARNS[playerid] = TextDrawCreate(304.000000, 116.000000, "+ points");
TextDrawBackgroundColor(EARNS[playerid], 255);
TextDrawFont(EARNS[playerid], 2);
TextDrawLetterSize(EARNS[playerid], 0.520000, 2.200000);
TextDrawColor(EARNS[playerid], 227526655);
TextDrawSetOutline(EARNS[playerid], 0);
TextDrawSetProportional(EARNS[playerid], 1);
TextDrawSetShadow(EARNS[playerid], 1);
PHP код:
// If player kills someone he will be awarded with +1 point level and +50 respect
new killedwho[MAX_PLAYERS];
GetPlayerName(playerid,killedwho,sizeof(killedwho)); // Killer's name
format(iString, sizeof iString, "{9FF781}* You killed %s and took +1 points and +50 respect", killedwho);
SendClientMessage(killerid, -1, iString);
format(iString, sizeof iString, "{D8D8D8}(INFO) Respect: %i", pInfo[killerid][Respect]);
SendClientMessage(killerid, -1, iString);
TextDrawShowForPlayer(playerid, EARNS[playerid]); <--- thats the points TD
SetTimer("HideTextdraw", 5000, false);
pInfo[killerid][Points] += 1;
pInfo[killerid][Respect] += 50;
SetPlayerScore(killerid, GetPlayerScore(killerid) + 15);
pInfo[killerid][Score] += 15;
GameTextForPlayer(killerid,"~y~+15", 400,4);
PHP код:
forward HideTextdraw(playerid);
public HideTextdraw(playerid)
{
TextDrawHideForPlayer(playerid, EARNS[playerid]);
}