SA-MP Forums Archive
Help Please - 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: Help Please (/showthread.php?tid=535685)



Help Please - adithegman - 05.09.2014

I get this error when i try to use sscanf for a /v command

Rp.pwn(3630) : error 035: argument type mismatch (argument 1)
Rp.pwn(3632) : error 035: argument type mismatch (argument 1)

Код:
CMD:v(playerid,params[])
{
	if(LoggedIn[playerid] == 0) return SendClientMessage(playerid,COLOR_WHITE,"**** You need to login/register first!");
	new option[12],model,color1,color2;
	new Name[MAX_PLAYER_NAME],string[128];
	GetPlayerName(playerid,Name,sizeof(Name));
	sscanf(params,"s[12]",option);
	if(isnull(option))
	{
		SendClientMessage(playerid, COLOR_LIGHTYELLOW, "USAGE: /(v)ehicle [action]");
		return 1;
	}
	if(!strcmp(option,"buy"))
	{
		if(IsPlayerInRangeOfPoint(playerid,5,542.9552,-1292.2853,17.2422))
		{
			if(!sscanf(option,"d",model))
			{
				if(!sscanf(model,"d",color1)) // line 3630
				{
					if(!sscanf(color1,"d",color2) // line 3632
					{
	                                            //Code... 
					}
				}
			}
		}
	}
	return 1;
}
Line 3630:
Код:
if(!sscanf(model,"d",color1))
Line 3632:
Код:
if(!sscanf(color1,"d",color2)



Re: Help Please - VishvaJeet - 05.09.2014

Use i for integer value not d


Re: Help Please - adithegman - 05.09.2014

doesn't change anything, same errors :c


Re: Help Please - Isolated - 05.09.2014

Misread.


Re: Help Please - VishvaJeet - 05.09.2014

Model, color1 value is integer but sscanf(string valie, "", variable)


Re: Help Please - LivingLikeYouDo - 05.09.2014

pawn Код:
if(!sscanf(params,"d",color1))



Re: Help Please - adithegman - 05.09.2014

[SOLVED]