[Ayuda] Comando MP
#4

Te dejo este esta mejor

con este podras mirar si te quiren hacer spam en el server por mp

claro si lo confoguras con tu sistema de admins

velo

pawn Код:
if(strcmp(cmd, "/pm", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            if(gPlayerLogged[playerid] == 0)
            {
                SendClientMessage(playerid, COLOR_GREY, "   No as logiado todavia.");
                return 1;
            }
            tmp = strtok(cmdtext, idx);
            if(!strlen(tmp))
            {
                SendClientMessage(playerid, COLOR_GRAD2, "USA: /pm [ID] [text]");
                return 1;
            }
            if(PlayerInfo[playerid][pMuted] == 1)
            {
                SendClientMessage(playerid, COLOR_GRAD2, "Usted esta callado No puede hablar.");
                return 1;
            }
            giveplayerid = ReturnUser(tmp);
            if (IsPlayerConnected(giveplayerid))
            {
                if(giveplayerid != INVALID_PLAYER_ID)
                {
                        GetPlayerName(playerid, sendername, sizeof(sendername));
                        GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
                        new length = strlen(cmdtext);
                        while ((idx < length) && (cmdtext[idx] <= ' '))
                        {
                            idx++;
                        }
                        new offset = idx;
                        new result[128];
                        while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
                        {
                            result[idx - offset] = cmdtext[idx];
                            idx++;
                        }
                        result[idx - offset] = EOS;
                        if(!strlen(result))
                        {
                            SendClientMessage(playerid, COLOR_GRAD2, "USE: /pm [ID] [text]");
                            return 1;
                        }
                        format(string, sizeof(string), "* PM from %s(ID: %d): %s.", sendername, playerid, (result));
                        SendClientMessage(giveplayerid, COLOR_YELLOW, string);
                        format(string, sizeof(string), "* PM to %s(ID: %d): %s.", giveplayer, giveplayerid, (result));
                        SendClientMessage(playerid,  COLOR_YELLOW, string);
                        format(string, sizeof(string), "* PM from %s(ID: %d) to %s(ID: %d): %s.", sendername, playerid, PlayerName(giveplayerid), giveplayerid,  (result));
                        ABroadCast(COLOR_ORANGE, string, 1);
                        return 1;
                }
            }
            else
            {
                    format(string, sizeof(string), "   %d Este jugador no est activo.", giveplayerid);
                    SendClientMessage(playerid, COLOR_GRAD2, string);
            }
        }
        return 1;
    }
a y te dejo los defines para los colores

pawn Код:
#define COLOR_GREEN      0x33AA33AA
#define COLOR_GRAD2      0xBFC0C2FF
#define COLOR_ORANGE     0xF97804FF
#define COLOR_YELLOW     0xFFFF00AA
Reply


Messages In This Thread
[Ayuda] Comando MP - by ronaldfa - 30.01.2012, 04:28
Respuesta: [Ayuda] Comando MP - by TiNcH010 - 30.01.2012, 04:38
Respuesta: [Ayuda] Comando MP - by ronaldfa - 30.01.2012, 04:47
Respuesta: [Ayuda] Comando MP - by adrianxd - 30.01.2012, 04:50
Respuesta: [Ayuda] Comando MP - by ronaldfa - 30.01.2012, 04:53
Respuesta: [Ayuda] Comando MP - by [Nikk] - 30.01.2012, 04:53
Respuesta: [Ayuda] Comando MP - by adrianxd - 30.01.2012, 04:54
Respuesta: [Ayuda] Comando MP - by ronaldfa - 30.01.2012, 04:56
Respuesta: [Ayuda] Comando MP - by adrianxd - 30.01.2012, 04:59
Respuesta: [Ayuda] Comando MP - by ronaldfa - 30.01.2012, 05:01

Forum Jump:


Users browsing this thread: 2 Guest(s)