SA-MP Forums Archive
Error when changing to KickWithMessage - 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: Error when changing to KickWithMessage (/showthread.php?tid=417946)



Error when changing to KickWithMessage - SiggaSvana - 23.02.2013

Hello, kicked/banned players dont see the reason, they just get Server Closed The Connection.

I know Im doing something wrong, but how can I fix it?

Quote:

error 035: argument type mismatch (argument 2)

Quote:

KickWithMessage(playerid, COLOUR_GREEN, "You have been kicked by %s (reason: %s)");

Thanks in advance.


Re: Error when changing to KickWithMessage - SilverKiller - 23.02.2013

pawn Код:
KickWithMessage(playerid, "Your kick message.");
And for the color, put it in the stock KickWithMessage like this

pawn Код:
SendClientMessage(playerid, COLOUR_GREEN, message); //note that colour green is the color you used in your first post,you can change it.
Note that this is an example, and you can change it!


Re: Error when changing to KickWithMessage - SiggaSvana - 23.02.2013

Many thanks for your quick reply!
What about the reason for kick?

Edit: Im just getting more and more errors Think I'll just back out of changing this :/


Re: Error when changing to KickWithMessage - RajatPawar - 23.02.2013

Something like this?
pawn Код:
CMD:kick(playerid, params[])
{
 new reason[40], target;
 if(sscanf(params, "us[40]", target, reason)) return SCM(playerid, -1, "USAGE: /kick player reason.");
 if(!IsPlayerConnected(target)) return SCM(playerid, -1, "Player not connected.");
 else
 {
 new str[128];
 format(str, 128, "You have been kicked for the reason: %s", reason);
 SendClientMessage(target, -1, str);
 SetTimerEx("kickdelay", 1000, 0, "d", target);
 return 1;
 }
}
forward public kickdelay(target);
public kickdelay(target)
{
 Kick(target);
return 1;
}



Re: Error when changing to KickWithMessage - SiggaSvana - 23.02.2013

Quote:
Originally Posted by Rajat_Pawar
Посмотреть сообщение
Something like this?
pawn Код:
CMD:kick(playerid, params[])
{
 new reason[40], target;
 if(sscanf(params, "us[40]", target, reason)) return SCM(playerid, -1, "USAGE: /kick player reason.");
 if(!IsPlayerConnected(target)) return SCM(playerid, -1, "Player not connected.");
 else
 {
 new str[128];
 format(str, 128, "You have been kicked for the reason: %s", reason);
 SendClientMessage(target, -1, str);
 SetTimerEx("kickdelay", 1000, 0, "d", target);
 return 1;
 }
}
forward public kickdelay(target);
public kickdelay(target)
{
 Kick(target);
return 1;
}
Is that 0.3x friendly?


Re: Error when changing to KickWithMessage - JaKe Elite - 23.02.2013

Yes.