Textdraw4 = TextDrawCreate(472.000000, 148.000000, "Rank:");
TextDrawBackgroundColor(Textdraw0, 65535);
TextDrawFont(Textdraw0, 1);
TextDrawLetterSize(Textdraw0, 0.529999, 2.000000);
TextDrawColor(Textdraw0, 16777215);
TextDrawSetOutline(Textdraw0, 1);
TextDrawSetProportional(Textdraw0, 1);
Textdraw5 = TextDrawCreate(472.000000, 172.000000, "Kills:");
TextDrawBackgroundColor(Textdraw1, 65535);
TextDrawFont(Textdraw1, 1);
TextDrawLetterSize(Textdraw1, 0.629998, 2.200000);
TextDrawColor(Textdraw1, 16777215);
TextDrawSetOutline(Textdraw1, 1);
TextDrawSetProportional(Textdraw1, 1);
Textdraw6 = TextDrawCreate(472.000000, 197.000000, "Deaths:");
TextDrawBackgroundColor(Textdraw2, 65535);
TextDrawFont(Textdraw2, 1);
TextDrawLetterSize(Textdraw2, 0.479999, 2.299998);
TextDrawColor(Textdraw2, 16777215);
TextDrawSetOutline(Textdraw2, 1);
TextDrawSetProportional(Textdraw2, 1);
Textdraw7 = TextDrawCreate(472.000000, 224.000000, "Health:");
TextDrawBackgroundColor(Textdraw3, 65535);
TextDrawFont(Textdraw3, 1);
TextDrawLetterSize(Textdraw3, 0.500000, 2.099999);
TextDrawColor(Textdraw3, 16777215);
TextDrawSetOutline(Textdraw3, 1);
TextDrawSetProportional(Textdraw3, 1);
new string[64]; format(string,sizeof(string),"Health: %i",GetPlayerHealth(playerid)); TextDrawSetString(Textdraw7,string);
new Text:Textdraw5[MAX_PLAYERS];
new Text:Textdraw6[MAX_PLAYERS];
new deaths[MAX_PLAYERS];
new kills[MAX_PLAYERS];
public OnPlayerConnect(playerid)
{
Textdraw5[playerid] = TextDrawCreate(472.000000, 172.000000, "Kills:");
TextDrawBackgroundColor(Textdraw5[playerid], 65535);
TextDrawFont(Textdraw5[playerid], 1);
TextDrawLetterSize(Textdraw5[playerid], 0.629998, 2.200000);
TextDrawColor(Textdraw5[playerid], 16777215);
TextDrawSetOutline(Textdraw5[playerid], 1);
TextDrawSetProportional(Textdraw5[playerid], 1);
Textdraw6[playerid] = TextDrawCreate(472.000000, 197.000000, "Deaths:");
TextDrawBackgroundColor(Textdraw6[playerid], 65535);
TextDrawFont(Textdraw6[playerid], 1);
TextDrawLetterSize(Textdraw6[playerid], 0.479999, 2.299998);
TextDrawColor(Textdraw6[playerid], 16777215);
TextDrawSetOutline(Textdraw6[playerid], 1);
TextDrawSetProportional(Textdraw6[playerid], 1);
TextDrawShowForPlayer(playerid, Textdraw5[playerid]);
TextDrawShowForPlayer(playerid, Textdraw6[playerid]);
return 1;
}
public OnPlayerDeath(playerid, killerid, reason)
{
if(killerid != INVALID_PLAYER_ID) kills[killerid]++;
deaths[playerid] ++;
new str[40];
format(str, sizeof(str), "Kills: %d", kills[killerid]);
TextDrawSetString(Textdraw5[killerid], str);
format(str, sizeof(str), "Deaths: %d", deaths[playerid]);
TextDrawSetString(Textdraw6[playerid], str);
return 1;
}
Example for health:
Код:
new string[64]; format(string,sizeof(string),"Health: %i",GetPlayerHealth(playerid)); TextDrawSetString(Textdraw7,string); |
new Float:Health;
GetPlayerHealth(playerid, Health);
You would need a health timer for the health but I'm sure you already have a timer that you can just add to. Here is how you would do kills and deaths.
pawn Код:
There is a few errors in your code there 1. GetPlayerHealth is a float %f not a integer. 2. GetPlayerHealth has mutliple params pawn Код:
|
C:\Documents and Settings\Chris\Desktop\Desktop\SAMP Server\gamemodes\WorldWar.pwn(500) : error 028: invalid subscript (not an array or too many subscripts): "Textdraw5"
C:\Documents and Settings\Chris\Desktop\Desktop\SAMP Server\gamemodes\WorldWar.pwn(500) : warning 215: expression has no effect
C:\Documents and Settings\Chris\Desktop\Desktop\SAMP Server\gamemodes\WorldWar.pwn(500) : error 001: expected token: ";", but found "]"
C:\Documents and Settings\Chris\Desktop\Desktop\SAMP Server\gamemodes\WorldWar.pwn(500) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Chris\Desktop\Desktop\SAMP Server\gamemodes\WorldWar.pwn(500) : fatal error 107: too many error messages on one line
Textdraw5[playerid] = TextDrawCreate(472.000000, 172.000000, "Kills:");//Line 500
TextDrawBackgroundColor(Textdraw5[playerid], 65535);
TextDrawFont(Textdraw5[playerid], 1);
TextDrawLetterSize(Textdraw5[playerid], 0.629998, 2.200000);
TextDrawColor(Textdraw5[playerid], 16777215);
TextDrawSetOutline(Textdraw5[playerid], 1);
TextDrawSetProportional(Textdraw5[playerid], 1);