Problem With loop!
#10

Quote:
Originally Posted by danish007
Посмотреть сообщение
look, what i want

i just want that if a recieve my birthday in server

then server should send me message its ur birthday and to others its X_MAN's or anyname birthday!

when i use ur code it keep spam!
Код:
new szString[22+MAX_PLAYER_NAME], szPlayername[MAX_PLAYER_NAME+1]; //creates 2 new strings, one for the text and one for the name
GetPlayerName(playerid, szPlayername, sizeof(szPlayername)); //gets the players name
format(szString, sizeof(szString), "* It is %s's birthday!", szPlayername); //formats the text that everyone else will see
for(new i =0; i < MAX_PLAYERS; i++)
{
	if(IsPlayerConnected(i)) //checks that the player is connected
	{
		if(playerid == i) //if the player specified is you, send you a unique message
			SendClientMessage(i, -1, "It is your birthday today!");
		else //if it is any other player, send them the message formatted earlier
			SendClientMessage(i, -1, szString);
	}
}
You can add braces to the if/else statements if you want to but it isnt needed
Reply


Messages In This Thread
Problem With loop! - by danish007 - 30.06.2014, 22:23
Re: Problem With loop! - by Jstylezzz - 01.07.2014, 05:31
Re: Problem With loop! - by BroZeus - 01.07.2014, 05:35
Re: Problem With loop! - by danish007 - 01.07.2014, 06:36
Re: Problem With loop! - by danish007 - 01.07.2014, 06:53
Re: Problem With loop! - by danish007 - 01.07.2014, 09:30
Re: Problem With loop! - by AroseKhanNiazi - 01.07.2014, 09:40
Re: Problem With loop! - by danish007 - 01.07.2014, 09:47
Re: Problem With loop! - by AroseKhanNiazi - 01.07.2014, 09:55
Re: Problem With loop! - by BlackSirrah239 - 01.07.2014, 09:55

Forum Jump:


Users browsing this thread: 3 Guest(s)