SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 03/06/2020, 04:50 PM   #1
JXZ
Little Clucker
 
Join Date: Feb 2019
Posts: 8
Reputation: 0
Smile Ban System

Hi I was searching here for a Ban System.
What I found was this: https://forum.sa-mp.com/showthread.php?t=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;
}
JXZ is offline   Reply With Quote
Old 03/06/2020, 04:53 PM   #2
makemoneynotfriends
Big Clucker
 
Join Date: Jan 2020
Location: Egypt
Posts: 120
Reputation: 3
Default Re: Ban System

Quote:
INI_Int("Banned",SInfo[playerid][Banned]);
replace with this
INI_Int("Banned",pInfo[playerid][Banned]);
makemoneynotfriends is offline   Reply With Quote
Old 03/06/2020, 04:57 PM   #3
JXZ
Little Clucker
 
Join Date: Feb 2019
Posts: 8
Reputation: 0
Default Re: Ban System

Now its showing the same errors with "pInfo"
JXZ is offline   Reply With Quote
Old 03/06/2020, 04:58 PM   #4
makemoneynotfriends
Big Clucker
 
Join Date: Jan 2020
Location: Egypt
Posts: 120
Reputation: 3
Default Re: Ban System

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

try this one
makemoneynotfriends is offline   Reply With Quote
Old 03/06/2020, 05:00 PM   #5
JXZ
Little Clucker
 
Join Date: Feb 2019
Posts: 8
Reputation: 0
Default Re: Ban System

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"
JXZ is offline   Reply With Quote
Old 03/06/2020, 05:53 PM   #6
Shadow0707
Big Clucker
 
Join Date: Sep 2016
Posts: 92
Reputation: 7
Default Re: Ban System

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;
}
Shadow0707 is offline   Reply With Quote
Old 03/06/2020, 05:57 PM   #7
JXZ
Little Clucker
 
Join Date: Feb 2019
Posts: 8
Reputation: 0
Default Re: Ban System

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 (c) 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 }
JXZ is offline   Reply With Quote
Old 03/06/2020, 06:01 PM   #8
Shadow0707
Big Clucker
 
Join Date: Sep 2016
Posts: 92
Reputation: 7
Default Re: Ban System

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.
Shadow0707 is offline   Reply With Quote
Old 03/06/2020, 06:08 PM   #9
JXZ
Little Clucker
 
Join Date: Feb 2019
Posts: 8
Reputation: 0
Default Re: Ban System

Hm now I have 20 errors in several lines

Well I am pretty new and trying stuff to learn about it, thats why.
JXZ is offline   Reply With Quote
Old 03/06/2020, 06:13 PM   #10
Shadow0707
Big Clucker
 
Join Date: Sep 2016
Posts: 92
Reputation: 7
Default Re: Ban System

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]);
Shadow0707 is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Job System, House Rent System and Event System AngeloBrand98 Scripting Help 2 08/11/2016 07:34 AM
[FilterScript] NRank System V1.0 | Advanced Rank System | 5+ Commands | Dialog System [Much More] Nirzor Filterscripts 9 18/04/2014 09:49 PM
[FilterScript] Cross Admin System V1.2 [updated] + Added IRC System + Anti Cheat(sscanf, dcmd,y_ini) No.1 Admin System CROSS_Hunter Filterscripts 21 02/01/2013 06:32 PM


All times are GMT. The time now is 09:00 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.