I need help with sscanf - 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: I need help with sscanf (
/showthread.php?tid=163608)
I need help with sscanf -
matthewdriftking - 28.07.2010
Ok, So i copy a TUT from Tut's section
Register & login script
here's the code what i do
http://pastebin.com/nMydkXUG
and those are the errors
Код:
C:\Documents and Settings\Spanner\Desktop\1\register script.pwn(59) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Spanner\Desktop\1\register script.pwn(59) : error 017: undefined symbol "cmd_register"
C:\Documents and Settings\Spanner\Desktop\1\register script.pwn(59) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Spanner\Desktop\1\register script.pwn(59) : fatal error 107: too many error messages on one line
Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
4 Errors.
Re: I need help with sscanf -
willsuckformoney - 28.07.2010
are you using the TuT on zcmd & sscanf register or dini & dudb\
EDIT:
make sures u has
zcmd
https://sampforum.blast.hk/showthread.php?tid=91354
sscanf
https://sampforum.blast.hk/showthread.php?tid=120356
Re: I need help with sscanf -
matthewdriftking - 28.07.2010
i redownload em agian, And same errors ;(
Re: I need help with sscanf -
iggy1 - 28.07.2010
You can't use OnPlayerCommandText with zcmd thats your problem. Use OnPlayerCommandRecieved, check out the zcmd topic for more info.
http://forum.sa-mp.com/showthread.ph...highlight=zcmd
Edit: Also are you using the sscanf 2.0 plugin? or just include?
2nd Edt: Try this, delete OnPlayerCommandText and replace it with this:
pawn Код:
CMD:register(playerid, params[])
{
new PlayerName[MAX_PLAYER_NAME];
GetPlayerName(playerid, PlayerName, MAX_PLAYER_NAME);
if(IsLogged[playerid] == 0)
{
new password[25];//delete this if you have password declared
if(sscanf(params, "s", password)) return SendClientMessage(playerid, 0xFF0000AA, "SERVER USAGE: /register <Password>");
else
{
format(file, sizeof(file), "%s.ini", PlayerName);
if(!dini_Exists(file))
{
dini_Create(file);
dini_IntSet(file, "Password", udb_hash(password));
dini_IntSet(file, "Money", GetPlayerMoney(playerid));
dini_IntSet(file, "Score", GetPlayerScore(playerid));
dini_IntSet(file, "Skin", GetPlayerSkin(playerid));
dini_IntSet(file, "World", GetPlayerVirtualWorld(playerid));
dini_IntSet(file, "Interior", GetPlayerInterior(playerid));
SendClientMessage(playerid, 0xFF00FF00, "SERVER: You have succesfully registered the name, you can now /login");
}
else
{
SendClientMessage(playerid, 0xFF0000AA, "SERVER: That name is already registered, reconnect with another name if it isnt your account!");
}
}
}
else
{
SendClientMessage(playerid, 0xFF0000AA, "SERVER: You are already logged in!");
}
return 1;
}