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



sscanf - legodude - 11.07.2010

if (sscanf(idx, "uz", giveplayerid, msg)) SendClientMessage(playerid, 0xFF0000AA, "Usage: /pm [playerid/part of name] [message]");

whats wrong with this line??

Код:
new cmd[256];
	new idx;
	cmd = strtok(cmdtext, idx);
	if(strcmp(cmd, "/pm", true) == 0)
	{
	new
		giveplayerid,
		msg;
	if (sscanf(idx, "us", giveplayerid, msg)) SendClientMessage(playerid, 0xFF0000AA, "Usage: /pm [playerid/part of name] [message]");
	else if (giveplayerid == INVALID_PLAYER_ID) SendClientMessage(playerid, 0xFF0000AA, "Player not found");
	else
	{
        //pm code
	}
	return 1;
	}
	return 0;
}



Re: sscanf - Carlton - 11.07.2010

if (sscanf(idx, "us", giveplayerid, msg)) SendClientMessage(playerid, 0xFF0000AA, "Usage: /pm [playerid/part of name] [message]");


Re: sscanf - MadeMan - 11.07.2010

What is "idx"?


Re: sscanf - legodude - 11.07.2010

at first fix i got this error:
error 035: argument type mismatch (argument 1)

IDX is what comes after cmdtext right?


Re: sscanf - MadeMan - 11.07.2010

Try this:

if (sscanf(cmdtext[idx], "us", giveplayerid, msg)) SendClientMessage(playerid, 0xFF0000AA, "Usage: /pm [playerid/part of name] [message]");


Re: sscanf - legodude - 11.07.2010

no error's(will try ingame later)

THX!!


Re: sscanf - selten98 - 11.07.2010

you can get the pm stuff from the base fs