26.03.2013, 13:44
Quote:
Do you use a command /register to register? If yes, can you show us the code in it.
|
pawn Код:
CMD:register(playerid, params[])
{
if(PlayerInfo[playerid][pRegistered]) return SCM(playerid, COLOR_ERROR, "[ERROR]: You're already registered. Use {5D849C}/acp {968996}to change your password.");
if(isnull(params)) return SCM(playerid, COLOR_ERROR, "[USAGE]: /register [password]");
new string[256];
if(strlen(params) > MAX_PASSWORD)
{
format(string, sizeof(string), "Your password cannot be longer than %d characters.", MAX_PASSWORD);
SCM(playerid, COLOR_ERROR, string);
return 1;
}
PlayerInfo[playerid][pPassword] = num_hash(params);
format(string, sizeof(string), "You have registered this account (%s) with the password {F0CD81}%s{309E21}. Don't forget it!", RPName(playerid), params);
SCM(playerid, COLOR_GREEN, string);
SCM(playerid, COLOR_GREEN, "You will now be walked through the basics of this server.");
pRegStep[playerid] = 1;
RegisterProcess(playerid);
if(!fexist(FilePath(0, playerid))) { file_Create(FilePath(0, playerid)); }
FileLoaded[0][playerid] = true;
SaveFile(0, playerid);
return 1;
}