Problem with sscanf2

When i try to make command like this(for private message): /es [Playerid] [Text] then i dont get error but when i try to use this in game the script thinks that kelleleid(player ID who gets the message) is 101, and this happens what ever i type, so when i type "/es 2 Hello." Script send Message like this: ES(vдlja) MyName(MyID) --> 101:{FFFFFF} Hello. And player with ID 2 dont recive the message.

I didnt find any help in forum, please someone give me some advice.

	if(!strcmp(cmd, "/es"))
		new kelleleid, tekst;
		sscanf(params, "is[256]", kelleleid, tekst);
        new kellelenimi[MAX_PLAYER_NAME], kesnimi[MAX_PLAYER_NAME];
        GetPlayerName(kelleleid, kellelenimi, sizeof(kellelenimi));
        GetPlayerName(playerid, kesnimi, sizeof(kesnimi));
		new string[256];
		format(string, sizeof(string), "ES(vдlja) %s(%d) --> %i:{FFFFFF} %s", kesnimi, playerid, kelleleid, tekst);
		SendClientMessage(playerid, COLOR_YELLOW, string);
		format(string, sizeof(string), "ES(sisse) %s(%d) --> %i:{FFFFFF} %s", kesnimi, playerid, kelleleid, tekst);
		SendClientMessage(kelleleid, COLOR_YELLOW, string);
		return 1;

I just found fix, i needed to use:

new kelleleid, tekst[256];

Forum Jump:

Users browsing this thread: 1 Guest(s)