17.11.2013, 22:38
pawn Код:
new Text:CashInfo[MAX_PLAYERS];
new Str[128];
enum pInfo {
pGold
};
new Player[MAX_PLAYERS][pInfo];
public OnPlayerConnect(playerid) {
CashInfo[playerid] = TextDrawCreate(486.000000, 120.000000, "");
TextDrawBackgroundColor(CashInfo[playerid], 255);
TextDrawFont(CashInfo[playerid], 1);
TextDrawLetterSize(CashInfo[playerid], 0.430000, 1.500000);
TextDrawColor(CashInfo[playerid], -1);
TextDrawSetProportional(CashInfo[playerid], 1);
TextDrawSetShadow(CashInfo[playerid], 1);
return 1;
}
forward Atualizar(playerid);
public Atualizar(playerid)
{
format(Str,sizeof(Str),"Cash %d", Player[playerid][pGold]);
TextDrawSetString(CashInfo[playerid], Str);
TextDrawShowForPlayer(playerid, CashInfo[playerid]);
return 1;
}
public OnPlayerSpawn(playerid)
{
SetTimerEx("Atualizar", 1000, true, "i", playerid);
return 1;
}