Rigister help - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Rigister help (
/showthread.php?tid=595445)
Rigister help -
RaajParker - 03.12.2015
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
Re: Rigister help -
Lenon - 03.12.2015
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);
Re: Rigister help -
SilverStand - 03.12.2015
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);
Respuesta: Rigister help -
RaajParker - 03.12.2015
how we know that how much player rigisterred ?
Re: Rigister help -
SilverStand - 03.12.2015
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;
}