SA-MP Forums Archive
[ayuda]Sistema inmunidad - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: Non-English (https://sampforum.blast.hk/forumdisplay.php?fid=9)
+--- Forum: Languages (https://sampforum.blast.hk/forumdisplay.php?fid=33)
+---- Forum: Español/Spanish (https://sampforum.blast.hk/forumdisplay.php?fid=29)
+---- Thread: [ayuda]Sistema inmunidad (/showthread.php?tid=311681)



[ayuda]Sistema inmunidad - Cristian330 - 17.01.2012

Bueno Pues Me Encontre un sistema de inmunidad para los bots que no sean baneados ni kickeados ni nada que se creaba los frodward

ZCMD
pawn Код:
forward Inmune(playerid);
public Inmune(playerid)
{

   
    Connect
    new nick[MAX_PLAYER_NAME];
    GetPlayerName(playerid, nick, sizeof(nick));
    if(!strcmp(nick, "Beautiful_Jou", true)
     ||!strcmp(nick, "Felete_Garcia", true)
     ||!strcmp(nick, "Matias_Prats", true)
     ||!strcmp(nick, "James_Bond", true)
     ){return 1;}
    else { return 0; }
    endif
    return 0;
}
NORMAL CMD
pawn Код:
forward Inmune(playerid);
public Inmune(playerid)
{


    if(IsPlayerConnected(playerid))
    {
        new nick[MAX_PLAYER_NAME];
        GetPlayerName(playerid, nick, sizeof(nick));
        if(!strcmp(nick, "Beautiful_Jou", true)
            ||!strcmp(nick, "Felete_Garcia", true)
            ||!strcmp(nick, "Matias_Prats", true)
            ||!strcmp(nick, "James_Bond", true))
    {
    return 1;
    }
    else
    {
    return 0;
    }
    }
    return 0;
}
pero lo que no entendi por que zcmd :S es para flojos practicamente xD entonces no lo pude implementar en cmd normal en los comandos ban
no sirve ni colocandolo asi

que haci esta en zcmd la verdad qe es un enredo saber como pasar de zcmd a cmd normal... :S
pawn Код:
if(Inmune(params[0])){
                    format(string, sizeof(string), "ATENCIУN: %s intentу banear a %s", PlayerName(playerid), PlayerName(params[0]));
                    A_Info(string);
                    Ban(params[0]);
                    return 1;
                }
si alguien sabe como hacer para implementarlo a cmd normal se le agradece por favor ayuda


Respuesta: [ayuda]Sistema inmunidad - junkbuster - 17.01.2012

Si quieres que te salga bien, no copies y pegues.

Y zcmd no es para flojos, con ese include el comando se procesa mucho mбs rapido.


Respuesta: [ayuda]Sistema inmunidad - Cristian330 - 17.01.2012

si me respondistes quede calrisimo xD


Respuesta: [ayuda]Sistema inmunidad - iDarkRain - 17.01.2012

Jajjajaja para flojos xD flojo es el que le da pereza bajar el include y pasarse todos los comandos del GM.

Ni el "Connect" ni el "endif" son parte de ZCMD, son defines del GM de donde se sacу eso, en vez de hacer eso utiliza IsPlayerNPC.

En vez de:

pawn Код:
if(Inmune(params[0]))
coloca:

pawn Код:
if(IsPlayerNPC(params[0]))



Respuesta: [ayuda]Sistema inmunidad - iDarkRain - 17.01.2012

Jajjajaja para flojos xD flojo es el que le da pereza bajar el include y pasarse todos los comandos del GM.

Ni el "Connect" ni el "endif" son parte de ZCMD, son defines del GM de donde se sacу eso, en vez de hacer eso utiliza IsPlayerNPC.

En vez de:

pawn Код:
if(Inmune(params[0]))
coloca:

pawn Код:
if(IsPlayerNPC(params[0]))



Respuesta: [ayuda]Sistema inmunidad - Cristian330 - 17.01.2012

Quote:
Originally Posted by iDarkRain
Посмотреть сообщение
Jajjajaja para flojos xD flojo es el que le da pereza bajar el include y pasarse todos los comandos del GM.

Ni el "Connect" ni el "endif" son parte de ZCMD, son defines del GM de donde se sacу eso, en vez de hacer eso utiliza IsPlayerNPC.

En vez de:

pawn Код:
if(Inmune(params[0]))
coloca:

pawn Код:
if(IsPlayerNPC(params[0]))
jaja is el peresoso soy yo

pero por ejemplo hay esta mi nombre tambien queiro ser inmune al ban D: mas facil en ez de esta cambiando en cada comando para eso es la function


Respuesta: [ayuda]Sistema inmunidad - junkbuster - 18.01.2012

"Connect" y "endif" son macros que estбn en el GM de CiudadMetrуpolis.

pawn Код:
#define \
        Connect \
                if(IsPlayerConnected(playerid)) {
#define \
        endif   \
                    }



Respuesta: [ayuda]Sistema inmunidad - Cristian330 - 18.01.2012

perdon pero es que yo uso es Comando Normal yy lo que no se es como hacer para que el Imune mejor dicho como hacer servir eso en mis comandos /ban /kick


Respuesta: [ayuda]Sistema inmunidad - joni_paglia - 19.01.2012

y que tal si usas un comando para modificarlo y darte inmunidad ?.. ejemplo

pawn Код:
if(strcmp(cmd, "/kick", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            tmp = strtok(cmdtext, idx);
            if(!strlen(tmp))
            {
                SendClientMessage(playerid, COLOR_GRAD2, "ESCRIVA: /kick [ID / Parte del nombre.] [reason]");
                return 1;
            }
            giveplayerid = ReturnUser(tmp);
            if(PlayerInfo[giveplayerid][pAdmin] >= 4 )
            {
                GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
                format(string, sizeof(string), "DLCmdProSystem: %s Baneo Automatico Por Intentar Banear a Un Admin 10", sendername);//esto lo modificas para que pase al intentar banear al jugador con tu nombre
                SendClientMessageToAll(COLOR_LIGHTRED, string);
                Ban(playerid);
                return 1;
            }
            if (PlayerInfo[playerid][pAdmin] >= 2)
            {
                if(IsPlayerConnected(giveplayerid))
                {
                    if(giveplayerid != INVALID_PLAYER_ID)
                    {
                        GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
                        GetPlayerName(playerid, sendername, sizeof(sendername));
                        new length = strlen(cmdtext);
                        while ((idx < length) && (cmdtext[idx] <= ' '))
                        {
                            idx++;
                        }
                        new offset = idx;
                        new result[64];
                        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, "ESCRIVA: /kick [ID / Parte del nombre.] [reason]");
                            return 1;
                        }
                        new year, month,day;
                        getdate(year, month, day);
                        format(string, sizeof(string), "AdmCmd: %s Fue kickeado por %s, rezon: %s (%d-%d-%d)", giveplayer, sendername, (result),month,day,year);
                        KickLog(string);
                        format(string, sizeof(string), "AdmCmd: %s Fue pateado del servidor por %s, razуn: %s", giveplayer, sendername, (result));
                        ABroadCast(COLOR_VIOLETA, string,1);
                        format(string, sizeof(string), "AdmCmd: %s Fuiste pateado/kickeado del servidor por %s, razуn: %s", giveplayer, sendername, (result));
                        SendClientMessage(giveplayerid, COLOR_RED, string);
                        Kick(giveplayerid);
                        return 1;
                    }
                }
            }
            else
            {
                format(string, sizeof(string), "   %d no es un jugador activo.", giveplayerid);
                SendClientMessage(playerid, COLOR_GRAD1, string);
            }
        }
        return 1;
    }