GTA-Center.com » Forum
http://www.gta-center.com/forums/

[HELP] Convertire da ZCMD a CMD
http://www.gta-center.com/forums/viewtopic.php?f=41&t=2475
Pagina 1 di 1

Autore:  TerminatOr [ 12/09/2012, 18:25 ]
Oggetto del messaggio:  [HELP] Convertire da ZCMD a CMD

Salve, ho un piccolo problemino :D... mi sono perso in un bicchiere d'acqua! Qualcuno di voi può convertire questi tre comandi da zcmd in cmd ( comandi standard di pawno) ?

Codice:
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;
}

COMMAND:unbanbyip(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(isnull(params) || strlen(params) > MAX_PLAYER_IP) return SendClientMessage(playerid, COLOR_RED, "[SAMP-BANS]: Correct usage -> /unbanbyip <ip address>");

   format(post_string, sizeof(post_string), "action=remip&apikey="#APIKEY"&ban_ip=%s", params);

   HTTP(playerid, HTTP_POST, APIPATH, post_string, "OnRemoveResponse");
   return 1;
}

COMMAND:unbanbyname(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(isnull(params) || strlen(params) > MAX_PLAYER_NAME) return SendClientMessage(playerid, COLOR_RED, "[SAMP-BANS]: Correct usage -> /unbanbyname <name>");

   format(post_string, sizeof(post_string), "action=remname&apikey="#APIKEY"&ban_name=%s&expired=true", params);

   HTTP(playerid, HTTP_POST, APIPATH, post_string, "OnRemoveResponse");
   return 1;
}

Pagina 1 di 1 Tutti gli orari sono UTC + 1 ora [ ora legale ]
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/