DJson register system - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: DJson register system (
/showthread.php?tid=102322)
DJson register system -
Ritchie999 - 14.10.2009
i am trying to use the djson account system but everytime i add it into my OnPlayerCommandText section i get these errors
Код:
C:\Users\richard\Desktop\Gta SAMP mp server - Copy\gamemodes\FirstScript.pwn(44) : error 021: symbol already defined: "WP_Hash"
C:\Users\richard\Desktop\Gta SAMP mp server - Copy\gamemodes\FirstScript.pwn(559) : error 017: undefined symbol "dcmd_register"
C:\Users\richard\Desktop\Gta SAMP mp server - Copy\gamemodes\FirstScript.pwn(560) : error 017: undefined symbol "dcmd_register"
C:\Users\richard\Desktop\Gta SAMP mp server - Copy\gamemodes\FirstScript.pwn(566) : error 017: undefined symbol "params"
C:\Users\richard\Desktop\Gta SAMP mp server - Copy\gamemodes\FirstScript.pwn(567) : error 017: undefined symbol "params"
C:\Users\richard\Desktop\Gta SAMP mp server - Copy\gamemodes\FirstScript.pwn(568) : error 017: undefined symbol "params"
C:\Users\richard\Desktop\Gta SAMP mp server - Copy\gamemodes\FirstScript.pwn(572) : error 017: undefined symbol "params"
C:\Users\richard\Desktop\Gta SAMP mp server - Copy\gamemodes\FirstScript.pwn(576) : error 017: undefined symbol "IP"
C:\Users\richard\Desktop\Gta SAMP mp server - Copy\gamemodes\FirstScript.pwn(583) : warning 225: unreachable code
C:\Users\richard\Desktop\Gta SAMP mp server - Copy\gamemodes\FirstScript.pwn(669) : warning 203: symbol is never used: "djson_GameModeExit"
C:\Users\richard\Desktop\Gta SAMP mp server - Copy\gamemodes\FirstScript.pwn(669) : warning 203: symbol is never used: "djson_GameModeInit"
Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
dcmd(register,8,cmdtext);
dcmd_register(playerid, params[])
{
new PlayerName[24]; // Create an array with the size of 24 to store the name in.
GetPlayerName(playerid, PlayerName, 24); // Store the name to the PlayerName array.
if(!AccountExists(PlayerName)) // Check if the account exists.
{
if(!strlen(params)) return SendClientMessage(playerid, COLOR_RED, "/register password [Password is CaSE SeNSiTivE]");
if(strlen(params) > 20) return SendClientMessage(playerid, COLOR_RED, "Password cannot be greater than 20 characters.");
if(strlen(params) < 3) return SendClientMessage(playerid, COLOR_RED, "Password cannot be less than 3 characters.");
new str[31];
format(str, sizeof(str), "%s/password", PlayerName);
new buf[145];
WP_Hash(buf, sizeof(buf), params);
djSet("accounts.json",str,buf);
AccountSetInt(PlayerName, "LoggedIn",0);
AccountSet(PlayerName, "password", buf);
printf("[REGISTER] %s - %s [%s]",PlayerName, IP, DayString);
SendClientMessage(playerid, COLOR_SUCCESS, "You have successfully registered! You may now use /login password to login.");
}
else if(AccountGetInt(PlayerName, "LoggedIn") == 0) return SendClientMessage(playerid, COLOR_RED, "Account already exists. Please use /login password to login.");
else return SendClientMessage(playerid, COLOR_RED, "You are already logged on!");
return 1;
}
if (strcmp("/forum", cmdtext, true, 10) == 0)
{
the part it says which is unreachable is
Код:
if (strcmp("/forum", cmdtext, true, 10) == 0)
Any idea's?
Re: DJson register system -
Hiitch - 15.10.2009
My ideas are to:
1, ask about this in the topic it was taken from.
or
2, wait for someone else to help you here.
Re: DJson register system -
Ritchie999 - 17.10.2009
-Bump-
I found out what the problem was, i wasn't meant to have the dcmd_register command in the OnPlayerCommandText section, so i fixed it, but now i get the error