string showing wrong value?
#1



As you can see on the image above it says "115" wins the round, which is a completely random value, trying to understand where I messed up. Here's the code.


(intendation is messed up ova here)
Код:
	new Player;
	for(new i=0; i<MAX_PLAYERS; i++)
	{
	    if(IsPlayerConnected(i))
	    {
	         if(roundKills[i] > roundKills[Player]) Player = i;
	    }
	}
	

	new pname[MAX_PLAYER_NAME];
	GetPlayerName(Player, pname, sizeof(pname));
	
	new string2[120];
	format(string2,sizeof(string2),"%d wins the round with %d kills.", pname, roundKills[Player]);
	SendClientMessageToAll(-1, string2);
Thank you for taking your time
Reply
#2

%d - shows a number and %s a name. replace
PHP код:
format(string2,sizeof(string2),"%d wins the round with %d kills."pnameroundKills[Player]); 
with this:
PHP код:
format(string2,sizeof(string2),"%s wins the round with %d kills."pnameroundKills[Player]); 
Reply
#3

Ah. Thanks!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)