Beiträge von Toxic_Tomato


    Jo:

    new bool:SendGlobal[MAX_PLAYERS];
    public OnPlayerCommandText(playerid,cmdtext[])
    {
    if(!strcmp("/uc",cmdtext))
    {
    if(SendGlobal[playerid])
    {
    SendGlobal[playerid] = false;
    SendClientMessage(playerid,0x545454AA,"Globalerchat deaktiviert!");
    }
    else
    {
    SendGlobal[playerid] = true;
    SendClientMessage(playerid,0x545454AA,"Globalerchat aktiviert!");
    }
    }
    }


    public OnPlayerText(playerid, text[] ) {
    if(SendGlobal[playerid])
    return 1;
    new Float:x,Float:y,Float:z,name[MAX_PLAYER_NAME],string[128];
    GetPlayerName(playerid,name,MAX_PLAYER_NAME);
    format(string,128,"%s sagt: %s",name,text);
    GetPlayerPos(playerid,x,y,z);
    for(new i; i
    if (IsPlayerInRangeOfPoint(i,50,x,y,z))
    SendClientMessage(i,0x444444AA,string);
    else
    continue;
    }
    return 0;
    }

    Wie kann ich denn verschiedene Chats machen?
    Beispiel: /uc
    damit können nur Leute die 50 meter von mir weg sind mitlesen...


    Das ist sehr simpel!

    public OnPlayerText(playerid, text[] ) {
    new Float:x,Float:y,Float:z,name[MAX_PLAYER_NAME],string[128];
    GetPlayerName(playerid,name,MAX_PLAYER_NAME);
    format(string,128,"%s sagt: %s",name,text);
    GetPlayerPos(playerid,x,y,z);
    for(new i; i<MAX_PLAYERS;i++) {
    if (IsPlayerInRangeOfPoint(i,50,x,y,z))
    SendClientMessage(i,0x444444AA,string);
    else
    continue;
    }
    return 0;
    }