18.03.2013, 16:59
Hey guys, I use MySQL. But I still do not have a clear idea on how to ban the players IP/Account and store the information in the database. For example in the database, the columns in the ban table would be:
- Player Name
- Reason
- Banned by
- Ban date
- Unban date
- Ban length
I don't have a clear idea on how to actually do that. Can you explain using my anti - jetpack ban.
Please help - appreciated
Thanks!
- Player Name
- Reason
- Banned by
- Ban date
- Unban date
- Ban length
I don't have a clear idea on how to actually do that. Can you explain using my anti - jetpack ban.
pawn Код:
public OnPlayerUpdate(playerid)
{
if(GetPlayerSpecialAction(playerid) == SPECIAL_ACTION_USEJETPACK)
{
for(new i = 0; i < 50; i++) SendClientMessage(playerid, COLOR_WHITE," ");
new str[128],
name[MAX_PLAYER_NAME];
GetPlayerName(playerid,name,MAX_PLAYER_NAME);
format(str, sizeof (str), "[AUTO - BAN] %s has been automatically banned from the server. Reason: Spawning a jetpack!", name);
SendClientMessageToAll(RED, str);
new string[952], pName[MAX_PLAYER_NAME];
GetPlayerName(playerid, pName, sizeof(pName));
format(string, sizeof string, "{FF0000}Name: %s\n", pName);
strcat(string, "{FF0000}Ban reason: Spawning a jetpack\n");
strcat(string, "{FF0000}Banned by: Anti - Cheat\n");
strcat(string, "{FF0000}Ban length: Permenant\n");
strcat(string, "{FF0000}Date of unban: Never\n");
strcat(string, "\n");
strcat(string, "{FF0000}If you think this ban is unfair, please take a screenshot by pressing F8, and make an unban appeal at our forums\n");
strcat(string, "\n");
strcat(string, "{FF0000}Note - We do not unban cheaters or people who lie in their application!\n");
ShowPlayerDialog(playerid, DIALOG_BAN, DIALOG_STYLE_MSGBOX, "{FFD000}Banned!", string, "Close", "");
pInfo[playerid][pBanned] = 1;
}
return 1;
}
Thanks!