08.12.2014, 15:23
(
Последний раз редактировалось kampuman; 08.12.2014 в 16:23.
)
I have the following codes below, but I wonder why it only creates another account and when it creates a new account, all the stats were gone. Need help!
Код:
if(dialogid == DIALOG_RENAME) { if(!response) { ShowLoginScreen(playerid); } if(response) { if(strlen(inputtext) < 4) { SendClientMessage(playerid, -1, ""RED"[PASS] "WHITE"Please enter a username GREATER than 3 characters."); ShowRenameScreen(playerid); } new Query[100]; format(Query,sizeof(Query),"SELECT * FROM `users` WHERE `Name` = '%s'",inputtext); mysql_function_query(cHandle, Query, true, "RenamePlayer", "ds", playerid, inputtext); } }
Код:
public RenamePlayer(playerid,name[]) { new rows, fields; cache_get_data(rows, fields, cHandle); if(rows) { SendClientMessageEx(playerid,-1,""RED"[RENAME] "WHITE"The username %s is already exists in the database, please try another username.", name); ShowLoginScreen(playerid); return 1; } SetPlayerName(playerid, name); ShowRegisterScreen(playerid); SendClientMessageEx(playerid,-1,""RED"[RENAME] "GREEN"You have successfully changed your name to %s", name); return 1; }