13.11.2014, 08:30
Install sscanf.
Code for /me
Code for /do
Code for /me
pawn Код:
if(strcmp(cmdtext, "/me", true) == 0)
{
new msg [145], name[MAX_PLAYER_NAME], str [145];
GetPlayerName(playerid, name, sizeof(name));
if(sscanf(cmdtext, "z[144]", msg))
{
SendClientMessage(playerid, -1, "Usage : /me [action]");
}
else
{
format(str, sizeof(str), "%s %s", name, msg);
SendClientMessageToAll(-1, str) ;
}
return 1;
}
pawn Код:
if(strcmp(cmdtext, "/do", true) == 0)
{
new msg[145], str [145], name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name , sizeof(name));
if(sscanf(cmdtext, "z[144]", msg))
{
SendClientMessage(playerid, -1, "Usage : /do [action]");
}
else
{
format(str, sizeof(str), "%s (( %s ))", msg, name);
SendClientMessageToAll(-1, str);
}
return 1;
}