VIP System error :(
#1

Problem :
Quote:

\SAMP\Script\VIP.pwn(12) : error 021: symbol already defined: "format"
SAMP\Script\VIP.pwn(16) : error 017: undefined symbol "fexists"
SAMP\Script\VIP.pwn(33) : error 017: undefined symbol "fexists"
\SAMP\Script\VIP.pwn(44) : warning 225: unreachable code
\SAMP\Script\VIP.pwn(44) : error 029: invalid expression, assumed zero
\SAMP\Script\VIP.pwn(44) : error 017: undefined symbol "cmd_setvip"
\SAMP\Script\VIP.pwn(44) : error 029: invalid expression, assumed zero
\SAMP\Script\VIP.pwn(44) : fatal error 107: too many error messages on one line

Script :
pawn Код:
#include <a_samp>
#include <sscanf>
#include <ZCMD>
#include <dini>

enum vip
{
   vipdata
};
new name[50],maxlvl,evipdata[MAX_PLAYERS][vip];
new file[40];
format(file,sizeof(file),"/vipsys/settings.ini");

public OnGameModeInit()
{
  if(!fexists(file))
    {
      dini_Create(file);
      dini_IntSet(file,"maxlevel",3);
    }
  else
   {
       maxlvl=dini_Int(file,"maxlevel");
   }
  return 1;
}

public OnPlayerConnect(playerid)
{
  new ufile[50];
  GetPlayerName(playerid,name,sizeof(name));
  format(ufile,sizeof(ufile),"/vipsys/users/%s.ini",name);
  if(!fexists(ufile))
    {
       dini_Create(ufile);
       dini_IntSet(ufile,"viplevel",0);
    }
  else
    {
evipdata[playerid][vipdata]=dini_Int(ufile,"viplevel");
     }
  return 1;

  CMD:setvip(playerid,params[])
{
   new targetid,lvl;
   if(!IsPlayerAdmin(playerid)) return 0;
   if(sscanf(params,"ui",targetid,lvl); return SendClientMessage(playerid,-1,"USAGE: /setvip [id] [level]");
   if(lvl > maxlvl) return SendClientMessage(playerid, -1, "Max VIP level is 3");
else
 {
    new name2[50],ufile2[50];
    GetPlayerName(targetid,name2,sizeof(name2));.
    format(ufile2,sizeof(ufile2),"/vipsys/users/%s.ini",name2);
    dini_IntSet(ufile2,"viplevel",lvl);
}
  return 1;
}
Reply
#2

move the format inside OnGameModeInit (the format which is not placed in the callback)
Reply
#3

Which line at OnGameModeInit?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)