SA-MP Forums

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

Reply
 
Thread Tools Display Modes
Old 03/06/2020, 06:19 PM   #11
JXZ
Little Clucker
 
Join Date: Feb 2019
Posts: 8
Reputation: 0
Default Re: Ban System

D:\Rockstar Games\GTA San Andreas\gamemodes\GFSUpdated.pwn(61) : error 017: undefined symbol "pInfo"
D:\Rockstar Games\GTA San Andreas\gamemodes\GFSUpdated.pwn(61) : error 009: invalid array size (negative, zero or out of bounds)
D:\Rockstar Games\GTA San Andreas\gamemodes\GFSUpdated.pwn(66) : error 017: undefined symbol "Banned"
D:\Rockstar Games\GTA San Andreas\gamemodes\GFSUpdated.pwn(74) : error 055: start of function body without function header
D:\Rockstar Games\GTA San Andreas\gamemodes\GFSUpdated.pwn(111) : error 017: undefined symbol "pLoggedin"
D:\Rockstar Games\GTA San Andreas\gamemodes\GFSUpdated.pwn(116) : error 017: undefined symbol "SetPlayerCamera"
D:\Rockstar Games\GTA San Andreas\gamemodes\GFSUpdated.pwn(119) : error 017: undefined symbol "pSkin"
D:\Rockstar Games\GTA San Andreas\gamemodes\GFSUpdated.pwn(127) : warning 213: tag mismatch
D:\Rockstar Games\GTA San Andreas\gamemodes\GFSUpdated.pwn(130) : error 017: undefined symbol "KickEx"
D:\Rockstar Games\GTA San Andreas\gamemodes\GFSUpdated.pwn(132) : error 017: undefined symbol "SetPlayerCamera"
D:\Rockstar Games\GTA San Andreas\gamemodes\GFSUpdated.pwn(133) : error 017: undefined symbol "ResetPlayer"
D:\Rockstar Games\GTA San Andreas\gamemodes\GFSUpdated.pwn(137) : error 017: undefined symbol "ReturnName"
D:\Rockstar Games\GTA San Andreas\gamemodes\GFSUpdated.pwn(146) : error 017: undefined symbol "File"
D:\Rockstar Games\GTA San Andreas\gamemodes\GFSUpdated.pwn(321) : error 017: undefined symbol "pSkin"
D:\Rockstar Games\GTA San Andreas\gamemodes\GFSUpdated.pwn(337) : error 017: undefined symbol "KickEx"
D:\Rockstar Games\GTA San Andreas\gamemodes\GFSUpdated.pwn(345) : error 017: undefined symbol "ReturnName"
D:\Rockstar Games\GTA San Andreas\gamemodes\GFSUpdated.pwn(353) : error 017: undefined symbol "KickEx"
D:\Rockstar Games\GTA San Andreas\gamemodes\GFSUpdated.pwn(358 -- 359) : error 017: undefined symbol "ReturnName"
D:\Rockstar Games\GTA San Andreas\gamemodes\GFSUpdated.pwn(465) : error 017: undefined symbol "pAdmin"
D:\Rockstar Games\GTA San Andreas\gamemodes\GFSUpdated.pwn(475) : error 017: undefined symbol "SendClientMessageEx"
D:\Rockstar Games\GTA San Andreas\gamemodes\GFSUpdated.pwn(477) : error 017: undefined symbol "pAdmin"
D:\Rockstar Games\GTA San Andreas\gamemodes\GFSUpdated.pwn(479) : error 017: undefined symbol "pDBID"
D:\Rockstar Games\GTA San Andreas\gamemodes\GFSUpdated.pwn(49 : error 017: undefined symbol "pAdmin"
D:\Rockstar Games\GTA San Andreas\gamemodes\GFSUpdated.pwn(505) : warning 217: loose indentation
D:\Rockstar Games\GTA San Andreas\gamemodes\GFSUpdated.pwn(50 : error 017: undefined symbol "KickEx"
D:\Rockstar Games\GTA San Andreas\gamemodes\GFSUpdated.pwn(515) : error 017: undefined symbol "pAdmin"
D:\Rockstar Games\GTA San Andreas\gamemodes\GFSUpdated.pwn(520) : error 079: inconsistent return types (array & non-array)
D:\Rockstar Games\GTA San Andreas\gamemodes\GFSUpdated.pwn(521) : warning 217: loose indentation
D:\Rockstar Games\GTA San Andreas\gamemodes\GFSUpdated.pwn(522) : error 017: undefined symbol "ID"

Compilation aborted.Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase


26 Errors.
JXZ is offline   Reply With Quote
Old 03/06/2020, 11:32 PM   #12
jasperschellekens
High-roller
 
jasperschellekens's Avatar
 
Join Date: Dec 2016
Location: Holland
Posts: 1,080
Reputation: 126
Default Re: Ban System

You guys are only making it worse for him lmao..

You should revert everything to your original code and don't listen to these guys.

Now when you have done that,
first of all. You already have an enum PlayerInfo somewhere.
So look for the enum that you already have and search for it's declaration too.

something like:
pawn Code:
new var/declaration[MAX_PLAYERS][PlayerInfo];

If you can't find this, then even a single variable would be better than using an enum for a single variable.
Which I highly do NOT recommend, if you are lazy you will do this probably. If you are determined you will search for your existing variable.

pawn Code:
new PlayerBanned[MAX_PLAYERS];

forward LoadUser_data(playerid,name[],value[]);
public LoadUser_data(playerid,name[],value[])
{
    INI_Int("Banned", PlayerBanned[playerid]);
    return 1;
}
__________________
If you want to have your own custom script, or even want to have one of our already released scripts, join our SCRIPTING SERVICES DISCORD, or send me a private message!


Undead Wasteland Roleplay - The year is 1996. San Andreas is a wasteland ruled by the undead. the once so glorius landscape of San Andreas, is now a shattered decayed place that is only a vague memory of the world as we used to know it.
Discord - Website
jasperschellekens is offline   Reply With Quote
Old 04/06/2020, 01:31 AM   #13
Shadow0707
Big Clucker
 
Join Date: Sep 2016
Posts: 92
Reputation: 7
Default Re: Ban System

Quote:
Originally Posted by JXZ View Post

85 new PlayerInfo[MAX_PLAYERS][P_ACCOUNT_DATA]; <-----------
that's where P_ACCOUNT_DATA came from.

Quote:
Originally Posted by jasperschellekens View Post
You guys are only making it worse for him lmao..

You should revert everything to your original code and don't listen to these guys.

Now when you have done that,
first of all. You already have an enum PlayerInfo somewhere.
So look for the enum that you already have and search for it's declaration too.

something like:
pawn Code:
new var/declaration[MAX_PLAYERS][PlayerInfo];

If you can't find this, then even a single variable would be better than using an enum for a single variable.
Which I highly do NOT recommend, if you are lazy you will do this probably. If you are determined you will search for your existing variable.

pawn Code:
new PlayerBanned[MAX_PLAYERS];

forward LoadUser_data(playerid,name[],value[]);
public LoadUser_data(playerid,name[],value[])
{
    INI_Int("Banned", PlayerBanned[playerid]);
    return 1;
}
This is the same as what I said, but you just suggested him something even worse.

btw, can you search for enum P_ACCOUNT_DATA and send it here?
Shadow0707 is online now   Reply With Quote
Old 04/06/2020, 03:22 AM   #14
jasperschellekens
High-roller
 
jasperschellekens's Avatar
 
Join Date: Dec 2016
Location: Holland
Posts: 1,080
Reputation: 126
Default Re: Ban System

Quote:
Originally Posted by Shadow0707 View Post
that's where P_ACCOUNT_DATA came from.



This is the same as what I said, but you just suggested him something even worse.

btw, can you search for enum P_ACCOUNT_DATA and send it here?
The fact that you think that proves my point even more lol
__________________
If you want to have your own custom script, or even want to have one of our already released scripts, join our SCRIPTING SERVICES DISCORD, or send me a private message!


Undead Wasteland Roleplay - The year is 1996. San Andreas is a wasteland ruled by the undead. the once so glorius landscape of San Andreas, is now a shattered decayed place that is only a vague memory of the world as we used to know it.
Discord - Website
jasperschellekens is offline   Reply With Quote
Old 04/06/2020, 06:51 AM   #15
JXZ
Little Clucker
 
Join Date: Feb 2019
Posts: 8
Reputation: 0
Default Re: Ban System

Code Request:
Quote:
enum P_ACCOUNT_DATA
{
pDBID,
pAccName[60],
pSkin,
boolLoggedin,
pAdmin
}

new PlayerInfo[MAX_PLAYERS][P_ACCOUNT_DATA];
new playerLogin[MAX_PLAYERS];
new joinskin = mS_INVALID_LISTID;
New Code:
Quote:

new PlayerBanned[MAX_PLAYERS], Banned;

forward LoadUser_data(playerid,name[],value[]);
public LoadUser_data(playerid,name[],value[])
{
INI_Int("Banned",PlayerBanned[playerid][Banned]); >>>>>>LINE 66
return 1;
}
Quote:
D:\Rockstar Games\GTA San Andreas\gamemodes\GFSUpdated.pwn(66) : error 001: expected token: ";", but found "["
D:\Rockstar Games\GTA San Andreas\gamemodes\GFSUpdated.pwn(66) : error 029: invalid expression, assumed zero
D:\Rockstar Games\GTA San Andreas\gamemodes\GFSUpdated.pwn(66) : warning 215: expression has no effect
D:\Rockstar Games\GTA San Andreas\gamemodes\GFSUpdated.pwn(66) : error 001: expected token: ";", but found "]"
D:\Rockstar Games\GTA San Andreas\gamemodes\GFSUpdated.pwn(66) : 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.

Another fact that I might haven't considered, is that I have no stock for LoadAccount, SaveAccount etc.
I guess you need that !?

I got the register system by another guy and tried to gently implement those new commands into the Code, without destroying it, since I am a beginner to this stuff.

Also my /ban Command is different from the given "Tutorial".
Quote:
CMD:ban(playerid,params[])
{
if(PlayerInfo[playerid][pAdmin] >= 5 || IsPlayerAdmin(playerid))//RCON
{
new pID, reason[50], name[MAX_PLAYER_NAME], banned[MAX_PLAYER_NAME], str[128];

if(sscanf(params, "us",pID, reason))
return GameTextForPlayer(playerid,"/ban ID reason", 3000, 3);
{
if(ID != INVALID_PLAYER_ID)
{
SInfo[ID][Banned]=1;
GetPlayerName(playerid,name, sizeof(name)), GetPlayerName(pID, banned, sizeof(banned));
format(str,sizeof(str),"ADMIN: %s banned %s from the server. REASON: %s", name, banned, reason);
SendClientMessageToAll(COLOR_RED,str);
BanEx(pID, reason);
}
}
return 1;
}
I tried many times to add the stocks, but it was giving me alot of Errors.
Also I want to understand how the Code is working together, because copy and paste isn't explaining anything at all.

Big thanks for reading, and helping me out
JXZ 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 06:01 PM.


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