Author Topic: Dini Problem => New Problem...  (Read 2332 times)

0 Members and 1 Guest are viewing this topic.

Offline sseebbyy

  • VC:MP Veteran
  • *****
  • Posts: 774
  • Immortal VC:MP Player
    • View Profile
    • Zombie Invasion => Server Forum [DEAD PROJECT]
Dini Problem => New Problem...
« 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]
« Last Edit: November 04, 2011, 06:52:10 pm by sseebbyy »

Quote
Painful/Noob scripters acts like: I Am The Best Scripter Because I Announce My Releases With Big Font Size Without Giving Too Much Info' In The Hope They All Will Download And Check It. I Ignore Bad Replies, Replies That I Could Learn From, And Replies With So Much Text.



Offline stormeus

  • VC:MP Developer
  • VC:MP Veteran
  • *
  • Posts: 1122
    • View Profile
Re: Dini Problem
« Reply #1 on: November 03, 2011, 10:41:39 pm »
[pawn]if(!fexist(file))[/pawn]
This line isn't needed.
Do not PM me for support.




Offline sseebbyy

  • VC:MP Veteran
  • *****
  • Posts: 774
  • Immortal VC:MP Player
    • View Profile
    • Zombie Invasion => Server Forum [DEAD PROJECT]
Re: Dini Problem
« Reply #2 on: November 04, 2011, 01:11:09 am »
Work !

Thank you very much Stormeus !

Quote
Painful/Noob scripters acts like: I Am The Best Scripter Because I Announce My Releases With Big Font Size Without Giving Too Much Info' In The Hope They All Will Download And Check It. I Ignore Bad Replies, Replies That I Could Learn From, And Replies With So Much Text.



Offline sseebbyy

  • VC:MP Veteran
  • *****
  • Posts: 774
  • Immortal VC:MP Player
    • View Profile
    • Zombie Invasion => Server Forum [DEAD PROJECT]
Re: Dini Problem
« Reply #3 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 ?  :-\
« Last Edit: November 04, 2011, 08:57:51 pm by sseebbyy »

Quote
Painful/Noob scripters acts like: I Am The Best Scripter Because I Announce My Releases With Big Font Size Without Giving Too Much Info' In The Hope They All Will Download And Check It. I Ignore Bad Replies, Replies That I Could Learn From, And Replies With So Much Text.



Offline stormeus

  • VC:MP Developer
  • VC:MP Veteran
  • *
  • Posts: 1122
    • View Profile
Re: Dini Problem => New Problem...
« Reply #4 on: November 04, 2011, 10:10:43 pm »
Use dini_IntGet. It's expecting a number, not a string.
Do not PM me for support.