//Under OnGamemodeInit
Textdraw0 = TextDrawCreate(4.000000,287.000000,"_");
TextDrawAlignment(Textdraw0,0);
TextDrawBackgroundColor(Textdraw0,0x000000ff);
TextDrawFont(Textdraw0,3);
TextDrawLetterSize(Textdraw0,0.399999,1.300000);
TextDrawColor(Textdraw0,0x0000ffff);
TextDrawSetProportional(Textdraw0,1);
TextDrawSetShadow(Textdraw0,2);
Textdraw1 = TextDrawCreate(4.000000,304.000000,"_");
TextDrawAlignment(Textdraw1,0);
TextDrawBackgroundColor(Textdraw1,0x000000ff);
TextDrawFont(Textdraw1,3);
TextDrawLetterSize(Textdraw1,0.399999,1.300000);
TextDrawColor(Textdraw1,0x0000ffff);
TextDrawSetProportional(Textdraw1,1);
TextDrawSetShadow(Textdraw1,2);
public UpdateTeamCash()
{
new string1[60];
new string2[60];
format(string1, sizeof(string1), "Team 1 Cash: %s", T1Cash);
format(string2, sizeof(string2), "Team 2 Cash: %s", T2Cash);
TextDrawSetString(Textdraw0,string1);
TextDrawSetString(Textdraw1,string2);
return 1;
}
//On Top of Script
new T1Cash = 0;
new T2Cash = 0;
if(gTeam[playerid] == 0)
{
T1Cash = T1Cash+1000;
}
else if(gTeam[playerid] == 1)
{
T2Cash = T2Cash+1000;
}
SendClientMessage(playerid, COLOR_YELLOW, "$1000 has been added to your teams cash!.");
}
stock TextDrawUpdate(Text:TextID) {
TextDrawHideForAll(TextID);
TextDrawShowForAll(TextID);
}
public UpdateTeamCash()
{
new string1[60];
new string2[60];
format(string1, sizeof(string1), "Team 1 Cash: %s", T1Cash);
format(string2, sizeof(string2), "Team 2 Cash: %s", T2Cash);
TextDrawSetString(Textdraw0,string1);
TextDrawSetString(Textdraw1,string2);
TextDrawUpdate(TextDraw0);
TextDrawUpdate(TextDraw1);
return 1;
}
public UpdateTeamCash()
{
new string1[60];
new string2[60];
format(string1, sizeof(string1), "Team 1 Cash: %s", T1Cash);
format(string2, sizeof(string2), "Team 2 Cash: %s", T2Cash);
for(new i; i<MAX_PLAYERS; i++)
{
TextDrawHideForPlayer(i, Textdraw0);
TextDrawHideForPlayer(i, Textdraw1);
TextDrawSetString(Textdraw0,string1);
TextDrawSetString(Textdraw1,string2);
TextDrawShowForPlayer(i, Textdraw0);
TextDrawShowForPlayer(i, Textdraw1);
}
return 1;
}
Now it will be refresh every update for every player
pawn Код:
|
format(string1, sizeof(string1), "Team 1 Cash: %d", T1Cash);
format(string2, sizeof(string2), "Team 2 Cash: %d", T2Cash);