help with this error!
#5

Thats some ugly looking code give this a try, (not tested i would have done the command much different).
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,"ud",warnID, Reason))
        return SendClientMessage(playerid, COLOR_RED, "|| Usage: /warn [playerid] [reason] ||");
    if(!IsPlayerConnected(warnid))
        return SendClientMessage(playerid,COLOR_RED,"Nobody is connected with this ID!");
    new
        str[128],
        Name[24];

    if(Player[warnID][Warnings] <= 2)
    {
        GetPlayerName(warnid,Name,24);
        format(str,sizeof(str), "**(ADMIN WARN)** %s(%d) %s",Name, warnID, Reason);
        SendClientMessageToAll(COLOR_RED, str);
        format(str,sizeof(str), "You Have Been WARNED By Admin For Reason: %s",Reason);
        SendClientMessage(warnID, COLOR_RED, str);
        format(str,sizeof(str), "You Have WARNED %s(%d) For Reason: %s",Name, warnID, Reason);
        SendClientMessage(playerid, COLOR_RED, str);
    {
    else
    {
        if(Player[warnID][Warnings] == 3)Kick(warnID);
        GetPlayerName(playerid,Name,24);
        format(str,sizeof(str), "**(ADMIN KICK)** %s(%d) To many admin warnings",Name, warnID);
        SendClientMessageToAll(COLOR_RED, str);
        format(str,sizeof(str), "You Have Been WARNED By Admin For Reason: To many admin warnings");// you have already kicked the player at this point so these 2 lines are useless.
        SendClientMessage(warnID, COLOR_RED, str);
        format(str,sizeof(str), "You Have WARNED %s(%d) For Reason: To many admin warnings",Name, warnID);
        SendClientMessage(playerid, COLOR_RED, str);
    }
    return 1;
}
Your else had no closing brace.
Reply


Messages In This Thread
help with this error! - by [MKD]Max - 22.01.2011, 05:12
Re: help with this error! - by Whitetiger - 22.01.2011, 05:25
Re: help with this error! - by [MKD]Max - 22.01.2011, 05:33
Re: help with this error! - by [MKD]Max - 22.01.2011, 05:40
Re: help with this error! - by iggy1 - 22.01.2011, 06:12
Re: help with this error! - by Lorenc_ - 22.01.2011, 06:14

Forum Jump:


Users browsing this thread: 1 Guest(s)