[Include] [INC]Simple Reason Include[Good for kick and ban] - 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: Filterscripts (
https://sampforum.blast.hk/forumdisplay.php?fid=17)
+---- Forum: Includes (
https://sampforum.blast.hk/forumdisplay.php?fid=83)
+---- Thread: [Include] [INC]Simple Reason Include[Good for kick and ban] (
/showthread.php?tid=66946)
[INC]Simple Reason Include[Good for kick and ban] -
Jonte92 - 25.02.2009
REMOVED
Re: Simple Reason Include[Good for kick and ban] -
FUNExtreme - 25.02.2009
You could already give a sentence as reason.
Anyway nice work.
Re: Simple Reason Include[Good for kick and ban] -
Jonte92 - 25.02.2009
Quote:
Originally Posted by FUNExtreme
You could already give a sentence as reason.
|
Yeah but now it's as simple as
pawn Code:
new Reason[155];
Reason = reason(cmdtext, idx);
And it's done
Quote:
Originally Posted by FUNExtreme
Anyway nice work.
|
Thanks
Re: [INC]Simple Reason Include[Good for kick and ban] -
James_Alex - 23.05.2009
nice one
Re: [INC]Simple Reason Include[Good for kick and ban] -
Google63 - 23.05.2009
max i/o is 128 cells .. please read y_less post so you will catch way
trycatch
{ }
Re: [INC]Simple Reason Include[Good for kick and ban] -
Weirdosport - 23.05.2009
If you were to use SSCANF you wouldn't have to worry about the reason being a word long, as you could use "z", which would catch all the words and make the reason optional. But if you insist on using strtok I guess this works
Re: [INC]Simple Reason Include[Good for kick and ban] - Double-O-Seven - 23.05.2009
Why do people always get reason with complicated functions!?
It's that easy:
pawn Code:
new cmd[32],tmp[32],idx;
if(!strcmp(cmd,"/kick",true) && IsPlayerAdmin(playerid))
{
tmp=strtok(cmdtext,idx);
new id=strval(tmp); // or ReturnUser(tmp);
if(!IsPlayerConnected(id) || id==playerid || !cmdtext[idx])
return SendClientMessage(playerid,0xFF0000FF,"Usage: /KICK <ID> <REASON>");
new string[128];
GetPlayerName(id,string,sizeof(string));
format(string,sizeof(string),"*** %s has been kicked. (Reason: %s)",string,cmdtext[idx]);
SendClientMessageToAll(0xFF0000FF,string);
Kick(id);
return 1;
}
Re: [INC]Simple Reason Include[Good for kick and ban] -
Google63 - 23.05.2009
Here maximal reason ever can be long > 128(max i/o) - (5 + ( /kick + null ) + 3 ( 200 players )) = 120 cells...