KICK/BAN problem
#1

I have problems with SCMs.. When I kick/ban myself, or the player that was kicked, I/he doesn't receive any msg. He should se the SCMToAll because I putted it, but it only says "Server closed connection.", here is pic. http://www.zaslike.com/viewer.php?fi...99gyqyxyq2.png
Here are commands.
Код:
CMD:ban(playerid, params[])
{
	new id, razlog[32], str[128];
	if(PlayerInfo[playerid][pAdmin] < 3) return SCM(playerid, Crvena, "Niste ovlasceni.");
	if(sscanf(params,"us[32]",id,razlog)) return SendClientMessage(playerid, -1, "{FF8040}CMD: {80FFFF}/ban [Id igraca/deo imena] [razlog]");
	format(str, sizeof(str), "SERVER: Admin %s je banao %s, razlog: %s.", GetName(playerid), GetName(id), razlog);
	SendClientMessageToAll(Crvena, razlog);
	new banfile[64];
	format(banfile,64,BanFolder,GetName(id));
	new File:ban = fopen(banfile, io_write);
	fwrite(ban, " - BAN - \n");
	new var[128]; format(var,64,"Admin = %s\n", GetName(playerid));
	fwrite(ban,var);
	format(var,128,"Razlog = %s\n", razlog);
	fwrite(ban,var);
	fclose(ban);
	Kick(id);
	return 1;
}


CMD:kick(playerid, params[])
{
	new igr, rzl[40], str[300];
	if(PlayerInfo[playerid][pAdmin] < 1) return SCM(playerid, Crvena, "Niste ovlasceni.");
	if(sscanf(params, "us[40]", igr, rzl)) return SendClientMessage(playerid, COLOR_GRAD2, "{FF8040}CMD: {80FFFF}/kick [Id igraca/deo imena] [razlog]");
	format(str, sizeof(str), "SERVER: Admin %s je kikao %s, razlog: %s.", GetName(playerid), GetName(igr), rzl);
	SendClientMessageToAll(Crvena, rzl);
	Kick(igr);
	return 1;
}
But there is another problem.. This SCMToAll is sent, but only reason, (rzl)... Here is the pic. http://www.zaslike.com/viewer.php?fi...dvaiztqtwo.png
Reply
#2

Set a timer for the ban/kick for a second. So they get the message and it kicks/bans them a second later.
Reply
#3

Solved, thanks..
Reply
#4

about the second problem:
pawn Код:
CMD:kick(playerid, params[])
{
    new igr, rzl[40], str[300], admin[MAX_PLAYER_NAME], kicked[MAX_PLAYER_NAME];
       if(PlayerInfo[playerid][pAdmin] < 1) return SCM(playerid, Crvena, "Niste ovlasceni.");
       GetPlayerName(playerid, admin, MAX_PLAYER_NAME);
       GetPlayerName(igr, kicked, MAX_PLAYER_NAME);
       if(sscanf(params, "us[40]", igr, rzl)) return SendClientMessage(playerid, COLOR_GRAD2, "{FF8040}CMD: {80FFFF}/kick [Id igraca/deo imena] [razlog]");
       format(str, sizeof(str), "SERVER: Admin %s je kikao %s, razlog: %s.", admin, kicked, rzl);
       SendClientMessageToAll(Crvena, rzl);
       Kick(igr);
return 1;
}
Reply
#5

Same problem appears..
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)