Ban System
#1

Hi I was searching here for a Ban System.
What I found was this: https://sampforum.blast.hk/showthread.php?tid=401701
I used that Code to implement it in my gamemode but now I got those errors:

D:\Rockstar Games\GTA San Andreas\gamemodes\GFSUpdated.pwn(60) : error 017: undefined symbol "SInfo"
D:\Rockstar Games\GTA San Andreas\gamemodes\GFSUpdated.pwn(60) : warning 215: expression has no effect
D:\Rockstar Games\GTA San Andreas\gamemodes\GFSUpdated.pwn(60) : error 001: expected token: ";", but found "]"
D:\Rockstar Games\GTA San Andreas\gamemodes\GFSUpdated.pwn(60) : error 029: invalid expression, assumed zero

I was trying to edit the Line, since Error 001 usually tells me that I am missing a ";" but I can't find any solution.

Code:
Quote:

enum PlayerInfo
{
Banned
};
forward LoadUser_data(playerid,name[],value[]);
public LoadUser_data(playerid,name[],value[])
{
INI_Int("Banned",SInfo[playerid][Banned]); <<<<<<<<<Line 60
return 1;
}

Reply
#2

Quote:

INI_Int("Banned",SInfo[playerid][Banned]);

replace with this
INI_Int("Banned",pInfo[playerid][Banned]);
Reply
#3

Now its showing the same errors with "pInfo"
Reply
#4

INI_Int("Banned",PlayerInfo[playerid][Banned]);

try this one
Reply
#5

3 Same errors but one new:

D:\Rockstar Games\GTA San Andreas\gamemodes\GFSUpdated.pwn(60) : error 028: invalid subscript (not an array or too many subscripts): "PlayerInfo"
Reply
#6

pawn Code:
enum PlayerInfo
{
    Banned
};

new SInfo[MAX_PLAYERS][PlayerInfo];

forward LoadUser_data(playerid,name[],value[]);
public LoadUser_data(playerid,name[],value[])
{
    INI_Int("Banned",SInfo[playerid][Banned]);
    return 1;
}
Reply
#7

D:\Rockstar Games\GTA San Andreas\gamemodes\GFSUpdated.pwn(85) : error 021: symbol already defined: "PlayerInfo"
D:\Rockstar Games\GTA San Andreas\gamemodes\GFSUpdated.pwn(140) : error 028: invalid subscript (not an array or too many subscripts): "PlayerInfo"
D:\Rockstar Games\GTA San Andreas\gamemodes\GFSUpdated.pwn(140) : warning 215: expression has no effect
D:\Rockstar Games\GTA San Andreas\gamemodes\GFSUpdated.pwn(140) : error 001: expected token: ";", but found "]"
D:\Rockstar Games\GTA San Andreas\gamemodes\GFSUpdated.pwn(140) : error 029: invalid expression, assumed zero
D:\Rockstar Games\GTA San Andreas\gamemodes\GFSUpdated.pwn(140) : fatal error 107: too many error messages on one line

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


5 Errors.

85 new PlayerInfo[MAX_PLAYERS][P_ACCOUNT_DATA];
86 new playerLogin[MAX_PLAYERS];
87 new joinskin = mS_INVALID_LISTID;

138 public OnPlayerRequestClass(playerid, classid)
139 {
140 if(PlayerInfo[playerid][pLoggedin] == false)
141 {
142 SetSpawnInfo( playerid, 0, 0, 563.3157, 3315.2559, 0, 269.15, 0, 0, 0, 0, 0, 0 );
143 TogglePlayerSpectating(playerid, true);
144 TogglePlayerSpectating(playerid, false);
145 SetPlayerCamera(playerid);
146 return 1;
147 }
Reply
#8

pawn Code:
enum p_Info
{
    Banned
};

new SInfo[MAX_PLAYERS][p_Info];

forward LoadUser_data(playerid,name[],value[]);
public LoadUser_data(playerid,name[],value[])
{
    INI_Int("Banned",SInfo[playerid][Banned]);
    return 1;
}
this should do it.

why do you have to make another enum for this if you already have one? just put the "Banned" on the existing enum and all should be fine.
Reply
#9

Hm now I have 20 errors in several lines

Well I am pretty new and trying stuff to learn about it, thats why.
Reply
#10

You can ctrl+f "P_ACCOUNT_DATA" and put Banned under it.

it will look like this
pawn Code:
enum P_ACCOUNT_DATA
{
   //Other things
  ID, //<---- This is an example.
  Banned
};
And Change this

pawn Code:
INI_Int("Banned",SInfo[playerid][Banned]);
to this

pawn Code:
INI_Int("Banned",PlayerInfo[playerid][Banned]);
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)