SA-MP Forums Archive
A /me Script? - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: A /me Script? (/showthread.php?tid=126535)



A /me Script? - jesuschristlordandsavior - 09.02.2010

How would I go about making a /me script?

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

<NICK>Yawns


Re: A /me Script? - BlackFoX - 09.02.2010

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;
}



Re: A /me Script? - hvampire - 09.02.2010

Код:
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