Need Help!!
#1

Why I Get This Error

Код:
C:\Users\Armageddon\Desktop\AdminSystem.pwn(70) : error 017: undefined symbol "PlayerInfo"
C:\Users\Armageddon\Desktop\AdminSystem.pwn(70) : warning 215: expression has no effect
C:\Users\Armageddon\Desktop\AdminSystem.pwn(70) : error 001: expected token: ";", but found "]"
C:\Users\Armageddon\Desktop\AdminSystem.pwn(70) : error 029: invalid expression, assumed zero
C:\Users\Armageddon\Desktop\AdminSystem.pwn(70) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


4 Errors.
on this line
Код:
	if(PlayerInfo[playerid][pAdmin] >= 1)
whole code
Код:
// This is a comment
// uncomment the line below if you want to write a filterscript
//#define FILTERSCRIPT

#include <a_samp>
#include <zcmd>
#include <sscanf2>
#include <YSI\y_ini>

#define PATH "/Users/%s.ini"

#if defined FILTERSCRIPT

enum pInfo
{
    pPass,
    pCash,
    pAdmin,
    pKills,
    pDeaths,
    pVip,
	pBanned
}

new PlayerInfo[playerid][pInfo];

stock UserPath(playerid)
{
	new string[128],playername[MAX_PLAYER_NAME];
	GetPlayerName(playerid,playername,sizeof(playername));
	format(string,sizeof(string),PATH,playername);
	return string;
}

forward LoadUser_data(playerid,name[],value[]);
public LoadUser_data(playerid,name[],value[])
{
	INI_Int("Password",PlayerInfo[playerid][pPass]);
	INI_Int("Cash",PlayerInfo[playerid][pCash]);
	INI_Int("Admin",PlayerInfo[playerid][pAdmin]);
	INI_Int("Kills",PlayerInfo[playerid][pKills]);
    INI_Int("Deaths",PlayerInfo[playerid][pDeaths]);
    INI_Int("Vip",PlayerInfo[playerid][pVip]);
    INI_Int("Banned",PlayerInfo[playerid][pBanned]);
 	return 1;
}


public OnFilterScriptInit()
{
	print("\n--------------------------------------");
	print("------- Admin System v1 Loaded ---------");
	print("--------------------------------------\n");
	return 1;
}

public OnFilterScriptExit()
{
	print("\n--------------------------------------");
	print("------- Admin System v1 Unloaded ---------");
	print("--------------------------------------\n");
	return 1;
}

#else
#endif

CMD:announce(playerid, params[])
{
	if(PlayerInfo[playerid][pAdmin] >= 1)
	{
	    new msg[256], pname[MAX_PLAYER_NAME], string[256];
        if(sscanf(params,"s", msg)) return SendClientMessage(playerid, 0xFF0000, "{FF0000}[USAGE]: /announce <text>");
   		GetPlayerName(playerid, pname, sizeof(pname));
		format( string, sizeof(string), "{FFFF66}[Announcement] {33CCFF}%s ", string);
		SendClientMessageToAll( 0x0, string);
	}
	return 1;
}
please help me
Reply
#2

Quote:
Originally Posted by Armageddonz
Посмотреть сообщение
Why I Get This Error

Код:
C:\Users\Armageddon\Desktop\AdminSystem.pwn(70) : error 017: undefined symbol "PlayerInfo"
C:\Users\Armageddon\Desktop\AdminSystem.pwn(70) : warning 215: expression has no effect
C:\Users\Armageddon\Desktop\AdminSystem.pwn(70) : error 001: expected token: ";", but found "]"
C:\Users\Armageddon\Desktop\AdminSystem.pwn(70) : error 029: invalid expression, assumed zero
C:\Users\Armageddon\Desktop\AdminSystem.pwn(70) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


4 Errors.
on this line
Код:
	if(PlayerInfo[playerid][pAdmin] >= 1)
whole code
Код:
// This is a comment
// uncomment the line below if you want to write a filterscript
//#define FILTERSCRIPT

