Admin chat
#7

i made this :
pawn Код:
stock SendMessage(playerid, color, type[], {Float,_}:...)
{
    new
        string[128];
    for(new i = 0; i < numargs() - 2; i++)
    {
        switch(type[i])
        {
            case 's':
            {
                new
                    result[128];
                for(new a = 0; getarg(i + 3, a) != 0; a++)
                {
                    result[a] = getarg(i + 3, a);
                }
                if(!strlen(string))
                {
                    format(string, sizeof(string), "%s", result);
                } else format(string, sizeof(string), "%s%s", string, result);
            }
            case 'i':
            {
                new
                    result = getarg(i + 3);
                if(!strlen(string))
                {
                    format(string, sizeof(string), "%i", result);
                } else format(string, sizeof(string), "%s%i", string, result);
            }
            case 'f':
            {
                new
                    Float:result = Float:getarg(i + 3);
                if(!strlen(string))
                {
                    format(string, sizeof(string), "%f", result);
                } else format(string, sizeof(string), "%s%f", string, result);
            }
        }
    }
    SendClientMessage(playerid, color, string);
    return 1;
}

stock SendMessageToAll(color, type[], {Float,_}:...)
{
    new
        string[128];
    for(new i = 0; i < numargs() - 2; i++)
    {
        switch(type[i])
        {
            case 's':
            {
                new
                    result[128];
                for(new a = 0; getarg(i + 3, a) != 0; a++)
                {
                    result[a] = getarg(i + 3, a);
                }
                if(!strlen(string))
                {
                    format(string, sizeof(string), "%s", result);
                } else format(string, sizeof(string), "%s%s", string, result);
            }
            case 'i':
            {
                new
                    result = getarg(i + 3);
                if(!strlen(string))
                {
                    format(string, sizeof(string), "%i", result);
                } else format(string, sizeof(string), "%s%i", string, result);
            }
            case 'f':
            {
                new
                    Float:result = Float:getarg(i + 3);
                if(!strlen(string))
                {
                    format(string, sizeof(string), "%f", result);
                } else format(string, sizeof(string), "%s%f", string, result);
            }
        }
    }
    SendClientMessageToAll(color, string);
    return 1;
}
I just want that the admin can say something to all players not a admin chat i did wrong sorry xD

EDIT: Thanks it works !
Reply


Messages In This Thread
Admin chat - by Santox14 - 04.11.2011, 16:49
Re: Admin chat - by SmiT - 04.11.2011, 17:05
Re: Admin chat - by Zonoya - 04.11.2011, 17:12
Re: Admin chat - by SmiT - 04.11.2011, 17:13
Re: Admin chat - by Zonoya - 04.11.2011, 17:14
Re: Admin chat - by Kingunit - 04.11.2011, 17:20
AW: Admin chat - by Santox14 - 04.11.2011, 17:30
Re: Admin chat - by Zonoya - 04.11.2011, 17:31
Re: Admin chat - by Kingunit - 04.11.2011, 18:12
AW: Admin chat - by Santox14 - 04.11.2011, 18:47

Forum Jump:


Users browsing this thread: 8 Guest(s)