[HELP-Question]Is This wrong ?
#5

pawn Код:
CMD:ban(playerid, params[])
{
    if(!PlayerInfo[playerid][LoggedIn]) return SendClientMessage(playerid, red, "ERROR: You must be logged in to use this commands");
    if(PlayerInfo[playerid][Level] < 7) return SendClientMessage(playerid, red, "ERROR: You are not a high enough level to use this command");
    new targetid, reason[40];
    if(sscanf(params, "iS(No Reason)[40]", targetid, reason)) return SendClientMessage(playerid, red, "USAGE: /ban [playerid] [reason]");
    if(!IsPlayerConnected(targetid) || targetid == INVALID_PLAYER_ID) return SendClientMessage(playerid, red, "Player is not connected.");
    if(targetid == playerid) return SendClientMessage(playerid, red, "You cannot ban yourself.");
    if(PlayerInfo[targetid][Level] == ServerInfo[MaxAdminLevel]) return SendClientMessage(playerid, red, "This player is the highest level admin, you cannot ban them.");
    new PlayerName[MAX_PLAYER_NAME], AdminName[MAX_PLAYER_NAME], string[150];
    GetPlayerName(playerid, AdminName, sizeof(AdminName));
    GetPlayerName(targetid, PlayerName, sizeof(PlayerName));
    new year, month, day, hour, minute, second;
    getdate(year, month, day);
    gettime(hour, minute, second);
    format(string, sizeof(string), "{FF0000}YG INFO - %s(ID: %d) has been banned by Administrator %s (ID: %d) [Reason: %s]", PlayerName, targetid, AdminName, playerid, reason);
    SendClientMessageToAll(red, string);
    CMDMessageToAdmins(playerid, "Ban");
    SaveToFile("BanLog", string);
    aresetpall(targetid);
    print(string);
    if(udb_Exists(PlayerName2(targetid)) && PlayerInfo[targetid][LoggedIn] == 1) dUserSetINT(PlayerName2(targetid));.("banned", 1);
    SendClientMessage(targetid, red, "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~");
    SendClientMessage(targetid, red, "YOU HAVE BEEN BANNED - READ THE FOLLOWING DETAILS:");
    format(string, sizeof(string), "Your Name: %s", PlayerName);
    SendClientMessage(targetid, green, string);
    format(string, sizeof(string), "Admin Name: %s", AdminName);
    SendClientMessage(targetid, green, string);
    format(string, sizeof(string), "Date And Time: %d/%d/%d %d:%d", day, month, year, hour, minute);
    SendClientMessage(targetid, green, string);
    format(string, sizeof(string), "Reason: %s", reason);
    SendClientMessage(targetid, green, string);
    SendClientMessage(targetid, green, "(If You Wish To Make an Appeal goto YG-Gamers.tk and post in the Unban Appeals Category.)");
    SendClientMessage(targetid, red, "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~");
    return SetTimerEx("BanTimer", 200, false, "is", playerid, reason);
}

forward BanTimer(playerid, reason[]);
public BanTimer(playerid, reason[]) return BanEx(playerid, reason);
Includes Required:
- zcmd (https://sampforum.blast.hk/showthread.php?tid=91354)
- sscanf2 (https://sampforum.blast.hk/showthread.php?tid=120356)

Plugins Required:
- sscanf (https://sampforum.blast.hk/showthread.php?tid=120356)
Reply


Messages In This Thread
[HELP-Question]Is This wrong ? - by donhu789 - 30.12.2013, 16:19
Re: [HELP-Question]Is This wrong ? - by ic3cr3am - 30.12.2013, 16:54
Re: [HELP-Question]Is This wrong ? - by donhu789 - 30.12.2013, 16:57
Re: [HELP-Question]Is This wrong ? - by donhu789 - 31.12.2013, 01:00
Re: [HELP-Question]Is This wrong ? - by Threshold - 31.12.2013, 03:44
Re: [HELP-Question]Is This wrong ? - by donhu789 - 31.12.2013, 09:32

Forum Jump:


Users browsing this thread: 1 Guest(s)