#include <a_samp>
#include <zcmd>
#include <sscanf2>
#include <YSI\y_ini>

#define PATH "/Users/%s.ini"

#if defined FILTERSCRIPT

enum pInfo
{
    pPass,
    pCash,
    pAdmin,
    pKills,
    pDeaths,
    pVip,
	pBanned
}

new PlayerInfo[playerid][pInfo];

stock UserPath(playerid)
{
	new string[128],playername[MAX_PLAYER_NAME];
	GetPlayerName(playerid,playername,sizeof(playername));
	format(string,sizeof(string),PATH,playername);
	return string;
}

forward LoadUser_data(playerid,name[],value[]);
public LoadUser_data(playerid,name[],value[])
{
	INI_Int("Password",PlayerInfo[playerid][pPass]);
	INI_Int("Cash",PlayerInfo[playerid][pCash]);
	INI_Int("Admin",PlayerInfo[playerid][pAdmin]);
	INI_Int("Kills",PlayerInfo[playerid][pKills]);
    INI_Int("Deaths",PlayerInfo[playerid][pDeaths]);
    INI_Int("Vip",PlayerInfo[playerid][pVip]);
    INI_Int("Banned",PlayerInfo[playerid][pBanned]);
 	return 1;
}


public OnFilterScriptInit()
{
	print("\n--------------------------------------");
	print("------- Admin System v1 Loaded ---------");
	print("--------------------------------------\n");
	return 1;
}

public OnFilterScriptExit()
{
	print("\n--------------------------------------");
	print("------- Admin System v1 Unloaded ---------");
	print("--------------------------------------\n");
	return 1;
}

#else
#endif

CMD:announce(playerid, params[])
{
	if(PlayerInfo[playerid][pAdmin] >= 1)
	{
	    new msg[256], pname[MAX_PLAYER_NAME], string[256];
        if(sscanf(params,"s", msg)) return SendClientMessage(playerid, 0xFF0000, "{FF0000}[USAGE]: /announce <text>");
   		GetPlayerName(playerid, pname, sizeof(pname));
		format( string, sizeof(string), "{FFFF66}[Announcement] {33CCFF}%s ", string);
		SendClientMessageToAll( 0x0, string);
	}
	return 1;
}
please help me
you made small mistake your enum should like this:
Код:
enum pInfo
{
    pPass,
    pCash,
    pAdmin,
    pKills,
    pDeaths,
    pVip,
	pBanned
};
You forgot to add ; After }!! rep++ me if helped
Reply
#3

wtf its not work lol.. enum doesn't need this ";"
Reply
#4

Quote:
Originally Posted by Armageddonz
Посмотреть сообщение
ok thanks
Any time mate!
Reply
#5

wtf its not work lol.. enum doesn't need this ";"
Reply
#6

Quote:
Originally Posted by Armageddonz
Посмотреть сообщение
wtf its not work lol.. enum doesn't need this ";"
nope enum needs ";" and try this one:
Код:
new PlayerInfo[MAX_PLAYERS+1][pInfo];
this should work!

another prob was you cant use [playerid] to define it in enum, use MAX_PLAYERS for it! in my server this works!
Reply
#7

nope its not work..
Reply
#8

**DELETED**
Look down
|
|
|
|
\/
Reply
#9

Quote:
Originally Posted by Armageddonz
Посмотреть сообщение
nope its not work..
i was using that in my server that should work?

anyways just copy-paste this one and prey:
PHP код:
enum pInfo
{
    
pPass[52],
    
pCash,
    
pAdmin,
    
pKills,
    
pDeaths,
    
pVip,
    
pBanned
};
new 
PlayerInfo[MAX_PLAYERS+1][pInfo]; 
This one WORKS... copy and paste this and use it!
Reply
#10

nope enum doesn't need ";"..check the wiki https://sampwiki.blast.hk/wiki/Keywords:Initialisers#enum
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)