AYUDA! comando /haceradmin porfavor :c
#1

Lo que pasa es que tengo rato ya que no me funsiona el comando /haceradmin :c me sale que no puedo usar el comando y pero ya soy level 10, tengo que quitando y dando admin fuera del juego (En la carpeta) y la verdad me canse de tener que reiniciar el SV solo para poner o quitar un admin.. Alguien porfavor ayudeme! porfavor :'c

ESTA ES EL COMANDO QUE TENGO <zcmd>

COMMAND:haceradmin(playerid, params[]) {

new User, Level;
if( Informacion[ playerid ] [ pAdmin ] >= 9 || IsPlayerAdmin(playerid)) {
if(!strcmp(NombreScripter,Nombre(playerid))||!strc mp(NombreDueсo,Nombre(playerid))||!strcmp(NombreSe gundo,Nombre(playerid))||!strcmp(Encargado,Nombre( playerid))) {
if( sscanf(params, "dd", User, Level)) return SendClientMessage(playerid, Error, "Error: utiliza /Haceradmin <Jugador> <Nivel>");
if( IsPlayerConnected( User ) ) {
if( Level > 10 )return SendClientMessage(playerid, Error, "Error: Maximo Nivel 10");

Informacion[User][pAdmin] = Level;

if(Informacion[User][pAdmin] != 0)
Informacion[User][pAdmin] = 1;
else
Informacion[User][pAdmin] = 0;

SendClientMessageEx( User, Blanco, "El administrador "Insertkaki"%s "Insertblanco"te otorgo Administracion nivel "Insertlima"%d!", Nombre(playerid), Level);
SendClientMessageEx( playerid, Blanco, "Le Otorgastes nivel "Insertlima"%d "Insertadmin"de Administracion a "Insertkaki"%s!", Level, Nombre(User));

PlayerPlaySound(User,1056,0.0,0.0,0.0);
GameTextForPlayer(User, "~G~~H~_Promovido", 5000, 6);
}else return SendClientMessage(playerid, Error, "Error: El jugador no esta conectado!");
}else return SendClientMessage(playerid, COLOR_YELLOW, "[Seguridad]: Usted no puede usar este comando!");
}else return SendClientMessage(playerid, Error, "Error: Usted no es administrador o no tiene suficiente nivel!");
return 1;
}
Reply
#2

Quote:
Originally Posted by JoelM14
Посмотреть сообщение
Lo que pasa es que tengo rato ya que no me funsiona el comando /haceradmin :c me sale que no puedo usar el comando y pero ya soy level 10, tengo que quitando y dando admin fuera del juego (En la carpeta) y la verdad me canse de tener que reiniciar el SV solo para poner o quitar un admin.. Alguien porfavor ayudeme! porfavor :'c

ESTA ES EL COMANDO QUE TENGO <zcmd>

COMMAND:haceradmin(playerid, params[]) {

new User, Level;
if( Informacion[ playerid ] [ pAdmin ] >= 9 || IsPlayerAdmin(playerid)) {
if(!strcmp(NombreScripter,Nombre(playerid))||!strc mp(NombreDueсo,Nombre(playerid))||!strcmp(NombreSe gundo,Nombre(playerid))||!strcmp(Encargado,Nombre( playerid))) {
if( sscanf(params, "dd", User, Level)) return SendClientMessage(playerid, Error, "Error: utiliza /Haceradmin <Jugador> <Nivel>");
if( IsPlayerConnected( User ) ) {
if( Level > 10 )return SendClientMessage(playerid, Error, "Error: Maximo Nivel 10");

Informacion[User][pAdmin] = Level;

if(Informacion[User][pAdmin] != 0)
Informacion[User][pAdmin] = 1;
else
Informacion[User][pAdmin] = 0;

SendClientMessageEx( User, Blanco, "El administrador "Insertkaki"%s "Insertblanco"te otorgo Administracion nivel "Insertlima"%d!", Nombre(playerid), Level);
SendClientMessageEx( playerid, Blanco, "Le Otorgastes nivel "Insertlima"%d "Insertadmin"de Administracion a "Insertkaki"%s!", Level, Nombre(User));

PlayerPlaySound(User,1056,0.0,0.0,0.0);
GameTextForPlayer(User, "~G~~H~_Promovido", 5000, 6);
}else return SendClientMessage(playerid, Error, "Error: El jugador no esta conectado!");
}else return SendClientMessage(playerid, COLOR_YELLOW, "[Seguridad]: Usted no puede usar este comando!");
}else return SendClientMessage(playerid, Error, "Error: Usted no es administrador o no tiene suficiente nivel!");
return 1;
}
observa esto
Код:
if(!strcmp(NombreScripter,Nombre(playerid))||!strc mp(NombreDueсo,Nombre(playerid))||!strcmp(NombreSe gundo,Nombre(playerid))||!strcmp(Encargado,Nombre( playerid)))	{
capas no estes con el nombre que se requiere para dar admin... puedes borrar eso y no te saldrб mas
Reply
#3

Rempla el que tienes..
Quitando la funcion de restricion.

pawn Код:
// Tendria que quedarte asi, copia esto y remplazalo si tienes errores vuelve.
COMMAND:haceradmin(playerid, params[]) {
new User, Level;
if( Informacion[ playerid ] [ pAdmin ] >= 0 || IsPlayerAdmin(playerid)) { //Esto hara que solo los que tenga nivel 0 daran admin, remplaza por 10 si quieres que nivel 10 lo de, depende de vos.
if( sscanf(params, "dd", User, Level)) return SendClientMessage(playerid, Error, "Error: utiliza /Haceradmin <Jugador> <Nivel>");
if( IsPlayerConnected( User ) ) {
if( Level > 10 )return SendClientMessage(playerid, Error, "Error: Maximo Nivel 10");
Informacion[User][pAdmin] = Level;
if(Informacion[User][pAdmin] != 0)
Informacion[User][pAdmin] = 1;
else
Informacion[User][pAdmin] = 0;
SendClientMessageEx( User, Blanco, "El administrador "Insertkaki"%s "Insertblanco"te otorgo Administracion nivel "Insertlima"%d!", Nombre(playerid), Level);
SendClientMessageEx( playerid, Blanco, "Le Otorgastes nivel "Insertlima"%d "Insertadmin"de Administracion a "Insertkaki"%s!", Level, Nombre(User));
PlayerPlaySound(User,1056,0.0,0.0,0.0);
GameTextForPlayer(User, "~G~~H~_Promovido", 5000, 6);
}else return SendClientMessage(playerid, Error, "Error: El jugador no esta conectado!");
}else return SendClientMessage(playerid, COLOR_YELLOW, "[Seguridad]: Usted no puede usar este comando!");
}else return SendClientMessage(playerid, Error, "Error: Usted no es administrador o no tiene suficiente nivel!");
return 1;
}
Reply
#4

