29.12.2017, 17:16
Hello, I've creating a something for Hightlist kills of map And creating the codes But There is a problem What is it?
I've creating the code and there are no errors/warrings but When someone killed other They are not update the Textdraw To Example: Thanks - 1 Like that But I really dont know Its not Updated them Anyone can help me?
I've creating the Textdraws for them and There are no problem Just They not updated Kills when someone Killed
I've creating the code and there are no errors/warrings but When someone killed other They are not update the Textdraw To Example: Thanks - 1 Like that But I really dont know Its not Updated them Anyone can help me?
PHP код:
public OnPlayerSpawn(playerid)
{
new first, second, third, fourth, fifth;
new Nick[50][MAX_PLAYER_NAME], string[MAX_PLAYER_NAME],string20[MAX_PLAYER_NAME];
for(new i=0;i<MAX_PLAYERS;i++) // This loop will check for the player that has the most kills
{
if(kills[i] > kills[first])
{
first = i;
GetPlayerName(first, Nick[0], MAX_PLAYER_NAME);
format(string20, sizeof(string20), "~R~#1 - ~W~%s", Nick[0]);
TextDrawSetString(Textdraw12, string20);
TextDrawShowForPlayer(playerid, Textdraw12);
}
}
for(new d=0;d<MAX_PLAYERS;d++) // This loop will check for the player that has the second most kills
{
if(first == d) continue;
if(kills[d] > kills[second])
{
GetPlayerName(second, Nick[0], MAX_PLAYER_NAME);
format(string, sizeof(string), "~R~#2 - ~W~%s", Nick[0]);
second = d;
TextDrawSetString(Textdraw13, string);
TextDrawShowForPlayer(playerid, Textdraw13);
}
}
for(new s=0;s<MAX_PLAYERS;s++) // This loop will check for the player that has the third most kills
{
if(first == s || second == s) continue;
if(kills[s] > kills[third])
{
GetPlayerName(third, Nick[0], MAX_PLAYER_NAME);
format(string[0], sizeof(string), "~R~#3 - ~W~%s", Nick[0]);
third = s;
TextDrawSetString(Textdraw14, string);
TextDrawShowForPlayer(playerid, Textdraw14);
}
}
for(new a=0;a<MAX_PLAYERS;a++) // This loop will check for the player that has the fourth most kills
{
if(first == a || second == a || third == a) continue;
if(kills[a] > kills[fourth])
{
GetPlayerName(fourth, Nick[0], MAX_PLAYER_NAME);
format(string, sizeof(string), "~R~#4 - ~W~%s", Nick[0]);
fourth = a;
TextDrawSetString(Textdraw15, string);
TextDrawShowForPlayer(playerid, Textdraw15);
}
}
for(new c=0;c<MAX_PLAYERS;c++) // This loop will check for the player that has the fifth most kills
{
if(first == c || second == c || third == c || fourth == c) continue;
if(kills[c] > kills[fifth])
{
GetPlayerName(fifth, Nick[0], MAX_PLAYER_NAME);
format(string, sizeof(string), "~R~#5 - ~W~%s", Nick[0]);
fifth = c;
TextDrawSetString(Textdraw15, string);
TextDrawShowForPlayer(playerid, Textdraw16);
}
}
return 1;
}