12.03.2017, 09:26
So when a player joins I want it to check if they have a _ in there name and if they do then they get asked to change it.
PHP код:
public OnPlayerConnect(playerid)
{
new query[128];
new pName[24];
GetPlayerName(playerid, pName, 24);
GetPlayerName(playerid, PlayerInfo[playerid][Name], 24);
if(strfind(pName,"_",true) == 1) {
new String[150];
format(String, sizeof(String), "{FFFFFF}Welcome %s.\n\n{0099FF}It looks like you are using a characters name.\n\
{0099FF}Please, input your Master Accounts name below to proceed.\n\n", pName);
ShowPlayerDialog(playerid, ForumName, DIALOG_STYLE_INPUT, "Master Accounts Name", String, "Register", "Leave");
format(String, sizeof(String), "Server Error:Welcome %s, it seems like you are using a characters name or soon to be characters name. ",pName);
SendClientMessage(playerid, COLOR_RED, String);
format(String, sizeof(String), "Server Error: Please enter a Master Accounts to continue, Our forums %s.",ServerInfo[ForumLink]);
SendClientMessage(playerid, COLOR_RED, String);
return 1;
}
mysql_format(mysql, query, sizeof(query),"SELECT `Password`, `ID` FROM `accounts` WHERE `Name` = '%e' LIMIT 1", PlayerInfo[playerid][Name]);
mysql_tquery(mysql, query, "OnForumAccountCheck", "i", playerid);
return 1;
}