Unusual bug
#1

These r my cmds
Код:
CMD:me(playerid, params[])
{
	new string[256], msg[256];

	if(sscanf(params, "sz", msg)) return SendClientMessage(playerid,COLOR_RED, "SYNTAX: /me <text>");

	format(string, sizeof(string), "%s %s", GetName(playerid), msg);
	SendClientMessageToAll(COLOR_PURPLE, string);
	return 1;
}
Код:
CMD:do(playerid, params[])
{
	new string[256], msg[256];

	if(sscanf(params, "sz", msg)) return SendClientMessage(playerid,COLOR_RED, "SYNTAX: /do <text>");

	format(string, sizeof(string), "%s. ((%s))", msg, GetName(playerid));
	SendClientMessageToAll(COLOR_PURPLE, string);
	return 1;
}
./me Takes out a tissue paper.

./do Will you allow Omer ? ((Omer))

It will show as

Omer Takes
Will ((Omer))

same for /do cmd, idk why only 1st word is shown
Reply
#2

You need to pass the string size in sscanf.
PHP код:
CMD:me(playeridparams[])
{
    new 
string[256], msg[256];
    if(
sscanf(params"s[256]"msg)) return SendClientMessage(playerid,COLOR_RED"SYNTAX: /me <text>");
    
format(stringsizeof(string), "%s %s"GetName(playerid), msg);
    
SendClientMessageToAll(COLOR_PURPLEstring);
    return 
1;

PHP код:
CMD:do(playeridparams[])
{
    new 
string[256], msg[256];
    if(
sscanf(params"s[256]"msg)) return SendClientMessage(playerid,COLOR_RED"SYNTAX: /do <text>");
    
format(stringsizeof(string), "%s. ((%s))"msgGetName(playerid));
    
SendClientMessageToAll(COLOR_PURPLEstring);
    return 
1;

Reply
#3

Код:
CMD:freezeall(playerid, params[])
{
	//check if the player is a admin
	LevelCheck(playerid, 3);

	LOOP_PLAYERS(i)
	{
        if(i != playerid)
        {
            if(GetPlayerGAdminLevel(playerid) < GetPlayerGAdminLevel(i))
            {
				TogglePlayerControllable(i, false);
				PlayerPlaySound(i, 1057, 0.0, 0.0, 0.0);
            }
		}
	}
	PlayerPlaySound(playerid, 1057, 0.0, 0.0, 0.0);

	new string[144];
	format(string, sizeof(string), "* admin %s[%i] has freezed all players.", ReturnPlayerName(playerid), playerid);
	SendClientMessageToAll(COLOR_DODGER_BLUE, string);
	return 1;
}
No output
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)