Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- stock BanPlayer(playerid, giveplayerid, time, reason[])
- {
- new name[24], namegive[24];
- if(playerid == 501) format(name, sizeof(name), "Squidward (Anti-Cheat)");
- else GetPlayerName(playerid, name, sizeof(name));
- GetPlayerName(giveplayerid, namegive, sizeof(namegive));
- new curtime = gettime();
- new expire;
- if(!time)
- {
- expire = 1577836800;
- }
- else
- {
- new Float:banminutes = time * 24 * 60 * 60;
- new bantime = floatround(banminutes);
- expire = curtime + bantime;
- }
- new q[400];
- new ip[16];
- GetPlayerIp(giveplayerid, ip, sizeof(ip));
- //AddBan(ip);
- format(q, sizeof(q), "INSERT INTO bans (name, reason, ban_time, issue_time, expiry_time, admin, ip) VALUES ('%s', '%s', %d, %d, %d, '%s', '%s')", namegive, reason, time, curtime, expire, name, ip);
- mysql_query(q, THREAD_INSERT_BAN);
- new banid = mysql_insert_id();
- new string[128];
- if(time)
- format(STRING, "AdmCmd: %s was banned for %d days by %s: %s", GetPlayerNameEx(giveplayerid), time, GetPlayerNameEx(playerid), reason);
- else
- format(STRING, "AdmCmd: %s was banned permanently by %s: %s", GetPlayerNameEx(giveplayerid), name, reason);
- SendClientMessageToAllEx(COLOR_LIGHTRED, string);
- if(time)
- format(STRING, "You were banned by Admin %s for %d days: %s", GetPlayerNameEx(playerid), time, reason);
- else
- format(STRING, "You were banned permanently by Admin %s: %s", name, reason);
- SendClientMessage(giveplayerid, 0x00FF00FF, string);
- new dialogstring[512];
- format(dialogstring, sizeof(dialogstring), "You have been banned from this server for the following reason:\n\n%s\n\nIf you think that this ban was in error, please go to http://cs-roleplay.indonesianforum.net and appeal it.\nYou will need the following info to appeal the ban:\n\nBan ID: %d\nAdmin that banned you: %s\nReason of the ban: %s\n\n{00ff00}PLEASE TAKE A SCREENSHOT USING F8 RIGHT NOW, AND INCLUDE IT IN YOUR BAN APPEAL!", reason, banid, name, reason);
- ShowPlayerDialog(giveplayerid, 4564, DIALOG_STYLE_MSGBOX, "Banned!", dialogstring, "Close", "");
- SetTimerEx("SendToKick", 1500, 0, "i", giveplayerid);
- return 1;
- }
- stock BanAccount(playerid, giveplayerid[24], time, reason[], ip[])
- {
- new name[24];
- if(playerid == 501) format(name, sizeof(name), "Squidward (Anti-Cheat)");
- else GetPlayerName(playerid, name, sizeof(name));
- new curtime = gettime();
- new expire;
- if(!time)
- {
- expire = 1577836800;
- }
- else
- {
- new Float:banminutes = time * 24 * 60 * 60;
- new bantime = floatround(banminutes);
- expire = curtime + bantime;
- }
- new q[400];
- format(q, sizeof(q), "INSERT INTO bans (name, reason, ban_time, issue_time, expiry_time, admin, ip) VALUES ('%s', '%s', %d, %d, %d, '%s', '%s')", giveplayerid, reason, time, curtime, expire, name, ip);
- mysql_query(q, THREAD_INSERT_BAN);
- new string[128];
- if(time)
- format(string,sizeof(string), "AdmCmd: %s was offline banned for %d days by %s: %s", giveplayerid, time, GetPlayerNameEx(playerid), reason);
- else
- format(string,sizeof(string), "AdmCmd: %s was offline banned permanently by %s: %s", giveplayerid, name, reason);
- ABroadCast(COLOR_LIGHTRED, string, 2);
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement