/kick wont work?
#1

if(strcmp(cmd, "/kick", true) == 0) {
if(PlayerInfo[playerid][Level] >= 1) {
new tmp[256];
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) {
SendClientMessage(playerid, red, "{FF0000}Usage: {AAAAAA} /kick [playerid] [reason]");
return 1; }
new player1;
player1 = strval(tmp);
if(!IsPlayerConnected(player1) || player1 == INVALID_PLAYER_ID || (PlayerInfo[player1][Level] == ServerInfo[MaxAdminLevel]) ) {
SendClientMessage(playerid,red,"{FF0000}ERROR: {AAAAAA}: Player is not connected or is yourself");
return 1; }
tmp = strtok(cmdtext, idx);

GetPlayerName(player1, playername, sizeof(playername)); GetPlayerName(playerid, adminname, sizeof(adminname));
CMDMessageToAdmins(playerid,"KICK");
format(string,256,"{FF0000} %s has been kicked by %s reason: %s ",playername,adminname,cmdtext[7]); SendClientMessageToAll(grey,string);
SaveToFile("KickLog",string); Kick(player1);
} else {
SendClientMessage(playerid,red,NO_PERM); }
return 1; }



whats the prblem?
Reply
#2

Do you get any output? Or after typing /kick nothing happens?
Reply
#3

It just says player is not connected or is yoursel and doesn't kick anyone
Reply
#4

have u compiled it after puting?
Reply
#5

pawn Код:
|| (PlayerInfo[player1][Level] == ServerInfo[MaxAdminLevel])
Are you sure about this part? try removing it.
Reply
#6

Yes compiled fine.
Reply
#7

Quote:
Originally Posted by Socan
Посмотреть сообщение
Yes compiled fine.
And it works in-game?
Reply
#8

First of all why don't you use PAWN tags,so we can see the code easier,and second of all,it's time to switch to a new command system,like ZCMD,it would be a lot easier EVEN FOR A NEWBIE to script a kick command using ZCMD rather than strcmp,and also sscanf iis easier than strtok.
Reply
#9

use sscanf
Reply
#10

Are you max level admin?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)