SA-MP Forums Archive
[HELP]using sscanf in strcmp.. - 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: [HELP]using sscanf in strcmp.. (/showthread.php?tid=162164)



[HELP]using sscanf in strcmp.. - LasTRace - 22.07.2010

Код:
dcmd_duel(playerid, params[])
{
	if(!strlen(params)) return SendClientMessage(playerid, mwhite, "Usage: /duel [invite/deny/accept]");

	if (strcmp(params, "invite", true) == 0)
	{
		new ReturnPlayer, ppName[24], ReturnUserName[24], string[128];
		if(sscanf(params, "d", ReturnPlayer)) return SendClientMessage(playerid, mwhite, "Usage: /duel invite [playerid]");
.
.
.
	}
	else if (strcmp(params, "accept", true) == 0)
	{
.
.
	}
	else if (strcmp(params, "deny", true) == 0)
        {
.
.
	}
        else return SendClientMessage(playerid, mwhite, "Usage: /duel [invite/deny/accept]");

return 1;
}
Problem: When i type "/duel invite 1" it returns to "Usage: /duel [invite/deny/accept]", it does not activate sscanf. How can i fix it? or which coding system shall i use to do it?


Re: [HELP]using sscanf in strcmp.. - Kar - 22.07.2010

i dont think think sscanf can work with strcmp

does the usage return when u do /duel invite only?


Re: [HELP]using sscanf in strcmp.. - LasTRace - 22.07.2010

ye, cuz i only used sscanf in "duel invite". Others works quite cool (deny and accept).


Re: [HELP]using sscanf in strcmp.. - LasTRace - 22.07.2010

any ideas? i need it a lot


Re: [HELP]using sscanf in strcmp.. - Kar - 22.07.2010

put the sscanf and thing above it above the invite not in it


Re: [HELP]using sscanf in strcmp.. - LasTRace - 23.07.2010

nah, it gives error when i do this. Maybe there is another way to use this command, need to wait for replies