Admin System Help

snaptrap

Active member
Joined
Feb 7, 2014
Messages
56
Reaction score
1
Why I Get This Error
Code:
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 (c) 1997-2006, ITB CompuPhase


4 Errors.

On This Line
Code:
	if(PlayerInfo[playerid][pAdmin] >= 1)

whole code
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;
}

my users data is at "scriptfiles\Users"

please help me ;c
 

Codex1337

Active member
Joined
Mar 1, 2014
Messages
170
Reaction score
1
new PlayerInfo[playerid][pInfo];

Replace it with

new PlayerInfo[MAX_PLAYERS][pInfo];
 
Top