Jump to content
  • 0

pomoc Prosím poraďte mi


Stellet

Dotaz

public OnPlayerCommandText(playerid, cmdtext[])

{

    if(!strcmp(cmdtext, "/me", true, 3)) // 3 is the length of /me

    {

        if(!cmdtext[3])return SendClientMessage(playerid, 0xFF0000FF, "TIP: /me [akce]");

        new str[128];

        GetPlayerName(playerid, str, sizeof(str));

        format(str, sizeof(str), "* %s %s", str, cmdtext[4]);

        SendClientMessageToAll(0xC2A2DAAA, str);//Aby toto šlo jen nějákej kousek odemě vidět v chatu protože když jsem v Palomino Creek aby to nebylo vidět v Dillimore třeba vzdálenost 20

        return 1;

    }

    return 0;

}

Příklad je tady 

 


if(engine != 1)

{

   engine = 1;

SetVehicleParamsEx(GetPlayerVehicleID(playerid),VEHICLE_PARAMS_ON,lights,alarm,doors,bonnet,boot,objective);

SendClientMessage(playerid, 0xFFFFFFAA, "[CarControl] Nastartoval jsi motor {2F991A}on!");

format(string, sizeof(string), "* %s nastartoval motor auta.", sendername);

   ProxDetector(20.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);

   return 1;

}

Link to comment
Share on other sites

11 odpovědí na tuto otázku

Recommended Posts

  • 0

noa?

Jak udělám aby to nebylo vidět když budu třeba v Palomino Creek a aby to nebylo vidět v LV prostě jen kousek odemě takže dám /me bere pistol a střílí ale aby to neviděli lidi daleko odemě :) 

Link to comment
Share on other sites

  • 0

Nadefinuj si oblasti.

new Float:Oblast[][4] =
{
    {minx, miny, maxx, maxy}, //Palomino Creek
    {minx, miny, maxx, maxy} //Dillimore
}

#define AREA_PALOMINOCREEK 0
#define AREA_DILLIMORE 1

A zjisti, je-li hráč v dané oblasti.

IsPlayerInArea(playerid, areaid)
{
    new Float:Pos[3]; GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
    if(Pos[0] < Oblast[areaid][0] || Pos[1] < Oblast[areaid][1] ||
       Pos[0] > Oblast[areaid][2] || Pos[1] > Oblast[areaid][3]) return false;
    return true;
}

Ve tvém příkazu:

if(IsPlayerInArea(playerid, AREA_PALOMINOCREEK)) SendClientMessageToAll(0xC2A2DAAA, str);
Link to comment
Share on other sites

  • 0

 

Nadefinuj si oblasti.

new Float:Oblast[][4] =
{
    {minx, miny, maxx, maxy}, //Palomino Creek
    {minx, miny, maxx, maxy} //Dillimore
}

#define AREA_PALOMINOCREEK 0
#define AREA_DILLIMORE 1

A zjisti, je-li hráč v dané oblasti.

IsPlayerInArea(playerid, areaid)
{
    new Float:Pos[3]; GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
    if(Pos[0] < Oblast[areaid][0] || Pos[1] < Oblast[areaid][1] ||
       Pos[0] > Oblast[areaid][2] || Pos[1] > Oblast[areaid][3]) return false;
    return true;
}

Ve tvém příkazu:

if(IsPlayerInArea(playerid, AREA_PALOMINOCREEK)) SendClientMessageToAll(0xC2A2DAAA, str);

toto nemyslím já chci aby to prostě šlo všude ale šlo to vicět v chatu jen kousek odemě

Link to comment
Share on other sites

  • 0

On asi myslí, aby ten text videli iba ľudia cca 5 m. od neho.

Jo tak. :d

 

Tak v tom případě takhle:

public OnPlayerCommandText(playerid, cmdtext[])
{
    if(!strcmp(cmdtext, "/me", true, 3)) // 3 is the length of /me
    {
	if(!cmdtext[3])return SendClientMessage(playerid, 0xFF0000FF, "TIP: /me [akce]");
        new str[128], Float:Pos[3];
        GetPlayerName(playerid, str, sizeof(str));
        GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
        format(str, sizeof(str), "* %s %s", str, cmdtext[4]);
        for(new i; i<GetMaxPlayers(); i++)
        {
            if(!IsPlayerConnected(i)) continue;
            if(IsPlayerInRangeOfPoint(i, vzdalenost, Pos[0], Pos[1], Pos[2])) SendClientMessage(i, 0xC2A2DAAA, str); //doplň vzdálenost
        }
	return 1;
    }
    return 0;
}
Link to comment
Share on other sites

  • 0

Oba to máte velice sexy....

Ale ted já :d 

#include <foreach>
#include <zcmd>

Stock - Takže asi nahoru nejlépe

 

stock ProxDetector(Float:radi, playerid, string[],color)
{
    new Float:x,Float:y,Float:z;
    GetPlayerPos(playerid,x,y,z);
    foreach(Player,i)
    {
        if(IsPlayerInRangeOfPoint(i,radi,x,y,z))
        {
            SendClientMessage(i,color,string);
        }
    }
}

Přikaz

CMD:me(playerid, params[]){
    new
        string[128],
        akce[100];
    if(sscanf(params, "s[100]", akce))
    {
        SendClientMessage(playerid, -1, "INFO: /me [akce]");
        return 1;
    }
    else
    {
        format(string, sizeof(string), "* %s %s", GetName(playerid), akce);
        ProxDetector(30, playerid, string, FIALOVA);
    }
    return 1;
}
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...