Sscanf2 Error, someone help?
#1

Код:
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?
Reply
#2

The SScanf line looks fine. However:

pawn Код:
CMD:fcreate(playerid, params)
Should be:
pawn Код:
CMD:fcreate(playerid, params[])
Reply
#3

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.
Reply
#4

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!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)