convert commands
#1

hello, who I convert these three commands zcmd in cmd ?
PHP код:
COMMAND:ban(playeridparams[])
{
    if(!
IsPlayerAdmin(playerid)) return SendClientMessage(playeridCOLOR_RED"[SAMP-BANS]: You need to be logged in as an RCON administrator to perform this!");
    if(
sscanf(params"uis"ban_targetban_timeban_reason)) return SendClientMessage(playeridCOLOR_RED"[SAMP-BAN]: Correct usage -> /ban <player> <time (minutes)> <reason>");
    if(!
IsPlayerConnected(ban_target)) return SendClientMessage(playeridCOLOR_RED"[SAMP-BANS]: Player was not found!");
    if(
ban_time 0SendClientMessage(playeridCOLOR_RED"[SAMP-BANS]: Please input a valid ban time!");
    
format(post_stringsizeof(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(playeridHTTP_POSTAPIPATHpost_string"OnBanResponse");
    
Kick(ban_target);
    return 
1;
}
COMMAND:unbanbyip(playeridparams[])
{
    if(!
IsPlayerAdmin(playerid)) return SendClientMessage(playeridCOLOR_RED"[SAMP-BANS]: You need to be logged in as an RCON administrator to perform this!");
    if(
isnull(params) || strlen(params) > MAX_PLAYER_IP) return SendClientMessage(playeridCOLOR_RED"[SAMP-BANS]: Correct usage -> /unbanbyip <ip address>");
    
format(post_stringsizeof(post_string), "action=remip&apikey="#APIKEY"&ban_ip=%s", params);
    
HTTP(playeridHTTP_POSTAPIPATHpost_string"OnRemoveResponse");
    return 
1;
}
COMMAND:unbanbyname(playeridparams[])
{
    if(!
IsPlayerAdmin(playerid)) return SendClientMessage(playeridCOLOR_RED"[SAMP-BANS]: You need to be logged in as an RCON administrator to perform this!");
    if(
isnull(params) || strlen(params) > MAX_PLAYER_NAME) return SendClientMessage(playeridCOLOR_RED"[SAMP-BANS]: Correct usage -> /unbanbyname <name>");
    
format(post_stringsizeof(post_string), "action=remname&apikey="#APIKEY"&ban_name=%s&expired=true", params);
    
HTTP(playeridHTTP_POSTAPIPATHpost_string"OnRemoveResponse");
    return 
1;

Reply


Messages In This Thread
convert commands - by Marc_Johnson - 13.09.2012, 10:36
AW: convert commands - by BiosMarcel - 13.09.2012, 11:42
Re: convert commands - by ViruZz - 13.09.2012, 12:44
Re: convert commands - by Marc_Johnson - 13.09.2012, 13:18
AW: convert commands - by BiosMarcel - 13.09.2012, 13:34
Re: convert commands - by mamorunl - 13.09.2012, 13:54
Re: convert commands - by Marc_Johnson - 13.09.2012, 16:44
Re: convert commands - by HyDrAtIc - 13.09.2012, 17:07
Re: convert commands - by Marc_Johnson - 13.09.2012, 17:17
AW: convert commands - by BiosMarcel - 13.09.2012, 17:18

Forum Jump:


Users browsing this thread: 1 Guest(s)