Sscanf2 Error, someone help? - 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: Sscanf2 Error, someone help? (
/showthread.php?tid=272268)
Sscanf2 Error, someone help? -
Desertsoulz - 27.07.2011
Код:
C:\Users\Desertsoulz_2\Desktop\Windows\gamemodes\DesertsoulzScript.pwn(2346) : error 035: argument type mismatch (argument 1)
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
1 Errors.
I get this error on this code...
Код:
CMD:fcreate(playerid, params)
{
if(Player[playerid][pAdminLevel] >= 3)
{
new
FacID,
FacType;
if(sscanf(params, "dd", FacID, FacType)) // This line gets the error.
{
SendClientMessage(playerid, -1, ""#YELLOW"[Server]: /fcreate [FacID] [FacType]");
} else {
if(Faction[FacID][fEnabled] == 1 || Faction[FacID][fGameID] == 0)
{
SendClientMessage(playerid, -1, ""#YELLOW"[Server]["#RED"Error!"#YELLOW"]: This Faction ID is already in use!");
} else {
Faction[FacID][fEnabled] = 1;
Faction[FacID][fType] = FacType;
LoadFactionEx(FacID);
SaveFaction(FacID);
SendClientMessage(playerid, -1, ""#YELLOW"[Server]: You have created a new faction!");
}
}
}
return 1;
}
And I do not know what I did wrong... Can someone point out the problem?
Re: Sscanf2 Error, someone help? -
Burridge - 27.07.2011
The SScanf line looks fine. However:
pawn Код:
CMD:fcreate(playerid, params)
Should be:
pawn Код:
CMD:fcreate(playerid, params[])
Re: Sscanf2 Error, someone help? -
Calgon - 27.07.2011
You've declared 'params' as an integer, not a string.
pawn Код:
CMD:fcreate(playerid, params[])
Correcting the top line of the command code you pasted to include the open and closed square parenthesis will fix it.
Re: Sscanf2 Error, someone help? -
Desertsoulz - 27.07.2011
ah i worked too fast and didn't catch that, thank you Calg00ne ^^ and Burridge =D
I gave Burridge rep
I cant give Calg00ne rep because I already gave him rep recently... but thanks very much Calg00ne!