Register command not working?
#1

Ingame if i type /register [mypassword]
Nothing happens..
But if i type /register, It shows the usage

Im using SeifAdmin v4 edited,

pawn Код:
if (strcmp(cmd, "/register", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(AccountInfo[playerid][Logged] == 1)
{
SendClientMessage(playerid, RED, "You are already logged in.");
return 1;
}
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "/Gamemode/%s.cfg", sendername);
new File: hFile = fopen(string, io_read);
if (hFile)
{
SendClientMessage(playerid, RED, "That name is already taken. Please reconnect using a different username.");
fclose(hFile);
return 1;
}
new pass[150];
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) return SendClientMessage(playerid, ORANGE, "USAGE: /register [password]");
WP_Hash(pass, sizeof pass, tmp);
printf("register: %s", pass);
OnPlayerRegister(playerid, pass);
}
return 1;
}
pawn Код:
public OnPlayerRegister(playerid, password[])
{
if(IsPlayerConnected(playerid))
{
new name[MAX_PLAYER_NAME], str[128], ip[15];
GetPlayerName(playerid, name, sizeof name);
GetPlayerIp(playerid, ip, sizeof ip);
format(str, sizeof str, "/Gamemode/%s.cfg", name);
new File:account = fopen(str, io_write);
if (account)
{
strmid(AccountInfo[playerid][Password], password, 0, strlen(password), 255);
AccountInfo[playerid][Cash] = GetPlayerMoney(playerid);
new file[256];
{
format(file, sizeof file, "Password: %s\n", AccountInfo[playerid][Password]);
{fwrite(account, file); }
format(file, sizeof file, "Gender: %d\n", AccountInfo[playerid][Gender]);
{fwrite(account, file); }
format(file, sizeof file, "City: %d\n", AccountInfo[playerid][City]);
{fwrite(account, file); }
format(file, sizeof file, "Cash: %d\n", AccountInfo[playerid][Cash]);
{fwrite(account, file); }
format(file, sizeof file, "Warnings: %d\n",AccountInfo[playerid][Warns]);
{fwrite(account, file); }
format(file, sizeof file, "WarnReason1: %s\n",AccountInfo[playerid][WarnReason1]);
{fwrite(account, file); }
format(file, sizeof file, "WarnReason2: %s\n",AccountInfo[playerid][WarnReason2]);
{fwrite(account, file); }
format(file, sizeof file, "WarnReason3: %s\n",AccountInfo[playerid][WarnReason3]);
{fwrite(account, file); }
format(file, sizeof file, "IPAddress: %s\n",ip);
{fwrite(account, file); }
}
fclose(account);
SendClientMessage(playerid, GREEN, "You have successfully registered an account, Please login");
SendClientMessage(playerid, ORANGE, "\"/login [password]\"");
}
}
return 1;
}
Reply
#2

http://dracoblue.net/tidy/pawn/

handy link for you, ive had to convert it to read it properly

Reply
#3

That dosent help me at all,
In my script. indentation is correct but when i copy and pasted it went wrong so i did that.
Reply
#4

sizeof pass

do you need brackets here?
Reply
#5

I dont think so, I think it was like that before i edited, Let me check
EDIT: Yes its like that on the script seif released
Reply
#6

then i better not try any further, looks good to me.

stick a load of printf's or sendclientmessages in all over the place under every bit and see what actually goes through
Reply
#7

Ok i see your using serverffs goto Your FileManager make sure the "Users" folder dosent have caps ok their u go
Reply
#8

Quote:
Originally Posted by The Fame Monster
Ok i see your using serverffs goto Your FileManager make sure the "Users" folder dosent have caps ok their u go
clever, i didnt realise torran uses serverffs though.

useful info for the future
Reply
#9

Quote:
Originally Posted by The Fame Monster
Ok i see your using serverffs goto Your FileManager make sure the "Users" folder dosent have caps ok their u go
I dont use ServerFFS

Quote:
Originally Posted by Seif_
If /register doesn't work, it means your folder where accounts should be saved in doesn't exist. In your case, your folder is called "Gamemode". Create it in "scriptfiles" folder.
Lol forgot all about that :P
Reply
#10

Dosen't matter what Host you use, Lol you always need no caps :P Anyways Yw.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)