[HELP]using sscanf in strcmp..
#1

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

i dont think think sscanf can work with strcmp

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

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

any ideas? i need it a lot
Reply
#5

put the sscanf and thing above it above the invite not in it
Reply
#6

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


Forum Jump:


Users browsing this thread: 1 Guest(s)