problems with some commands
#2

pawn Код:
public OnPlayerText(playerid, text[])
{
    if(text[0] == '#')
    {
        new pid, string[128]; // MAX string is 128! You can also calculate how big string you need...
        new help[MAX_PLAYER_NAME];
        GetPlayerName(playerid, help, 24);
        format(string, 128, "( # ) %s(ID: %i)",help, playerid, pid, text);
        MessageToAdmins(AdminColor, string);
        SendClientMessage(playerid, Yellow, "Your message has been sent to admins.");
        return 0;
    }
}
Now just do #[text]
And the second problem:
pawn Код:
public OnPlayerDisconnect(playerid, reason)
{
    new name[MAX_PLAYER_NAME], file[256];
    GetPlayerName(playerid, name, sizeof(name));
    format(file, sizeof(file), SERVER_USER_FILE, name);
    if(gPlayerLogged[playerid] == 1)
    if(playerid == g_DuelingID1 || playerid == g_DuelingID2)
    g_DuelInProgress = 0;
    GetPlayerName(playerid, name, sizeof(name));
    new string[64];
    switch(reason)
    {
        case 0: format(string, sizeof(string), "%s has left the server (Timedout)", name);
        case 1: format(string, sizeof(string), "%s has left the server (Leaving)", name);
        case 2: format(string, sizeof(string), "%s has left the server (Kicked)", name);
    }
    SendClientMessageToAll(Yellow, string);
    {
        dini_IntSet(file, "AdminLevel",PlayerInfo[playerid][pAdminLevel]);
    }
    gPlayerLogged[playerid] = 0;
    return 1;
}
You forgot to add SendClientMessageToAll, also change the color to your desired color.
Reply


Messages In This Thread
problems with some commands - by xir - 07.01.2011, 10:15
Re: problems with some commands - by Mean - 07.01.2011, 10:27
Re: problems with some commands - by xir - 07.01.2011, 10:47
Re: problems with some commands - by xir - 07.01.2011, 11:12
Re: problems with some commands - by Mean - 07.01.2011, 11:26
Re: problems with some commands - by xir - 07.01.2011, 11:47
Re: problems with some commands - by Mean - 07.01.2011, 12:35
Re: problems with some commands - by xir - 07.01.2011, 13:02

Forum Jump:


Users browsing this thread: 1 Guest(s)