my gamemode doesn't have /unban cmd
#1

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
Reply
#2

wat's ur save file name ? wer u save ur data ?
Reply
#3

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

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;
}
Reply
#5

ok bro i will try it !
Reply
#6

I dont use ycmd bro
Reply
#7

Use the search button.
https://sampforum.blast.hk/showthread.php?tid=388612
Reply
#8

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
Reply
#9

Try out this I scripted, It'll match the Stevo127's Game-Mode:
Also, give me credits if you're gonna use it.
pawn Код:
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;
}
Reply
#10

i will give you credits! but an error!

Код:
C:\Users\Ninard\Desktop\SFCNR\gamemodes\SFCRRPG.pwn(16951) : warning 203: symbol is never used: "dcmd_unban"
Pawn compiler 3.2.3664	 	 	Copyright © 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);
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)