PDA

View Full Version : my gamemode doesn't have /unban cmd


cleanboy
08/05/2014, 07:31 AM
hello, how can i add /unban cmd in my gamemode even the player is offline? coz my gm has no unban cmd, thats why i need to use filezilla everytime my friend got banned -_- and restart the server -_-

please help

rockhopper
08/05/2014, 07:37 AM
wat's ur save file name ? wer u save ur data ?

cleanboy
08/05/2014, 07:41 AM
on online hosting. triangle.gs thats why i need to use filezilla.. can you help? i want that cmd /unban even the player is offline..

rockhopper
08/05/2014, 08:01 AM
just try this
YCMD:unban(playerid, params[], help)
{
#pragma unused help
if(P_Data[playerid][pAdmin] < 4) return SCM(playerid, COLOR_RED, "You need to be admin level 4 to use this!");
new
name[48],string[64];
if(sscanf(params, "s[48]",name)) return SCM(playerid, COLOR_RED, "Usage: /unban [Player Name]");
format(string,sizeof(string),"%s.ini",name);
fremove(string);
SCM(playerid, COLOR_RED, "Player has been unbaned!");
SendRconCommand(string);
SendRconCommand("reloadbans");
return 1;
}

cleanboy
08/05/2014, 09:24 AM
ok bro i will try it !

cleanboy
08/05/2014, 12:03 PM
I dont use ycmd bro

gtakillerIV
08/05/2014, 12:16 PM
Use the search button.
http://forum.sa-mp.com/showthread.php?t=388612

cleanboy
10/05/2014, 01:50 AM
bro that link is tutorials on making a unban cmd, and it has something like stats file.. i already have those, i just need now is /unban cmd even the player is offline.. please help

Parallex
10/05/2014, 05:49 AM
Try out this I scripted, It'll match the Stevo127's Game-Mode:
Also, give me credits if you're gonna use it.

dcmd_unban(playerid, params[])
{
new string[128];
if(!strlen(params))
{
format(string, sizeof(string), "USAGE: /adunban (Full Player Name)");
SendClientMessage(playerid,COLOR_ERROR,string);
return 1;
}
if(!udb_Exists(params))
{
format(string, sizeof(string), "The player file %s is not found.",params);
SendClientMessage(playerid,COLOR_ERROR,string);
return 1;
}
format(string, sizeof(string), "unbanip %s", dUser(params).("IP"));
SendRconCommand(string);
format(string, sizeof(string), "reloadbans");
SendRconCommand(string);
new nameban = dUserINT(params).("Nameban");
if(nameban == 0)
{
format(string, sizeof(string), "{FFFFFF}The Player Name %s is not banned.", params);
SendClientMessage(playerid,COLOR_RED,string);
return 1;
}
dUserSetINT(params).("Nameban", 0);
format(string, sizeof(string), "{cccc00}[Admin] {ffffff}Administrator player {FF0033}%s {ffffff}has been unbanned.",params,PlayerName(playerid));
printf("%s", string);
SendClientMessage(playerid,COLOR_ADMIN,string);
format(string, sizeof(string), "9[ADMIN]Administrator has been unbanned %s",PlayerName(playerid),params);
IRC_GroupSay(gGroupID,IRC_CHANNEL,string);
return 1;
}

cleanboy
10/05/2014, 06:20 AM
i will give you credits! but an error!

C:\Users\Ninard\Desktop\SFCNR\gamemodes\SFCRRPG.pw n(16951) : warning 203: symbol is never used: "dcmd_unban"
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase


1 Warning.



[EDIT]: i added this to onplayertext something like that and it fix! i will try it if it can unban now!

dcmd(unban,5,cmdtext);

Parallex
10/05/2014, 06:22 AM
Go to
public OnPlayerCommandText(playerid, cmdtext[])
You would see commands like dcmd(commands,8,cmdtext); etc.
Under if(AdminLevel[playerid] == 1);
Put dcmd(unban,5,cmdtext);

cleanboy
10/05/2014, 06:39 AM
Man it works!!! i can unban him with fullname!! man +1000reps to you!!! :D thanks alot ! close this thread plz!

Parallex
10/05/2014, 06:42 AM
No problem. Just enjoy.
EDIT: You didn't even give a single rep, when you're saying 1000+ rep, lol.

cleanboy
10/05/2014, 06:47 AM
thank you again!! :D