Making an /L command
#1

I'm trying to make an /l command for my server, but it's not working. I'm not sure why, it just doesn't send the message to anyone but yourself. Here's the code:
pawn Код:
if(!strcmp("/l", cmdtext, true, 2)) {
        if(!cmdtext[2]) return SendClientMessage(playerid, RED, "THIS IS HOW WE DO IT: /l [Local Chat]");
        new str[256];
        GetPlayerName(playerid, str, sizeof(str));
        format(str, sizeof(str), "%s says: %s", str, cmdtext[3]);
        for (new i=0; i<=MAX_PLAYERS; i++){
            new
                Float:x,
                Float:y,
                Float:z;
            GetPlayerPos(i, x, y, z);
            switch(GetPlayerDistanceFromPoint(playerid, x, y, z)){
                case 0..5: SendClientMessage(i, COLOR_FADE1, str);
                case 6..10: SendClientMessage(i, COLOR_FADE2, str);
                case 11..15: SendClientMessage(i, COLOR_FADE3, str);
                case 16..20: SendClientMessage(i, COLOR_FADE4, str);
                case 21..25: SendClientMessage(i, COLOR_FADE5, str);
            }
        }
        return 1;
    }
COLOR_FADE1 and all the other fades are defined in the top of my script as following:
pawn Код:
#define COLOR_FADE1 0xFFFFFFFF
#define COLOR_FADE2 0xC8C8C8C8
#define COLOR_FADE3 0xAAAAAAAA
#define COLOR_FADE4 0x8C8C8C8C
#define COLOR_FADE5 0x6E6E6E6E
Thanks in advance!
Reply


Messages In This Thread
Making an /L command - by iPoisonxL - 03.07.2013, 15:42
Re: Making an /L command - by iPoisonxL - 03.07.2013, 16:10
Re: Making an /L command - by TheStreetsRP - 03.07.2013, 16:11
Re: Making an /L command - by introzen - 03.07.2013, 16:12
Re: Making an /L command - by iPoisonxL - 03.07.2013, 16:22
Re: Making an /L command - by Anak - 03.07.2013, 17:06
Re: Making an /L command - by iPoisonxL - 03.07.2013, 17:11
Re: Making an /L command - by Antonio144 - 03.07.2013, 17:21
Re: Making an /L command - by tony_fitto - 03.07.2013, 17:28
Re: Making an /L command - by iPoisonxL - 04.07.2013, 10:25

Forum Jump:


Users browsing this thread: 1 Guest(s)