Unusual bug - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Unusual bug (
/showthread.php?tid=651127)
Unusual bug -
OmerKhan - 14.03.2018
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
Re: Unusual bug -
Zeth - 14.03.2018
You need to pass the string size in sscanf.
PHP код:
CMD:me(playerid, params[])
{
new string[256], msg[256];
if(sscanf(params, "s[256]", msg)) return SendClientMessage(playerid,COLOR_RED, "SYNTAX: /me <text>");
format(string, sizeof(string), "%s %s", GetName(playerid), msg);
SendClientMessageToAll(COLOR_PURPLE, string);
return 1;
}
PHP код:
CMD:do(playerid, params[])
{
new string[256], msg[256];
if(sscanf(params, "s[256]", msg)) return SendClientMessage(playerid,COLOR_RED, "SYNTAX: /do <text>");
format(string, sizeof(string), "%s. ((%s))", msg, GetName(playerid));
SendClientMessageToAll(COLOR_PURPLE, string);
return 1;
}
Re: Unusual bug -
OmerKhan - 14.03.2018
Код:
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