Rigister help
#1

Help how take make that
1. when someone rigister our server so the message to all palyer that

PlayerName has made total rigister1 player ...this i want to make when any player rigister.....

and tell me in breif i am a newbie
Reply
#2

put this with rest of code after player register
Код:
new string[35+MAX_PLAYER_NAME], playerName[MAX_PLAYER_NAME];
GetPlayerName(playerid, playerName, sizeof(playerName));
format(string, sizeof(string), "Player %s just registered, welcome him!", playerName);
SendClientMessageToAll(-1, string);
Reply
#3

If you using mysql, put this after player register

Код:
			// Setup local variables
			new NumPlayers, Msg[256];

			// Execute the query to get all ID's from all accounts in table "playerdata"
			mysql_query("SELECT * FROM `playerdata`");
			// Store the result
			mysql_store_result();
			// Count the amount of rows returned in the result
			NumPlayers = mysql_num_rows();
			// Free the result
			mysql_free_result();

			format(Msg, sizeof(Msg), "{B7B7B7}[SERVER] {FFDC2E}%s(%i) {FFFFFF}has registered, making the server have a total of {FFDC2E}%d {FFFFFF}players registered.", myName, spareid, NumPlayers);
			SendClientMessageToAll(COLOR_WHITE, Msg);
Reply
#4

how we know that how much player rigisterred ?
Reply
#5

Example command:


Код:
COMMAND:totalplayers(playerid, params[])
{
	// Setup local variables
	new NumPlayers, Msg[128];

	// Execute the query to get all ID's from all accounts in table "playerdata"
	mysql_query("SELECT * FROM `playerdata`");
	// Store the result
	mysql_store_result();
	// Count the amount of rows returned in the result
	NumPlayers = mysql_num_rows();
	// Free the result
	mysql_free_result();

	format(Msg, sizeof(Msg), "Total registered players: %i", NumPlayers);
	SendClientMessage(playerid, -1, Msg);

	// Let the server know that this was a valid command
	return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)