Need working /ban command with reason show - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Need working /ban command with reason show (
/showthread.php?tid=77463)
Need working /ban command with reason show -
Jakku - 11.05.2009
Now I use this ban command:
Код:
else if (streq(cmd,"/ban")) {
new id=GetId(playerid,rest);
if (id==INVALID_PLAYER_ID) return 1;
new ID = strval(cmdtext[6]);
new pName[24], str[64];
if(IsPlayerConnected(ID))
GetPlayerName(ID, pName, 24);
format(str, 64, "%s has been banned from the server for: %s", pName,rest);
SendClientMessageToAll(COLOR_ORED, str);
print("Player banned");
Ban(ID);
return 1;
}
This shows on NAME has been banned for: reason
Name always replaces the ID 0 name, if I kicked example ID 1
I've also tried this in my code:
Код:
else if(strcmp(cmdtext, "/ban", true, 5)==0)
{
if(!IsPlayerAdmin(playerid)) return 0;
if(!strlen(cmdtext[6]))
{
SendClientMessage(playerid, COLOR_ORED, "Usage: /ban [playerid] [reason]");
return 1;
}
new ID = strval(cmdtext[6]);
new pName[24], str[64];
if(IsPlayerConnected(ID))
{
GetPlayerName(ID, pName, 24);
format(str, 64, "%s has been banned from the server for: %s", pName,rest);
SendClientMessageToAll(COLOR_ORED, str);
print("Player banned");
Ban(ID);
}
return 1;
}
But this one appears many errors, what is wrong and could someone give me working version
Thanks
Re: Need good /ban command (Searched, not found good enough) -
member - 11.05.2009
You havn't told us what is 'good', what exactly do u want in the ban command?
Post the errors you get along with which line is which number. Alternatively, why not have a look at the admin filterscripts or the Useful Commands thread, there are some good ones there.
Re: Need working /ban command with reason show -
Jakku - 11.05.2009
I mean working with reason show