[Help me] Command problem
#1

I have a problem by converting zcmd to strcmp. Some one convert this command to strcmp with no Rcon login call. just simple "if (PlayerInfo[playerid][pAdmin] >= 1)" and that inform all players that player got ban like this "format(string, sizeof(string), "AdmCmd: %s was banned by %s, reason: %s".

here is the command:

pawn Код:
COMMAND:ban(playerid, params[])
{
    if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, COLOR_RED, "[SAMP-BANS]: You need to be logged in as an RCON administrator to perform this!");
    if(sscanf(params, "uis", ban_target, ban_time, ban_reason)) return SendClientMessage(playerid, COLOR_RED, "[SAMP-BAN]: Correct usage -> /ban <player> <time (minutes)> <reason>");
    if(!IsPlayerConnected(ban_target)) return SendClientMessage(playerid, COLOR_RED, "[SAMP-BANS]: Player was not found!");
    if(ban_time < 0) SendClientMessage(playerid, COLOR_RED, "[SAMP-BANS]: Please input a valid ban time!");

    format(post_string, sizeof(post_string), "action=addban&apikey="#APIKEY"&ban_user=%s&ban_reason=%s&ban_admin=%s&ban_ip=%s&ban_time=%d",names[ban_target], ban_reason, names[playerid], ips[ban_target], ban_time);

    HTTP(playerid, HTTP_POST, APIPATH, post_string, "OnBanResponse");

    Kick(ban_target);
    return 1;
}
Reply


Messages In This Thread
[Help me] Command problem - by umarmalik - 21.07.2012, 18:46

Forum Jump:


Users browsing this thread: 1 Guest(s)