A /me Script?
#1

How would I go about making a /me script?

Like, actions
[me=jesuschristlordandsavior]yawns[/me]

<NICK>Yawns
Reply
#2

pawn Код:
if(!strcmp(cmdtext,"/me",true,3))
{
    if(cmdtext[5])return SendClientMessage(playerid,0xFF0000FF,"Use /me [text]");
    new pl_name[MAX_PLAYER_NAME],message[128];
    GetPlayerName(playerid,pl_name,sizeof pl_name);
    format(message,sizeof message,"%s %s",pl_name,cmdtext[5]);
    sendAllNear(playerid,message,0xFFFFFFFF);
    return 1;
}
pawn Код:
sendAllNear(playerid,text[],color)
{
    new Float:ppx,Float:ppy,Float:ppz;
    GetPlayerPos(playerid,ppx,ppy,ppz);
    for(new i = 0;i<MAX_PLAYERS;i++)
    {
        if(!IsPlayerConnected(i) || IsPlayerNPC(i) || !IsPlayerInRangeOfPoint(i,3.0,ppx,ppy,ppz))continue;
        SendClientMessage(i,color,text);
    }
    return 1;
}
Reply
#3

Код:
if(!strcmp(cmdtext, "/me", true, 3))
  {
    if(!cmdtext[3])return SendClientMessage(playerid, 0xFF9900AA, "USAGE: /me [Text]");
    new str[128];
    GetPlayerName(playerid, str, sizeof(str));
    format(str, sizeof(str), "* %s %s", str, cmdtext[4]);
    SendClientMessageToAll(0xFFFF00AA, str);
    return 1;
  }
that's it
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)