SA-MP Forums Archive
adminscript problem - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: adminscript problem (/showthread.php?tid=259370)



adminscript problem - Trotty729 - 04.06.2011

im using tutorial on wiki and it says i shouldnt have a error but i do

C:\Users\Trottsworth\Desktop\Freeroam Server\filterscripts\Admin.pwn(44) : error 001: expected token: "}", but found "new"

and here is code from the includes to the OnFilterScriptExit() callback

PHP код:
#include <a_samp>
#include <dini>
#include <dutils>
#define dcmd(%1,%2,%3) if ((strcmp((%3)[1], #%1, true, (%2)) == 0) && ((((%3)[(%2) + 1] == 0) && (dcmd_%1(playerid, "")))||(((%3)[(%2) + 1] == 32) && (dcmd_%1(playerid, (%3)[(%2) + 2]))))) return 1
#define COLOUR_GREEN           0x33AA33AA
#define COLOUR_RED             0xAA3333AA
#define COLOUR_YELLOW          0xFFFF00AA
#define COLOUR_LIGHTBLUE       0x33CCFFAA
#define COLOUR_ORANGE          0xFF9900AA
#define PlayerFile            "AdminScript/Users/%s.ini"
#define SettingFile            "AdminScript/Settings/MainSettings.ini"
#define CommandFile            "AdminScript/Settings/Commands.ini"
#pragma unused ret_memcpy
#if defined FILTERSCRIPT
public OnFilterScriptInit()
{
    print(
"\n--------------------------------------");
    print(
" Administration Script By Trotty");
    print(
"--------------------------------------\n");
    return 
1;
}
    
#endif
    
enum PLAYER_MAIN {
    
PLAYER_NAME[MAX_PLAYER_NAME],
    
PLAYER_IP[16],
    
PLAYER_REGGED,
    
PLAYER_PASS,
    
PLAYER_LOGGED,
    
PLAYER_LEVEL,
    
PLAYER_WIRED,
    
PLAYER_JAILED
    
new gPlayerInfo[MAX_PLAYERS][PLAYER_MAIN];
public 
OnFilterScriptExit()
{
    return 
1;




Re: adminscript problem - Ash. - 04.06.2011

You failed to close your enum. Close it!

(After PLAYER_JAILED)

Like so:
pawn Код:
enum PLAYER_MAIN {
    PLAYER_NAME[MAX_PLAYER_NAME],
    PLAYER_IP[16],
    PLAYER_REGGED,
    PLAYER_PASS,
    PLAYER_LOGGED,
    PLAYER_LEVEL,
    PLAYER_WIRED,
    PLAYER_JAILED }



Re: adminscript problem - Trotty729 - 04.06.2011

ahh yes how stupid of me xD

thanks it just i havent coded in pwn in a while so i have forgoten most things xD


Re: adminscript problem - Ash. - 04.06.2011

Haha no problem. Glad I could help!