helpme problem
#1

It doesn't work
Код:
CMD:helpme(playerid, params[])
{
	new str[128], Name1[MAX_PLAYER_NAME];
	if(sscanf(params,"s[128]", str))
	{
	 SendClientMessage(playerid, red,"CORRECT USAGE: /helpme [text]");
	 return 1;
	}
	GetPlayerName(playerid, Name1, sizeof(Name1));
	format(str, sizeof(str),"{00FFFF}[HELP MSG From %s]:{00FFF0} %s",Name1, str);
	MessageToTwice(red, str);
	SendClientMessage(playerid, yellow,"Your Request has been sent to online Administrators.");
	return 1;
}
Reply
#2

What does exactly not work? What is it supposed to do and what does it do instead? The command itself has no fail.
Reply
#3

this command doesn't work when i type it, send to me the client message : CORRECT USAGE: /helpme [text].
Reply
#4

I've never used sscanf myself, but shouldn't you define "s[128]" to "s[8]" or something? However long the minimum string length is?
Reply
#5

pawn Код:
if(sscanf(params,"s[128]", str))
Instead of 'str' you can try and change it with 'params'.
Reply
#6

You're problem is in your string. You're reformating the string.
Try something like this:
pawn Код:
CMD:helpme(playerid, params[])
{
    new str[128], text[56] Name1[MAX_PLAYER_NAME];
    if(sscanf(params,"s[56]", text))
    {
     SendClientMessage(playerid, red,"CORRECT USAGE: /helpme [text]");
     return 1;
    }
    GetPlayerName(playerid, Name1, sizeof(Name1));
        // In the line below, you were formatting the 'str' variable which was used in the sscanf sentence.
    format(str, sizeof(str),"{00FFFF}[HELP MSG From %s]:{00FFF0} %s",Name1, text);
    MessageToTwice(red, str);
    SendClientMessage(playerid, yellow,"Your Request has been sent to online Administrators.");
    return 1;
}
Reply
#7

pawn Код:
MessageToTwice(red, str);
This is the problem then.
Reply
#8

REP + ALL TY
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)