Vice City Multiplayer

VC:MP 0.3 => mIRC/pawn Scripting => Topic started by: sseebbyy on November 03, 2011, 07:03:52 pm

Title: Dini Problem => New Problem...
Post by: sseebbyy on November 03, 2011, 07:03:52 pm
I tryied to make "makeadmin" command, but not work.. not change to "1" in .ini file...

AnyBody help me please...

[pawn]else if (strcmp(cmd, "giveadmin", true) == 0) {
   if(IsLogged[playerid] == 0) SendClientMessage(playerid,NOTACCES,"Need to login first !");
        else if(Spawned[playerid] == 0) SendClientMessage(playerid,NOTACCES,"You not are Spawned !");
      else if(IsPlayerAdmin(playerid))
       {
      new plr;
      tmp = strtok(cmdtext, idx), plr = FindPlayerIDFromString(tmp);

      if (!strlen(tmp)) SendClientMessage(playerid,COLOR_RED,"USAGE: /c giveadmin [Nick/ID]");
        else if (plr == INACTIVE_PLAYER_ID) SendClientMessage(playerid,COLOR_RED,"Error: Unknown player");
      else {
            new name[MAX_PLAYER_NAME];
          GetPlayerName(playerid, name, sizeof(name));
           format(file,sizeof(file),"Users/%s.ini",name);
           if(!fexist(file))
         {
           dini_Set(file,"AdminLevel","1");
           PlayerInfo[plr][AdminLevel] = 1;
           }
      }
      }else{
      SendClientMessage(playerid,NOTACCES,"***Not have permission to use this command!");
      }
      return 1;
   }[/pawn]
Title: Re: Dini Problem
Post by: stormeus on November 03, 2011, 10:41:39 pm
[pawn]if(!fexist(file))[/pawn]
This line isn't needed.
Title: Re: Dini Problem
Post by: sseebbyy on November 04, 2011, 01:11:09 am
Work !

Thank you very much Stormeus !
Title: Re: Dini Problem
Post by: sseebbyy on November 04, 2011, 06:56:42 pm
New Problem ...

[pawn]SetPlayerMoney(playerid,dini_Get(file,"Cash"));[/pawn]

D:\Jocuri\Vice City\SERVER\[RBS] Romania Best Style v2\gamemodes\RO.pwn(434) : error 035: argument type mismatch (argument 2)
Pawn compiler 3.0.3367         Copyright (c) 1997-2005, ITB CompuPhase


1 Error.


How can i fix this ?  :-\
Title: Re: Dini Problem => New Problem...
Post by: stormeus on November 04, 2011, 10:10:43 pm
Use dini_IntGet. It's expecting a number, not a string.