01.02.2011, 16:39
i still dont understand why ppl always copy&paste for a single thing.
Enjoy.
}
}
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
new cmd[128], sendername[MAX_PLAYER_NAME];
if(strcmp(cmd, "/me", true) == 0)
{
GetPlayerName(playerid, sendername, sizeof(sendername));
GiveNameSpace(sendername);
if(PlayerInfo[playerid][pMaskUse] == 1) { format(sendername, sizeof(sendername), "Stranger_%d", RandMask[playerid]); }
new length = strlen(cmdtext);
if(Mute[playerid] == 1)
{
SendClientMessage(playerid, TEAM_CYAN_COLOR, "You cannot speak, you have been silenced");
return 1;
}
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[128];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = cmdtext[idx];
idx++;
}
result[idx - offset] = EOS;
if(!strlen(result))
{
SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /me [action]");
return 1;
}
GetPlayerName(playerid,sendername,128);
format(string, sizeof(string), "* %s %s", sendername, result);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
//printf("%s", string);
return 1;
}
}