KICK/BAN problem - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: KICK/BAN problem (
/showthread.php?tid=424693)
KICK/BAN problem -
Vegas. - 23.03.2013
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
Re: KICK/BAN problem -
Joshman543 - 23.03.2013
Set a timer for the ban/kick for a second. So they get the message and it kicks/bans them a second later.
Re: KICK/BAN problem -
Vegas. - 23.03.2013
Solved, thanks..
Re: KICK/BAN problem -
HurtLocker - 23.03.2013
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;
}
Re: KICK/BAN problem -
Vegas. - 23.03.2013
Same problem appears..