Need advice
#1

pawn Код:
CMD:a(playerid,params[])
{
    AdminChats(playerid,params[]);// 1
    return 1;
}
CMD:admin(playerid,params[])
{
    AdminChats(playerid,params[]); // 2
    return 1;
}
AdminChats(playerid,params[])
{
    if (Pinfo[playerid][Admin] >= 1)
    {
        new string[256],text[256],idx;
        GetStringText(params, idx, text);
        if(!strlen(text))
        {
            SCM(playerid, COLOR_GRAD1, "TIP: /a [text]");
            return 1;
        }
        format(string, sizeof(string), "  Admin chat %s: %s", PlayerName[playerid],text);
        SendMessageToAdmin(COLOR_LIGHTGREEN,string,1);
    }
    return 1;
}
1,2 error 029: invalid expression, assumed zero

I just can't understand whats wrong, or I need to make it in different way?
Reply
#2

Which line is invalid expession?

EDIT: I see the comments now
Reply
#3

Eh didn't you need a public or stock infront of AdminCharts?

If not maybe
pawn Код:
AdminChats(playerid,params);
Reply
#4

pawn Код:
CMD:a(playerid,params[])
{
    AdminChats(playerid,params);// 1
    return 1;
}
CMD:admin(playerid,params[])
{
    AdminChats(playerid,params); // 2
    return 1;
}
AdminChats(playerid,params[])
{
    if (Pinfo[playerid][Admin] >= 1)
    {
        new string[256],text[256],idx;
        GetStringText(params, idx, text);
        if(!strlen(text))
        {
            SCM(playerid, COLOR_GRAD1, "TIP: /a [text]");
            return 1;
        }
        format(string, sizeof(string), "  Admin chat %s: %s", PlayerName[playerid],text);
        SendMessageToAdmin(COLOR_LIGHTGREEN,string,1);
    }
    return 1;
}
Reply
#5

A better method than commands,

OnPlayerText
pawn Код:
if(text[0] == '#' && Pinfo[playerid][Admin] >= 1)
{
    new string[128]; GetPlayerName(playerid,string,sizeof(string));
    format(string,sizeof(string),"Admin Chat: %s: %s",string,text[1]);
    for(new i; i < MAX_PLAYERS; i++)
    {
        if(Pinfo[i][Admin] >= 1)
        {
            SendClientMessage(i, ADMIN_COLOR, string);
        }
    }
    return 0;
}
Anything after '#' will be sent to admins
Reply
#6

Oghh..,,, Thank you guys
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)