02.04.2019, 21:37
(
Last edited by Mondialw98; 03/04/2019 at 09:28 AM.
)
Hello, when i try to ban/kick someoane is showing me "/Ban or /kick : you are not an admin".
Here is my command:
Please help me .
I want to said that the problem is on all gamemodes then i used on all probality is one script or someting wrong!
Sorry for my englich but i need help!
Here is my command:
Code:
CMD:ban(playerid, params[]) { if(gPlayerLogged[playerid] == 0) return SendClientMessage(playerid, COLOR_LIGHTRED, "You need to log in first."); if(IsPlayerConnected(playerid)) { if (PlayerInfo[playerid][pAdmin] >= 1) { new id,reason[128],reasone[128],string[200],giveplayer[30],sendername[30],days,str[1400],playerip[16],year,month,day,hour,minute,second,time; if(sscanf(params, "uds[128]", id,days,reason)) return SCM(playerid, COLOR_GREY, "Syntax:{FFFFFF} /ban [name/playerid] [days/0=permanent] [reason]"); if(days < 0) return SCM(playerid, COLOR_GREY, "Syntax:{FFFFFF} /ban [name/playerid] [days/0=permanent] [reason]"); mysql_real_escape_string(reason, reasone); if(IsPlayerConnected(id)) { if(id != INVALID_PLAYER_ID) { getdate(year, month, day); gettime(hour, minute, second); GetPlayerName(id, giveplayer, sizeof(giveplayer)); GetPlayerName(playerid, sendername, sizeof(sendername)); GetPlayerIp(id, playerip, sizeof(playerip)); if(PlayerInfo[id][pAdmin] >= PlayerInfo[playerid][pAdmin]) { new gString1[256]; format(gString1, sizeof(gString1), "{f03337}AdmWarning:{FFFFFF} %s a incercat sa-l baneze pe %s, motiv: %s", PlayerInfo[playerid][pNormalName], PlayerInfo[id][pNormalName], reason ); ABroadCast(-1, gString1, 1); return 1; } if(days == 0) { format(string,sizeof(string),"Ban: %s has been permanent banned by %s, reason: %s.",giveplayer,sendername,reasone); if(strfind(reason, "silent", true) != -1) { ABroadCast(COLOR_LIGHTRED, "Silent ban:", 1); ABroadCast(COLOR_LIGHTRED, string, 1); } else { SendClientMessageToAll(COLOR_LIGHTRED, string); } if(gPlayerLogged[id] == 0) { mysql_format(SQL,str,sizeof(str),"INSERT INTO bans (PlayerName, AdminName, Reason, IP, Days, IPBan, Permanent, Active, Time) VALUES('%s', '%s', '%s', '%s', 0, 0, 1, 1, 0)", giveplayer,PlayerInfo[playerid][pNormalName],reasone,playerip); } else { mysql_format(SQL,str,sizeof(str),"INSERT INTO bans (PlayerName, AdminName, Reason, IP, Days, IPBan, Permanent, Active, Time) VALUES('%s', '%s', '%s', '%s', 0, 0, 1, 1, 0)", PlayerInfo[id][pNormalName],PlayerInfo[playerid][pNormalName],reasone,playerip); } mysql_tquery(SQL,str,"",""); new var100[256]; mysql_format(SQL, var100, sizeof(var100), "INSERT INTO punishlogs (`playerid`,`giverid`,`actionid`,`actiontime`,`reason`,`playername`,`givername`,`unixtime`) VALUES ('%d','%d','1','0','%s','%s','%s','%d')", PlayerInfo[id][pSQLID],PlayerInfo[playerid][pSQLID],reasone,giveplayer,sendername,gettime()); mysql_tquery(SQL,var100,"",""); KickEx(id); } if(days > 0) { time = gettime() + (days*86400); format(string,sizeof(string),"Ban: %s has been banned by %s for %d days, reason: %s.",giveplayer,sendername,days,reasone); if(strfind(reason, "silent", true) != -1) { ABroadCast(COLOR_LIGHTRED, string, 1); } else { SendClientMessageToAll(COLOR_LIGHTRED, string); } if(gPlayerLogged[id] == 0) { mysql_format(SQL,str,sizeof(str),"INSERT INTO bans (PlayerName, AdminName, Reason, IP, Days, IPBan, Permanent, Active, Time) VALUES('%s', '%s', '%s', '%s', %d, 0, 0, 1, %d)", giveplayer,PlayerInfo[playerid][pNormalName],reasone,playerip,days,time); } else { mysql_format(SQL,str,sizeof(str),"INSERT INTO bans (PlayerName, AdminName, Reason, IP, Days, IPBan, Permanent, Active, Time) VALUES('%s', '%s', '%s', '%s', %d, 0, 0, 1, %d)", PlayerInfo[id][pNormalName],PlayerInfo[playerid][pNormalName],reasone,playerip,days,time); } mysql_tquery(SQL,str,"",""); new var100[256]; mysql_format(SQL, var100, sizeof(var100), "INSERT INTO punishlogs (`playerid`,`giverid`,`actionid`,`actiontime`,`reason`,`playername`,`givername`,`unixtime`) VALUES ('%d','%d','2','%d','%s','%s','%s','%d')", PlayerInfo[id][pSQLID],PlayerInfo[playerid][pSQLID],days,reasone,giveplayer,sendername,gettime()); mysql_tquery(SQL,var100,"",""); KickEx(id); } } } else return SendClientMessage(playerid, COLOR_GREY, "Player not connected."); } else return SendClientMessage(playerid, COLOR_LIGHTGREEN3, AdminOnly); } return 1;
I want to said that the problem is on all gamemodes then i used on all probality is one script or someting wrong!
Sorry for my englich but i need help!