help with warn and kill command
#2

The warn command.
pawn Код:
dcmd_warn(playerid, params[])
{
    new
        warnID,
        Reason[128];
       
    if(Player[playerid][admin] < 1)
        return SendClientMessage(playerid,COLOR_RED,"You Dont Have Right To Use This Command");
    if(sscanf(params,"ds",warnID, Reason))
        return SendClientMessage(playerid, COLOR_RED, "/warn [playerid] [reason]");
    if(!IsPlayerConnected(playerid))
        return SendClientMessage(playerid,COLOR_RED,"Nobody is connected with this ID!");
    if(warnID == playerid)
        return SendClientMessage(playerid,COLOR_RED,"You can`t WARN yourself");
    if(Player[playerid][admin] < Player[warnID][admin])
        return SendClientMessage(playerid,COLOR_RED,"You can`t WARN a high ranked admin");
       
    new
        wString[128],
        Name[24];
       
    SetPVarInt(warnID, "PlayerWarnings", GetPVarInt(playerid, "PlayerWarnings")+1);
    GetPlayerName(playerid,Name,24);
    format(wString, 128, "**(ADMIN WARN)*** %s(%d) %s Read /Rules",Name, warnID, Reason);
    SendClientMessageToAll(COLOR_RED, wString);
    format(wString, 128, "%s(%d) (Has Been Forced To Read Rules)",Name, warnID);
    SendClientMessageToAll(COLOR_RED, wString);
    format(wString, 128, "You Have Been WARNED By Admin For: %s",Reason);
    SendClientMessage(warnID, COLOR_RED, wString);
   
    if(GetPVarInt(playerid, "PlayerWarnings")>=3)
        Kick(warnID);
       
    return 1;
}
The akill command.
pawn Код:
dcmd_akill(playerid, params[])
{
    new
        pID,
        Reason;
       
    if(Player[playerid][admin] < 4)
        return SendClientMessage(playerid,COLOR_RED,"You Dont Have Right To Use This Command");
    if(sscanf(params,"ds",pID,Reason))
        return SendClientMessage(playerid,COLOR_RED,"USAGE: /akill [playerid] [reason]");
    if(!IsPlayerConnected(pID))
        return SendClientMessage(playerid,COLOR_RED,"Nobody is connected with this ID!");
    if(pID == playerid)
        return SendClientMessage(playerid,COLOR_RED,"You can`t KILL yourself");
    if(Player[playerid][admin] < Player[pID][admin])
        return SendClientMessage(playerid,COLOR_RED,"You can`t KILL a high ranked admin");
       
    new
        name[24],
        string[128];
       
    GetPlayerName(pID,name,24);
    format(string,128,"**(ADMIN KILL)** %s(%d) %s",name,pID,Reason);
    SendClientMessageToAll(COLOR_RED, string);
    format(string,128,"You Have Been KILLED By Admin For Reason: %s",Reason);
    SendClientMessage(pID, COLOR_RED, string);
    SetPlayerHealth(playerid, 0.0);
    return 1;
}
Reply


Messages In This Thread
help with warn and kill command - by [MKD]Max - 14.10.2010, 19:31
Re: help with warn and kill command - by Backwardsman97 - 15.10.2010, 04:08

Forum Jump:


Users browsing this thread: 1 Guest(s)