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

Hello guys i am using Luxadmin as my admin script and i want to combine the codes of luxadmin and this Samp-bans code...so when i ban someone it would state a log in the ban logs in the luxadmin logs as well as it will also add a ban on the ban hosting site..!

Thank You For Your Time! I hope someone help me ..!

Regards,
Ronaldo_raul™
Reply
#2

You can copy the Samp bans FS into the luxadmin fs, replacing the ban command, but leaving the code that writes into the ban log.
Reply
#3

Quote:
Originally Posted by Delux13
Посмотреть сообщение
You can copy the Samp bans FS into the luxadmin fs, replacing the ban command, but leaving the code that writes into the ban log.
Lolz ...dude it tried hundred ways i got errors..! i really dont want my luxadmin to be messed up..!
Reply
#4

Maybe because you didn't include the mysql include.
You needs plugins too.
Reply
#5

Quote:
Originally Posted by Delux13
Посмотреть сообщение
Maybe because you didn't include the mysql include.
You needs plugins too.
dude it doesn't uses mysql..~!
Reply
#6

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.
Reply
#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
#8

As I said, you have to delete unnecessary variables.

(like the global ones, on top of script: ban_target, ban_time, ban_reason, not others btw);

The stock should look like: stock SampBan(playerid, ban_target, ban_time, ban_reason[]) which i forgot to mention before.

And change things accordingly, I can't predict everything perfectly.

and targetid should be something like otherplayerid, or the variable of playerid who is getting banned.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)