AYUDENME POR FAVOR!!!
#1

Weno, tngo un host i todo pero cuando entran al server para poner /o у /duda etc se reinicia el server, se cae.
Ayudenme respondo a todo
Reply
#2

podes pasar el codigo?
Reply
#3

Cual codigo?
Reply
#4

Quote:
Originally Posted by FeniXzone-Tincho2009
Посмотреть сообщение
Cual codigo?
El de los comandos /duda /o
Reply
#5

Creo q cuando c conectan varios i ponen
Код:
if(strcmp(cmd, "/duda", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            if ((!nod) && duda[playerid] > 0)
            {
                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, "USO: /Duda [Texto]");
                return 1;
                }
                if(PlayerInfo[playerid][pLevel] > 2) { duda[playerid] -= 1; }
                format(string, sizeof(string), "Pregunta de %s(ID:%d): %s.", sendername, playerid, (result));
                ABroadCast(COLOR_ASKQ,string,1);
                format(string, sizeof(string), "Tu pregunta fue enviada a los admins. Te quedan %d dudas restantes.", duda[playerid]);
                SendClientMessage(playerid, COLOR_ASKQ, string);
                
            }
            else { SendClientMessage(playerid, COLOR_GRAD2, "El canal de dudas ha sido desactivado debido al mal uso del mismo."); }
        }
        return 1;
    }
у

Код:
if(strcmp(cmd, "/ooc", true) == 0 || strcmp(cmd, "/o", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            if(gPlayerLogged[playerid] == 0)
            {
                SendClientMessage(playerid, COLOR_GREY, " No Estбs Conectado");
                return 1;
            }
            if ((noooc) && PlayerInfo[playerid][pAdmin] < 1)
            {
                SendClientMessage(playerid, COLOR_GRAD2, "Chat de Dudas/Preguntas, Desactivado!");
                return 1;
            }
            if(PlayerInfo[playerid][pMuted] == 1)
            {
                SendClientMessage(playerid, TEAM_CYAN_COLOR, "Estas Silenciado.");
                return 1;
            }
            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, "Utiliza: /O(OOC): [Pregunta/Duda]");
                return 1;
            }
            if(PlayerInfo[playerid][pAdmin] == 1 || PlayerInfo[playerid][pAdmin] == 2 || PlayerInfo[playerid][pAdmin] == 3)
            {
                format(string, sizeof(string),"(( Moderador [ID: %d] %s: %s ))",playerid, sendername, result);
                OOCOff(COLOR_LIGHTBLUE,string);
                printf("%s",string);
            }
            if(PlayerInfo[playerid][pAdmin] >= 4 && PlayerInfo[playerid][pAdmin] < 1330)
            {
                format(string, sizeof(string),"(( Administrador [ID: %d] %s: %s ))",playerid, sendername, result);
                OOCOff(COLOR_LIGHTBLUE,string);
                printf("%s",string);
            }
            if(PlayerInfo[playerid][pAdmin] == 1338 || PlayerInfo[playerid][pAdmin] == 2012)
            {
                format(string, sizeof(string),"(( Admin Dueсo [ID: %d] %s: %s ))",playerid, sendername, result);
                OOCOff(0xF77E06FF,string);
                printf("%s",string);
            }
            if(PlayerInfo[playerid][pAdmin] < 1)
            {
                format(string, sizeof(string), "(( [Ayuda][ID: %d] %s: %s ))",playerid, sendername, result);
                OOCOff(COLOR_LIGHTBLUE,string);
                printf("%s", string);
            }
        }
        return 1;
    }
Vuelvo a decir, con otro host no me pasaba
Reply
#6

Ambos hosts tienen el mismo sistema operativo?
Quizбs te olvidaste de crear alguna carpeta o archivo necesario dentro de scriptfiles.
Reply
#7

este codigo
pawn Код:
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;
reemplazalo x strtok(idx, tmp) y defini tmp como un array de 256 bytes, dado que ese codigo (si mi memoria no me falla es = o casi = al de strtok y cumple su funcion).
(no es el problema (x lo menos eso creo yo) pero hace mas eficiente al codigo).
Reply
#8

Daa, ahora esta bien c soluciono el tema /duda /o, aora se reinicia cuando entro el 8є user
AYUDA!!!
Reply
#9

Quote:
Originally Posted by FeniXzone-Tincho2009
Посмотреть сообщение
Daa, ahora esta bien c soluciono el tema /duda /o, aora se reinicia cuando entro el 8є user
AYUDA!!!
No se como solucionarlo... pero son errores tipicos de los c&p...

їPor que no empezas uno de cero?... Te organiza todos los conocimientos que tenes de pawn...

Tardaras mucho, pero por lo menos sabes que haces y como modificarlo.
Reply
#10

que es c&p?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)