FilterScript Help Please
#1

Hi, So basicly I'm trying to make a filterscript to set Tempory Admin + Tempory VIP Status, VIP for Events an shit..

Anyways.
I've tried fixing this code but i get the SAME warning... Over an over..
can someone Please Help.
pawn Код:
#define FILTERSCRIPT


#include <a_samp>
#include <sscanf2>

#if defined FILTERSCRIPT

public OnFilterScriptInit()
{
    print("\n--------------------------------------");
    print("  Admin + Prem Temp Set Command");
    print("--------------------------------------\n");
   
    return 1;
}
CMD:tempadmin(playerid, params[])
{
   new Player, tempadmin;
   if(sscanf2(params, "ui", Player, Level))
   {
   if(PlayerInfo[playerid][pAdminLevel] > 4)
   {
   if(IsPlayerConnected(playerid) && IsPlayerConnected(Player))
   {
      if(gPlayerLogged[playerid] == 1)
      {
          new Player;
           new Level;
          {
              if(Player == playerid) return SendClientMessage(playerid, COLOR_RED, "SERVER: Cant perform this command on yourself!" );
            if(Level > 3) return SendClientMessage(Playerid, COLOR_RED, "SERVER: Maximum level is 2!" );
                if(Player == INVALID_PLAYER_ID) return SendClientMessage(playerid,red,"ERROR: Wrong player ID");
                if(PlayerInfo[Player][pAdminLevel] >= PlayerInfo[playerid][pAdminLevel]) return SendClientMessage(playerid,red,"ERROR: You cant perform this on Admins that are equal or higher than your level!");
            PlayerInfo[Player][pAdminLevel] = Level;
            PlayerInfo[Player][pTempLevel] = Level;
            new tname[MAX_PLAYER_NAME];
            GetPlayerName(Player,tname,sizeof(tname));
            new pname[MAX_PLAYER_NAME];
            GetPlayerName(playerid,pname,sizeof(pname));
            new MyString[128];
            new TargetString[128];
            format(MyString,sizeof MyString, "You have set %s temporary Admin Level to %i!", tname, Level);
            format(TargetString,sizeof TargetString, "You are now temporary Admin Level %i, thanks to %s!", Level, pname || Any kind of abuse will get you warned/banned from server);
            SendClientMessage(Target, COLOR_RED, TargetString);
            SendClientMessage(playerid, COLOR_GREEN, MyString);
            new File:Log = fopen(adminPATH, io_append);
             new logData[128];
            new fTime[6];
            getdate(fTime[0], fTime[1], fTime[2]);
            gettime(fTime[3], fTime[4], fTime[5]);
            format(logData, sizeof logData, "[%02d/%02d/%04d || %02d:%02d:%02d]%s made %s temporary Admin Level: %d!\r\n", fTime[2], fTime[1], fTime[0], fTime[3], fTime[4], fTime[5], pname, tname, Level);
            fwrite(Log, logData);
            fclose(Log);
          }
          else SendClientMessage(playerid, COLOR_RED, "USAGE: /tempadmin <playerid> <temp-level>");
      }
      else SendClientMessage(playerid,red,"ERROR: You must be logged in to perform this command!");
   }
   else SendClientMessage(playerid, red, "ERROR: You have to be an Admin level 4 or higher to perform this command!");
   return 1;
}
    CMD:tempvip(playerid, params[])
{
   new Player, TempPrem;
   if(sscanf2(params, "ui", Player, Level))
   if(PlayerInfo[playerid][pAdminLevel] > 4)
   {
   if(IsPlayerConnected(playerid) && IsPlayerConnected(Player))
   {
      if(gPlayerLogged[playerid] == 1)
      {
          new Player;
           new Level;
          {
              if(Player == playerid) return SendClientMessage(playerid, COLOR_RED, "SERVER: Cant perform this command on yourself!" );
            if(Level > 3) return SendClientMessage(playerid, COLOR_RED, "SERVER: Maximum level is 2!");
                if(Player == INVALID_PLAYER_ID) return SendClientMessage(playerid,red,"ERROR: Wrong player ID");
                if(PlayerInfo[Player][pAdminLevel] > 4) return SendClientMessage(playerid,red,"ERROR: You cant perform this on Admins that are equal or higher than your level!");
            PlayerInfo[Player][pPremiumlevel] = Level;
            PlayerInfo[Player][pTempPremium] = Level;
            new tname[MAX_PLAYER_NAME];
            GetPlayerName(Player,tname,sizeof(tname));
            new pname[MAX_PLAYER_NAME];
            GetPlayerName(playerid,pname,sizeof(pname));
            new MyString[128];
            new TargetString[128];
            format(MyString,sizeof MyString, "You have set %s temporary Premium Level to %i!", tname, Level);
            format(TargetString,sizeof TargetString, "You are now temporary Premium Level %i, thanks to %s!", Level, pname);
            SendClientMessage(Player, COLOR_RED, TargetString);
            SendClientMessage(playerid, COLOR_GREEN, MyString);
          }
          else SendClientMessage(playerid, COLOR_YELLOW, "USAGE: /tempvip <playerid> <temp-level>");
      }
      else SendClientMessage(playerid,red,"ERROR: You must be logged in to perform this command!");
   }
   else SendClientMessage(playerid, red, "ERROR: You have to be an Admin level 4 or higher to perform this command!");
   return 1;
}

#endif
pawn Код:
Commands.pwn(63) : warning 203: symbol is never used: "tempadmin"  + "temppremium"

CAN Anyone see where i went wrong :S? If so how do i fix it?
PLEASE
Reply
#2

The warning simply states that tempadmin is never used. I see nothing wrong with this. Also, switch the [quote] with [pawn], so its much easier to read and such.
Reply
#3

Quote:
Originally Posted by KurtBag
Посмотреть сообщение
The warning simply states that tempadmin is never used. I see nothing wrong with this. Also, switch the [ quote] with [pawn], so its much easier to read and such.
CAn you help? I don't know how to fix it..
Reply
#4

It could be because you're using ZCMD and not including the #include <ZCMD> in the include section.
Reply
#5

Quote:
Originally Posted by KurtBag
Посмотреть сообщение
It could be because you're using ZCMD and not including the #include <ZCMD> in the include section.
Nope

I just used
#include <zcmd>

And now i get these 5 errrors

pawn Код:
C:\Documents and Settings\Mirc\Desktop\pawno\Commands.pwn(21) : error 017: undefined symbol "sscanf2"
C:\Documents and Settings\Mirc\Desktop\pawno\Commands.pwn(23) : error 017: undefined symbol "PlayerInfo"
C:\Documents and Settings\Mirc\Desktop\pawno\Commands.pwn(23) : warning 215: expression has no effect
C:\Documents and Settings\Mirc\Desktop\pawno\Commands.pwn(23) : error 001: expected token: ";", but found "]"
C:\Documents and Settings\Mirc\Desktop\pawno\Commands.pwn(23) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Mirc\Desktop\pawno\Commands.pwn(23) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


5 Errors.
Reply
#6

Is this all you have in the filterscript? You must not have sscanf2 in the includes section and the PlayerInfo is not defined at all in the script and etcetra.
Reply
#7

Quote:
Originally Posted by KurtBag
Посмотреть сообщение
Is this all you have in the filterscript? You must not have sscanf2 in the includes section and the PlayerInfo is not defined at all in the script and etcetra.
Can you go through an fix it for me :S?
Please?
Reply
#8

Do you have #include <sscanf2> defined?
Reply
#9

pawn Код:
#define FILTERSCRIPT


#include <a_samp>
#include <sscanf2>
#include <ZCMD>

#if defined FILTERSCRIPT

new
         PlayerInfo;

public OnFilterScriptInit()
{
    print("\n--------------------------------------");
    print("  Admin + Prem Temp Set Command");
    print("--------------------------------------\n");
   
    return 1;
}
CMD:tempadmin(playerid, params[])
{
   new Player, tempadmin;
   if(sscanf2(params, "ui", Player, Level))
   {
   if(PlayerInfo[playerid][pAdminLevel] > 4)
   {
   if(IsPlayerConnected(playerid) && IsPlayerConnected(Player))
   {
      if(gPlayerLogged[playerid] == 1)
      {
          new Player;
           new Level;
          {
              if(Player == playerid) return SendClientMessage(playerid, COLOR_RED, "SERVER: Cant perform this command on yourself!" );
            if(Level > 3) return SendClientMessage(Playerid, COLOR_RED, "SERVER: Maximum level is 2!" );
                if(Player == INVALID_PLAYER_ID) return SendClientMessage(playerid,red,"ERROR: Wrong player ID");
                if(PlayerInfo[Player][pAdminLevel] >= PlayerInfo[playerid][pAdminLevel]) return SendClientMessage(playerid,red,"ERROR: You cant perform this on Admins that are equal or higher than your level!");
            PlayerInfo[Player][pAdminLevel] = Level;
            PlayerInfo[Player][pTempLevel] = Level;
            new tname[MAX_PLAYER_NAME];
            GetPlayerName(Player,tname,sizeof(tname));
            new pname[MAX_PLAYER_NAME];
            GetPlayerName(playerid,pname,sizeof(pname));
            new MyString[128];
            new TargetString[128];
            format(MyString,sizeof MyString, "You have set %s temporary Admin Level to %i!", tname, Level);
            format(TargetString,sizeof TargetString, "You are now temporary Admin Level %i, thanks to %s!", Level, pname || Any kind of abuse will get you warned/banned from server);
            SendClientMessage(Target, COLOR_RED, TargetString);
            SendClientMessage(playerid, COLOR_GREEN, MyString);
            new File:Log = fopen(adminPATH, io_append);
             new logData[128];
            new fTime[6];
            getdate(fTime[0], fTime[1], fTime[2]);
            gettime(fTime[3], fTime[4], fTime[5]);
            format(logData, sizeof logData, "[%02d/%02d/%04d || %02d:%02d:%02d]%s made %s temporary Admin Level: %d!\r\n", fTime[2], fTime[1], fTime[0], fTime[3], fTime[4], fTime[5], pname, tname, Level);
            fwrite(Log, logData);
            fclose(Log);
          }
          else SendClientMessage(playerid, COLOR_RED, "USAGE: /tempadmin <playerid> <temp-level>");
      }
      else SendClientMessage(playerid,red,"ERROR: You must be logged in to perform this command!");
   }
   else SendClientMessage(playerid, red, "ERROR: You have to be an Admin level 4 or higher to perform this command!");
   return 1;
}
    CMD:tempvip(playerid, params[])
{
   new Player, TempPrem;
   if(sscanf2(params, "ui", Player, Level))
   if(PlayerInfo[playerid][pAdminLevel] > 4)
   {
   if(IsPlayerConnected(playerid) && IsPlayerConnected(Player))
   {
      if(gPlayerLogged[playerid] == 1)
      {
          new Player;
           new Level;
          {
              if(Player == playerid) return SendClientMessage(playerid, COLOR_RED, "SERVER: Cant perform this command on yourself!" );
            if(Level > 3) return SendClientMessage(playerid, COLOR_RED, "SERVER: Maximum level is 2!");
                if(Player == INVALID_PLAYER_ID) return SendClientMessage(playerid,red,"ERROR: Wrong player ID");
                if(PlayerInfo[Player][pAdminLevel] > 4) return SendClientMessage(playerid,red,"ERROR: You cant perform this on Admins that are equal or higher than your level!");
            PlayerInfo[Player][pPremiumlevel] = Level;
            PlayerInfo[Player][pTempPremium] = Level;
            new tname[MAX_PLAYER_NAME];
            GetPlayerName(Player,tname,sizeof(tname));
            new pname[MAX_PLAYER_NAME];
            GetPlayerName(playerid,pname,sizeof(pname));
            new MyString[128];
            new TargetString[128];
            format(MyString,sizeof MyString, "You have set %s temporary Premium Level to %i!", tname, Level);
            format(TargetString,sizeof TargetString, "You are now temporary Premium Level %i, thanks to %s!", Level, pname);
            SendClientMessage(Player, COLOR_RED, TargetString);
            SendClientMessage(playerid, COLOR_GREEN, MyString);
          }
          else SendClientMessage(playerid, COLOR_YELLOW, "USAGE: /tempvip <playerid> <temp-level>");
      }
      else SendClientMessage(playerid,red,"ERROR: You must be logged in to perform this command!");
   }
   else SendClientMessage(playerid, red, "ERROR: You have to be an Admin level 4 or higher to perform this command!");
   return 1;
}

#endif
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)