Quote:
Originally Posted by DesingP
Посмотреть сообщение
Rempla el que tienes..
Quitando la funcion de restricion.

pawn Код:
// Tendria que quedarte asi, copia esto y remplazalo si tienes errores vuelve.
COMMAND:haceradmin(playerid, params[]) {
new User, Level;
if( Informacion[ playerid ] [ pAdmin ] >= 0 || IsPlayerAdmin(playerid)) { //Esto hara que solo los que tenga nivel 0 daran admin, remplaza por 10 si quieres que nivel 10 lo de, depende de vos.
if( sscanf(params, "dd", User, Level)) return SendClientMessage(playerid, Error, "Error: utiliza /Haceradmin <Jugador> <Nivel>");
if( IsPlayerConnected( User ) ) {
if( Level > 10 )return SendClientMessage(playerid, Error, "Error: Maximo Nivel 10");
Informacion[User][pAdmin] = Level;
if(Informacion[User][pAdmin] != 0)
Informacion[User][pAdmin] = 1;
else
Informacion[User][pAdmin] = 0;
SendClientMessageEx( User, Blanco, "El administrador "Insertkaki"%s "Insertblanco"te otorgo Administracion nivel "Insertlima"%d!", Nombre(playerid), Level);
SendClientMessageEx( playerid, Blanco, "Le Otorgastes nivel "Insertlima"%d "Insertadmin"de Administracion a "Insertkaki"%s!", Level, Nombre(User));
PlayerPlaySound(User,1056,0.0,0.0,0.0);
GameTextForPlayer(User, "~G~~H~_Promovido", 5000, 6);
}else return SendClientMessage(playerid, Error, "Error: El jugador no esta conectado!");
}else return SendClientMessage(playerid, COLOR_YELLOW, "[Seguridad]: Usted no puede usar este comando!");
}else return SendClientMessage(playerid, Error, "Error: Usted no es administrador o no tiene suficiente nivel!");
return 1;
}
Me salen dos errores :c

C:\Documents and Settings\Ultra E510\Escritorio\Nueva carpeta (2)\gamemodes\OMM.pwn(1326) : warning 209: function "cmd_haceradmin" should return a value
C:\Documents and Settings\Ultra E510\Escritorio\Nueva carpeta (2)\gamemodes\OMM.pwn(1326) : error 010: invalid function or declaration
C:\Documents and Settings\Ultra E510\Escritorio\Nueva carpeta (2)\gamemodes\OMM.pwn(1327) : error 010: invalid function or declaration
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


2 Errors.
Reply
#5

He ahн la importancia de tabular tu cуdigo.

pawn Код:
COMMAND:haceradmin(playerid, params[])
{
    new User, Level;
    if(Informacion[playerid][pAdmin] >= 10 || IsPlayerAdmin(playerid))
    {
        if(sscanf(params, "dd", User, Level)) return SendClientMessage(playerid, Error, "Error: utiliza /Haceradmin <Jugador> <Nivel>");
        if(IsPlayerConnected(User))
        {
            if(Level > 10 || Level < 0)return SendClientMessage(playerid, Error, "Error: Maximo Nivel 10 - Mнnimo nivel 10");
            Informacion[User][pAdmin] = Level;
            if(Informacion[User][pAdmin] != 0) Informacion[User][pAdmin] = 1;
            else Informacion[User][pAdmin] = 0;
            SendClientMessageEx(User, Blanco, "El administrador "Insertkaki"%s "Insertblanco"te otorgo Administracion nivel "Insertlima"%d!", Nombre(playerid), Level);
            SendClientMessageEx(playerid, Blanco, "Le Otorgastes nivel "Insertlima"%d "Insertadmin"de Administracion a "Insertkaki"%s!", Level, Nombre(User));
            PlayerPlaySound(User,1056,0.0,0.0,0.0);
            GameTextForPlayer(User, "~G~~H~_Promovido", 5000, 6);
        }
        else return SendClientMessage(playerid, Error, "Error: El jugador no esta conectado!");
    }
    else return SendClientMessage(playerid, Error, "Error: Usted no es administrador o no tiene suficiente nivel!");
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)