CMD:hits(playerid, params[])
{
new string[256];
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i) && HasHit[i] == 1)
{
format(string, sizeof(string), "%s(%d)~n~%s(%d)~n~%s(%d)~n~%s(%d)~n~%s(%d)", GetName(i), i,GetName(i), i,GetName(i), i,GetName(i), i,GetName(i), i);
TextDrawSetString(List[playerid], string);
TextDrawShowForPlayer(playerid, List[playerid]);
}
}
return 1;
}
format(string, sizeof(string), "%s(%d)",GetName(i),i);
CMD:hits(playerid, params[]) { new string[256]; for(new i = 0; i < MAX_PLAYERS; i++) { if(IsPlayerConnected(i) && HasHit[i] == 1) { format(string, sizeof(string), "%s(%i)~n~%s(%i)~n~%s(%i)~n~%s(%i)~n~%s(%i)", GetName(i), i,GetName(i), i,GetName(i), i,GetName(i), i,GetName(i), i); TextDrawSetString(List[playerid], string); TextDrawShowForPlayer(playerid, List[playerid]); } } return 1; }
Well the problem is in your format,check out if this works.
Code:
format(string, sizeof(string), "%s(%d)",GetName(i),i); |
Code:
CMD:hits(playerid, params[]) { new string[256]; for(new i = 0; i < MAX_PLAYERS; i++) { if(IsPlayerConnected(i) && HasHit[i] == 1) { format(string, sizeof(string), "%s(%i)~n~%s(%i)~n~%s(%i)~n~%s(%i)~n~%s(%i)", GetName(i), i,GetName(i), i,GetName(i), i,GetName(i), i,GetName(i), i); TextDrawSetString(List[playerid], string); TextDrawShowForPlayer(playerid, List[playerid]); } } return 1; } |
Player(0) Player(0) Player(0) Player(0) Player(0)
CMD:hits(playerid, params[]) { new string[256]; for(new i = 0; i < MAX_PLAYERS; i++) { if(IsPlayerConnected(i) && HasHit[i] == 1) { format(string, sizeof(string), "%s(%i)~n~", GetName(i), i); TextDrawSetString(List[playerid], string); TextDrawShowForPlayer(playerid, List[playerid]); } } return 1; }
CMD:hits(playerid, params[])
{
new string[256];
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i) && HasHit[i] == 1)
{
format(string, sizeof(string), "%s~n~%s(%d)~n~", string, GetName(i), i);
TextDrawSetString(List[playerid], string);
TextDrawShowForPlayer(playerid, List[playerid]);
}
}
return 1;
}
CMD:hits(playerid, params[])
{
new string[256];
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i) && HasHit[i] == 1)
{
format(string, sizeof(string), "%s~n~%s(%d)~n~", string, GetName(i), i);
TextDrawSetString(List[playerid], string);
}
}
TextDrawShowForPlayer(playerid, List[playerid]); //outside loop!
return 1;
}