03.05.2009, 14:02
When I register with the following command, it creates a file, but not with the name of the player. Some of the letters are missing. E.g. if my name is James_Hawk, it registers like ames_Hawk or mes_Hawk.
Here's the command:
Here's the command:
pawn Код:
dcmd_register(playerid,params[])
{
new pname[MAX_PLAYER_NAME];
GetPlayerName(playerid, pname, sizeof(pname));
if (AccountInfo[playerid][Logged] == 1) return SendClientMessage(playerid, GREY, "ERROR: You are already registered and logged in.");
if (udb_Exists(pname[playerid])) return SendClientMessage(playerid, GREY, "ERROR: This account is already registered, please login using /login [password].");
if (strlen(params) == 0) return SendClientMessage(playerid, GREY, "USAGE: /register [password]");
if (strlen(params) < 4 || strlen(params) > 20) return SendClientMessage(playerid, GREY, "ERROR: Password length must be greater than 3 characters and lower than 20.");
if (udb_Create(pname[playerid], params))
{
dUserSetINT(pname[playerid]).("Registered", 1);
dUserSetINT(pname[playerid]).("AdminLevel", 0);
dUserSetINT(pname[playerid]).("AntiVirus", 0);
dUserSetINT(pname[playerid]).("Remote", 0);
dUserSetINT(pname[playerid]).("Radio", 0);
dUserSetINT(pname[playerid]).("Suit", 0);
dUserSetINT(pname[playerid]).("pFMember", 0);
dUserSetINT(pname[playerid]).("pTeam", 0);
dUserSetINT(pname[playerid]).("pRank", 0);
dUserSetINT(pname[playerid]).("pChar", 0);
dUserSetINT(pname[playerid]).("pMember", 0);
dUserSetINT(pname[playerid]).("pLeader", 0);
dUserSetINT(pname[playerid]).("Experience", 0);
dUserSetINT(pname[playerid]).("VIPStatus", 0);
dUserSetINT(pname[playerid]).("Warnings", 0);
dUserSetINT(pname[playerid]).("WarnReason1", 0);
dUserSetINT(pname[playerid]).("WarnReason2", 0);
dUserSetINT(pname[playerid]).("WarnReason3", 0);
SendClientMessage(playerid, LIGHTBLUE, "You are now registered. Please login with /login [password].");
PlayerPlaySound(playerid, 1057, 0.0, 0.0, 0.0);
return 1;
}
return 1;
}