12.12.2015, 16:40
pawn Code:
LoadPlayerData(playerid)
{
clearPlayerChat(playerid);
mysql_queryF("SELECT * FROM `Accounts` WHERE `Username` = '%s' LIMIT 1", GetName(playerid));
mysql_store_result();
new fields = mysql_num_fields();
if(fields)
{
new Data[2048], Field[128], s, idx;
mysql_fetch_rowEx(Data);
print(Data);
strcat(Field, strtuk( Data, idx, '|') );
while(s < fields)
{
switch(s)
{
// all case here
}
s++;
strcat((Field[0] = EOS, Field), strtuk( Data, idx, '|') );
}
clearPlayerChat(playerid);
SPD(playerid, DIALOG_AUTHENTICATION);
TextDrawHideForPlayer(playerid, Text:LoadingTD);
//printf("%s",Player[playerid][SecretWord]);
//printf("%s",Player[playerid][LastIP]);
//printf("%s",PlayerConnectedIP[playerid]);
}
else
{
clearPlayerChat(playerid);
new playernamesplit[3][MAX_PLAYER_NAME], Name[MAX_PLAYER_NAME];
GetPlayerName(playerid, Name, sizeof(Name));
split2(Name, playernamesplit, '_');
if(!strlen(playernamesplit[0]) || !strlen(playernamesplit[1]))
{
KickWithMessage(playerid, COLOR_WHITE, "Unfortunately, your name is not in the proper format! Please use the format of "#COL_EMB_LIGHTBLUE"\"Firstname_Lastname\""#COL_EMB_WHITE".");
}
else
{
SPD(playerid, DIALOG_REGISTER);
TextDrawHideForPlayer(playerid, Text:LoadingTD);
}
}
mysql_free_result();
}