Ban Message - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Ban Message (
/showthread.php?tid=346356)
Ban Message -
MechaTech - 28.05.2012
I want if you are banned, and going to log back in you will get a message.
But i still dont know how that works.
This is my enum:
pawn Код:
enum pInfo
{
pPass,
pCash,
pAdmin,
pVip,
pKills,
pDeaths
}
new PlayerInfo[MAX_PLAYERS][pInfo];
Re: Ban Message -
Ranama - 28.05.2012
You will use a saved bool to every account to see if they are banned or not, and on public OnPlayerConnect (don't know if it is that) You will check if they have that bool set to false or true and then send message and kick them or let them login.
I think that is how you are doing it ^^.
Re: Ban Message -
MechaTech - 28.05.2012
how to make a bool?
EDIT: i doesn't give me the message. I have this:
pawn Код:
enum pInfo
{
bool:pBanned,
pPass,
pCash,
pAdmin,
pVip,
pKills,
pDeaths,
}
pawn Код:
if(PlayerInfo[playerid][pBanned] == true)
{
SendClientMessage(playerid, COLOR_RED, "You are banned, please make a unban appeal if you think you are wrongly banned.");
Kick(playerid);
}
And this is in mine ban command.
pawn Код:
Ban(id);
PlayerInfo[id][pBanned] = true;
Re: Ban Message -
Ranama - 28.05.2012
Quote:
Originally Posted by MechaTech
how to make a bool?
EDIT: i doesn't give me the message. I have this:
pawn Код:
enum pInfo { bool:pBanned, pPass, pCash, pAdmin, pVip, pKills, pDeaths, }
pawn Код:
if(PlayerInfo[playerid][pBanned] == true) { SendClientMessage(playerid, COLOR_RED, "You are banned, please make a unban appeal if you think you are wrongly banned."); Kick(playerid); }
And this is in mine ban command.
pawn Код:
Ban(id); PlayerInfo[id][pBanned] = true;
|
I don't know how to work with enums :S but it looks like you have done something wrong with the enum/saving system, Are you sure you have set the account to banned when enter the server?
Re: Ban Message -
MechaTech - 28.05.2012
Yes, if i want to connect to the server it says: Server Closed Connection, but it doesn't show te messages.
Re: Ban Message -
JaKe Elite - 28.05.2012
you don't need to make the pBanned as bool you can make it as integer.
EDIT:
Kicking player OnPlayerConnect will make player reconnect everytime set a timer that will kick a banned player
Re: Ban Message -
Ranama - 28.05.2012
Quote:
Originally Posted by Romel
you don't need to make the pBanned as bool you can make it as integer.
|
Making it as a bool saves computer power and memory