How to call a global timer and to randomize server side moneys (points)
#1

OnPlayerDeath Callback

PHP код:
    EARNS[playerid] = TextDrawCreate(304.000000116.000000"+ points");
    
TextDrawBackgroundColor(EARNS[playerid], 255);
    
TextDrawFont(EARNS[playerid], 2);
    
TextDrawLetterSize(EARNS[playerid], 0.5200002.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(iStringsizeof iString"{9FF781}* You killed %s and took +1 points and +50 respect"killedwho);
    
SendClientMessage(killerid, -1iString);
    
format(iStringsizeof iString"{D8D8D8}(INFO) Respect: %i"pInfo[killerid][Respect]); 
    
SendClientMessage(killerid, -1iString);
    
TextDrawShowForPlayer(playeridEARNS[playerid]); <--- thats the points TD
    SetTimer
("HideTextdraw"5000false);
    
pInfo[killerid][Points] += 1;
    
pInfo[killerid][Respect] += 50;
    
SetPlayerScore(killeridGetPlayerScore(killerid) + 15);
    
pInfo[killerid][Score] += 15;
    
GameTextForPlayer(killerid,"~y~+15"400,4); 
timer

PHP код:
forward HideTextdraw(playerid);
public 
HideTextdraw(playerid)
{
    
TextDrawHideForPlayer(playeridEARNS[playerid]);

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?
Reply


Messages In This Thread
How to call a global timer and to randomize server side moneys (points) - by wallen - 06.02.2018, 14:01
Re: How to call a global timer and to randomize server side moneys (points) - by Private200 - 06.02.2018, 18:26
Re: How to call a global timer and to randomize server side moneys (points) - by dani18 - 06.02.2018, 18:47
Re: How to call a global timer and to randomize server side moneys (points) - by Private200 - 06.02.2018, 20:10

Forum Jump:


Users browsing this thread: 1 Guest(s)