LuxAdmin And Samp-Bans into one..??
#7

Quote:
Originally Posted by iPLEOMAX
Посмотреть сообщение
I didn't 'use' LuxAdmin or SA-MP bans Yet, just seen them. But I guess these ideas could help you out a bit:


- Copy the samp ban FS into Lux.

- Convert the ban commands of the FS into a function:

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

pawn Код:
stock SampBan(ban_target, ban_time, ban_reason)
{
    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);
}
Similarly convert the other commands and remove unnecessary variables.

- Now in the /ban command of LuxAdmin, add this: SampBan(targetid, time/*0 if permanent*/, reason);

- And Copy the OnPlayerConnect functions on the FS into LuxAdmin OnPlayerConnect.
Gives me
pawn Код:
E:\vyom\My Pen Drive\GTA San Andreas\my new stunt server(upgraded)\filterscripts\LuxAdmin.pwn(5216) : error 017: undefined symbol "targetid"
E:\vyom\My Pen Drive\GTA San Andreas\my new stunt server(upgraded)\filterscripts\LuxAdmin.pwn(12279) : warning 219: local variable "ban_target" shadows a variable at a preceding level
E:\vyom\My Pen Drive\GTA San Andreas\my new stunt server(upgraded)\filterscripts\LuxAdmin.pwn(12279) : warning 219: local variable "ban_time" shadows a variable at a preceding level
E:\vyom\My Pen Drive\GTA San Andreas\my new stunt server(upgraded)\filterscripts\LuxAdmin.pwn(12279) : warning 219: local variable "ban_reason" shadows a variable at a preceding level
E:\vyom\My Pen Drive\GTA San Andreas\my new stunt server(upgraded)\filterscripts\LuxAdmin.pwn(12281) : error 017: undefined symbol "playerid"
E:\vyom\My Pen Drive\GTA San Andreas\my new stunt server(upgraded)\filterscripts\LuxAdmin.pwn(12283) : error 017: undefined symbol "playerid"
E:\vyom\My Pen Drive\GTA San Andreas\my new stunt server(upgraded)\filterscripts\LuxAdmin.pwn(12592) : warning 203: symbol is never used: "ban_reason"
E:\vyom\My Pen Drive\GTA San Andreas\my new stunt server(upgraded)\filterscripts\LuxAdmin.pwn(12592) : warning 203: symbol is never used: "ban_target"
E:\vyom\My Pen Drive\GTA San Andreas\my new stunt server(upgraded)\filterscripts\LuxAdmin.pwn(12592) : warning 203: symbol is never used: "ban_time"
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


3 Errors.
Reply


Messages In This Thread
LuxAdmin And Samp-Bans into one..?? - by Ronaldo_raul™ - 29.08.2011, 14:31
Re: LuxAdmin And Samp-Bans into one..?? - by [MWR]Blood - 29.08.2011, 14:41
Re: LuxAdmin And Samp-Bans into one..?? - by Ronaldo_raul™ - 29.08.2011, 15:06
Re: LuxAdmin And Samp-Bans into one..?? - by [MWR]Blood - 29.08.2011, 15:16
Re: LuxAdmin And Samp-Bans into one..?? - by Ronaldo_raul™ - 29.08.2011, 15:24
Re: LuxAdmin And Samp-Bans into one..?? - by iPLEOMAX - 29.08.2011, 18:14
Re: LuxAdmin And Samp-Bans into one..?? - by Ronaldo_raul™ - 29.08.2011, 18:24
Re: LuxAdmin And Samp-Bans into one..?? - by iPLEOMAX - 29.08.2011, 18:33

Forum Jump:


Users browsing this thread: 2 Guest(s)