12.04.2011, 21:33
Hello, there is something wrong with my kick + ban command. When i attemp to kick/ban someone. Nothing happends. And the name gets really weird.
This is my codes
This is the kicklog:
When i kick my self, it gets like that.
It saves the kicks in the logs. But i dont get kicked at all.
And i dont know how to fix this.
Thanks, Alex
This is my codes
pawn Код:
CMD:kick(playerid,params[])
{
new id,reason;
if(PlayerInfo[playerid][pAdminLevel] < 1) return SendClientMessage(playerid,COLOR_RED,"You've To Be Admin To Use This Command");
else if(sscanf(params,"us",id,reason)) return SendClientMessage(playerid,COLOR_RED,"Usage : /kick [playerid] [Reason]");
else if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid,COLOR_RED,"Player Doesn't Exist");
else
{
new pName[24],name[24];
GetPlayerName(playerid,pName,24);
GetPlayerName(id,name,24);
new string[128];
format(string,128,"You've Kicked %s ,, Reason : %s",name,reason);
SendClientMessage(playerid,COLOR_YELLOW,string);
format(string,128,"You've Been Kicked By %s ,, Reason : %s",pName,reason);
SendClientMessage(id,COLOR_RED,string);
format(string,128,"Admin %s Kicked %s ,, Reason : %s",pName,id,reason);
SendClientMessageToAll(COLOR_YELLOW,string);
Kick(id);
format(string,sizeof(string),"%s Kicked %s ,, Reason : %s",pName,name,reason);
SaveIn("KickLog.txt",string);
}
return 1;
}
CMD:ban(playerid,params[])
{
new id,reason;
if(PlayerInfo[playerid][pAdminLevel] < 1) return SendClientMessage(playerid,COLOR_RED,"You've To Be Admin To Use This Command");
else if(sscanf(params,"us",id,reason)) return SendClientMessage(playerid,COLOR_RED,"Usage : /ban [playerid] [Reason]");
else if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid,COLOR_RED,"Player Doesn't Exist");
else
{
new pName[24],name[24];
GetPlayerName(playerid,pName,24);
GetPlayerName(id,name,24);
new string[128];
format(string,128,"You've Banned %s ,, Reason : %s",name,reason);
SendClientMessage(playerid,COLOR_YELLOW,string);
format(string,128,"You've Been Banned By %s ,, Reason : %s",pName,reason);
SendClientMessage(id,COLOR_RED,string);
format(string,128,"Admin %s Banned %s ,, Reason : %s",pName,id,reason);
SendClientMessageToAll(COLOR_YELLOW,string);
Ban(id);
format(string,sizeof(string),"%s Banned %s ,, Reason : %s",pName,name,reason);
SaveIn("BanLog.txt",string);
}
return 1;
}
Код:
AlexzzPro Kicked ,, Reason : test
It saves the kicks in the logs. But i dont get kicked at all.
And i dont know how to fix this.
Thanks, Alex