Quantcast
Channel: SA-MP Forums
Viewing all articles
Browse latest Browse all 18226

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

$
0
0
OnPlayerDeath Callback

PHP Code:

    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 Code:

    // 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 Code:

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?

Viewing all articles
Browse latest Browse all 18226

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>