/me /ooc
#2

Quote:
Originally Posted by Jermi
Посмотреть сообщение
Please give me full code for /me and /ooc with zcmd...

Thank you
+Rep if you helped
To be honest, just copy and pasting you will learn nothing, So I'll try to help you with simplistic terms

For /me and /ooc you will need to use something called Prox Detector. This is something which calculates your distance between players and localizes your chat. For example, it'd make your /me commands visible only to players near you. Here is a prox detector stock:

Код:
stock ProxDetector(Float:radi, playerid, string[],color) //ready the stock
{
    new Float:x,Float:y,Float:z; //define x,y,z to be later used.
    GetPlayerPos(playerid,x,y,z); //get the position of yourself and store it in x,y,z
    foreach(Player,i) //create a loop for all players.
    {
        if(IsPlayerInRangeOfPoint(i,radi,x,y,z)) //check if players are in radius of you
        {
               if(GetPlayerVirtualWorld(i) == GetPlayerVirtualWorld(playerid)) //check if they're in your virtual world
               {
               SendClientMessage(i,color,string); //send the message
               }
        }
    }
}
You will also need the foreach include by ******. Download it here then place it in Pawno>>Include. Then add this to the top of your script:

Код:
#include <foreach>
The rest is fairly simple.

Код:
CMD:me(playerid, params[]) //use zcmd to initiate command
{
    new
        string[128], //set up a string
        action[100]; //set up the action
        name[100]; //Set up name
    if(sscanf(params, "s[100]", action)) //check if they've typed it properly.
    {
        SendClientMessage(playerid, green, "<System> To use this command, type /me followed by your characters action.");
        return 1;
    }
    else
    {
        GetPlayerName(playerid, name, sizeof(name));
        format(string, sizeof(string), "%s %s", name, action);
        ProxDetector(15, playerid, string, COLOR_PURPLE); //finally send it to nearby players
    }
    return 1;
}
*You will also require Sscanf2, which can be acquired with simple searching if you don't already have it.

/ooc can be done easily if you understand this.
Reply


Messages In This Thread
/me /ooc - by Jermi - 12.08.2012, 03:27
Re: /me /ooc - by Forge - 12.08.2012, 03:38
Re: /me /ooc - by Jermi - 12.08.2012, 03:44
Re: /me /ooc - by Jermi - 12.08.2012, 03:46
Re: /me /ooc - by Jermi - 12.08.2012, 03:51
Re: /me /ooc - by Forge - 12.08.2012, 04:01
Re: /me /ooc - by Jermi - 12.08.2012, 04:02
Re: /me /ooc - by Jermi - 12.08.2012, 04:08
Re: /me /ooc - by Forge - 12.08.2012, 04:35
Re: /me /ooc - by Devilxz97 - 12.08.2012, 05:19

Forum Jump:


Users browsing this thread: 1 Guest(s)