Sscanf 2.6 problem
#1

Heey all,

I have a problem with my sscanf.
I downloaded the newest sscanf 2.6.
But when i used commands like pm or other commands with playerid it detects playerid 0.
Example:When i want to send a pm to playerid 3 it sends the pm to playerid 0.

How can i fix this?

Thanks Admigo
Reply
#2

Show your command

]]
Reply
#3

Код:
//define top of script
#define dcmd(%1,%2,%3) if ((strcmp((%3)[1], #%1, true, (%2)) == 0) && ((((%3)[(%2) + 1] == 0) && (dcmd_%1(playerid, "")))||(((%3)[(%2) + 1] == 32) && (dcmd_%1(playerid, (%3)[(%2) + 2]))))) return 1
//onplayercommand
dcmd(pm,2,cmdtext);
//the command
dcmd_pm(playerid,params[])
{
	new string[128];
	new ID;
	new cmdreason[100];
	if(sscanf(params, "us[100]", ID, cmdreason))
	{
	    SendClientMessage(playerid,COLOR_RED,"USAGE: /pm (Player Name/ID) (Message)");
	    return 1;
	}
    if(!IsPlayerConnected(ID))
	{
	    format(string, sizeof(string), "The Player ID (%d) is not connected to the server.",ID);
	    SendClientMessage(playerid,COLOR_RED,string);
	    return 1;
    }
    if(playerid == ID)
    {
        SendClientMessage(playerid,COLOR_RED,"You cannot pm yourself!");
	    return 1;
    }
	format(string, sizeof(string), "[Private Message] Sent to: %s(%d): %s",PlayerName(ID),ID,cmdreason);
	SendClientMessage(playerid,COLOR_YELLOW,string);

	format(string, sizeof(string), "[Private Message] From: %s(%d) %s",PlayerName(playerid),playerid,cmdreason);
	SendClientMessage(ID,COLOR_YELLOW,string);


    PlayerPlaySound(ID,1085,0.0,0.0,0.0);
	return 1;
}
Since yesterday i got this problem.
All my dcmd commands are bugged.
How can i fix this?
Reply
#4

It's a FS ?
Reply
#5

Nope,its in my gamemode. I am using 0.3d R2 on a linux server.
The plugin is loaded good. Yesterday my script worked perfectly.
Reply
#6

Move DCMD to ZCMD.
Reply
#7

Quote:
Originally Posted by costel_nistor96
Посмотреть сообщение
Move DCMD to ZCMD.
Is it hard to change them from DCMD to ZCMD because i have lots of commands.
Reply
#8

Quote:
Originally Posted by costel_nistor96
Посмотреть сообщение
Move DCMD to ZCMD.
That won't fix the problem.
Reply
#9

Can a wrong Specifiers in one command bug all commands?
Reply
#10

I dont think so..
by wrong you mean one that is supported by sscanf but not correct for your input?
I think anything else would give an error.


does it work with using the name instead of the ID?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)