My saving 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)
+--- Thread: My saving system. (
/showthread.php?tid=430072)
My saving system. -
zClaw - 12.04.2013
Hi, I am following the tutorial of SA-MP Wiki, (
https://sampwiki.blast.hk/wiki/Creating_...l_admin_script)
I got some errors, all on line 220.
pawn Код:
PlayerInfo[playerid][AdminLevel] = 0;
Somehow, the wiki does not tell me to create enums. Here are my errors:
pawn Код:
C:\Users\Gast\Desktop\SA-MP Server\gamemodes\DonataDefend1.pwn(220) : error 017: undefined symbol "PlayerInfo"
C:\Users\Gast\Desktop\SA-MP Server\gamemodes\DonataDefend1.pwn(220) : warning 215: expression has no effect
C:\Users\Gast\Desktop\SA-MP Server\gamemodes\DonataDefend1.pwn(220) : error 001: expected token: ";", but found "]"
C:\Users\Gast\Desktop\SA-MP Server\gamemodes\DonataDefend1.pwn(220) : error 029: invalid expression, assumed zero
C:\Users\Gast\Desktop\SA-MP Server\gamemodes\DonataDefend1.pwn(220) : fatal error 107: too many error messages on one line
Compilation aborted.Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
4 Errors.
For some extra information, the whole command.
pawn Код:
//============================================Login System===============================
dcmd(login,5,cmdtext);
return 0;
}
dcmd_login(playerid, params[]) {
if(player_level[playerid] != 0) { // User is logged in
SendClientMessage(playerid, 0xFFFFFFFF, "You are already logged in.");
return 1; //
}
else if(strlen(params) == 0) {
SendClientMessage(playerid, 0xFFFFFFFF, "Please use /login [password]");
return 1;
}
else if(!dini_Isset(USERFILE,player_names[playerid])) { // not registered
SendClientMessage(playerid, 0xFFFFFFFF, "You are not registered.");
SendClientMessage(playerid, 0xFFFFFFFF, "Use /register [password] first.");
return 1;
}
else if(adler32_hash(params) != dini_Int(USERFILE,player_names[playerid])) {
SendClientMessage(playerid, 0xFFFFFFFF, "Password mismatch.");
return 1;
}
player_level[playerid] = 1; // Logged in successfully
SendClientMessage(playerid, 0xFFFFFFFF, "You have succesfully logged in!");
return 1;
}
adler32_hash(buf[]) {
new length=strlen(buf);
new s1 = 1;
new s2 = 0;
new n;
for (n=0; n<length; n++)
{
s1 = (s1 + buf[n]) % 65521;
s2 = (s2 + s1) % 65521;
}
return (s2 << 16) + s1;
}
Re: My saving system. -
mamorunl - 12.04.2013
pawn Код:
enum Info
{
AdminLevel,
}
new PlayerInfo[MAX_PLAYERS][Info];
The Wiki DOES tell you to