Vice City Multiplayer

VC:MP 0.3 => mIRC/pawn Scripting => Topic started by: omarlin97 on December 31, 2011, 04:08:27 am

Title: Funtion LevelCmds
Post by: omarlin97 on December 31, 2011, 04:08:27 am
I need the function levelcmds  Please!:'( :'( :'(
Title: Re: Funtion LevelCmds
Post by: omarlin97 on December 31, 2011, 04:05:12 pm
the need Please...
Title: Re: Funtion LevelCmds
Post by: DilsonTB on January 01, 2012, 07:43:48 pm
Primero:

Crear carpeta ("Configuracion")
Luego un archivo de texto (.ini) ("Comandos")

Luego pon en el script:

Funcion:

stock NiveldeComando(playerid,cmd[]) {
   return (PlayerInfo[playerid][nivel] >= dini_Int("/Configuracion/Comandos.ini",cmd)) ? true : false;
}

Luego en comandos:

[pawn]   else if (strcmp(cmd, "ponercmd", true) == 0) {
       new tmp2[256];
      tmp = strtok(cmdtext, idx), tmp2 = strtok(cmdtext, idx);
      if(PlayerInfo[playerid][Logged] != 1) SendClientMessage(playerid, COLOR_RED, "Tienes que estar logueado primero!");
      else if(!NivelDeComando(playerid,"niveldecmd")) SendClientMessage(playerid, COLOR_RED, "No tienes acceso a este cmd!");
      else if (!strlen(tmp2)) SendClientMessage(playerid,COLOR_YELLOW,"USE: /c setcmdlevel [Comando] [Nivel]");
      else {
         new szMsg[256];
         dini_Set("Configuracion/Comandos.ini", tmp, tmp2);
         format(szMsg,sizeof(szMsg),"Nivel de comando:[ %s ] Cambiado a:[ %s ]",tmp,tmp2);
         SendClientMessage(playerid,COLOR_YELLOW,szMsg);
      }
      return 1;
   }[/pawn]

De nada.!  ;D
Title: Re: Funtion LevelCmds
Post by: omarlin97 on January 01, 2012, 07:54:04 pm
Gracias man!