Raised This Month: $ Target: $400
 0% 

A ban question


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Liniarian
Member
Join Date: Jul 2009
Old 12-06-2009 , 10:18   A ban question
Reply With Quote #1

Can anyone show me the mistake in here? Cause I cannot find the mistake

Code:
#include <sourcemod>
#include <sdktools>
public OnPluginStart()
{
 RegConsoleCmd("ban", Command_Ban)
}
Ban(client, target, time, reason)
{
 new String:name1[70]
 new String:name2[70]
 GetClientName(client, name1, sizeof(name1))
 GetClientName(target, name2, sizeof(name2))
 PrintToChatAll("\x04%s \x03has banned \x04%s", name1, name2)
 BanClient(target, time, BANFLAG_AUTO, reason, "Banned by moderator")
}
public Action:Command_Ban(client, args)
{
 new String:arg1[70] 
 new String:time[70]
 new String:reason[100]
 new String:argumants[120]
 GetCmdArgString(argumants, sizeof(argumants))
 GetCmdArg(1, arg1, sizeof(arg1))
 GetCmdArg(2, time, sizeof(time))
 new String:target = FindTarget(client, arg1, false, true)
 SplitString(argumants, time, reason, sizeof(reason))
 Ban(client, target, time, reason)
 
 return Plugin_Handled
}

Last edited by Liniarian; 12-06-2009 at 10:34.
Liniarian is offline
Bigbuck
Senior Member
Join Date: Jul 2009
Old 12-06-2009 , 10:34   Re: A ban question
Reply With Quote #2

You have a typo. Here you are calling Command_WcsBan which doesn't exist and should actually be Command_Ban.

PHP Code:
RegConsoleCmd("ban"Command_WcsBanshould be RegConsoleCmd("ban"Command_Ban)


public 
Action:Command_Ban(clientargs
Bigbuck is offline
Liniarian
Member
Join Date: Jul 2009
Old 12-06-2009 , 10:59   Re: A ban question
Reply With Quote #3

actually , thats cause i modified the original command to post it here

was originally sad Wcsban, but i mean, the error which he sas during compile is in BanClient and the SplitString section, and the Ban command in the public

Thanks for help
Liniarian is offline
Liniarian
Member
Join Date: Jul 2009
Old 12-07-2009 , 00:03   Re: A ban question
Reply With Quote #4

anyone knows where prob is?

Thanks for help
Liniarian is offline
bl4nk
SourceMod Developer
Join Date: Jul 2007
Old 12-07-2009 , 00:28   Re: A ban question
Reply With Quote #5

Code:
new String:target = FindTarget(client, arg1, false, true)
That shouldn't be a string.
bl4nk is offline
Liniarian
Member
Join Date: Jul 2009
Old 12-07-2009 , 08:44   Re: A ban question
Reply With Quote #6

When trieing to compile he sas theres an error in the BanClient cmd, dont know which

Thanks for help
Liniarian is offline
pheadxdll
AlliedModders Donor
Join Date: Jun 2008
Old 12-07-2009 , 12:24   Re: A ban question
Reply With Quote #7

Code:
Ban(client, target, time, const String:reason[])
You need to init reason as a string, try that.
pheadxdll is offline
Liniarian
Member
Join Date: Jul 2009
Old 12-07-2009 , 14:11   Re: A ban question
Reply With Quote #8

Quote:
Originally Posted by pheadxdll View Post
Code:
Ban(client, target, time, const String:reason[])
You need to init reason as a string, try that.
Thanks, solved 1 problem

But now he sas theres an argumant mismatch in the SplitString cmd, dot know which argumant he means

Any idea where error in SplitString is?

Thanks for help

Last edited by Liniarian; 12-08-2009 at 00:06.
Liniarian is offline
Liniarian
Member
Join Date: Jul 2009
Old 12-08-2009 , 10:39   Re: A ban question
Reply With Quote #9

Why doesnt when I getcmdarg 2 as time working in ban cmd? He sas argumant type mismatch

Thanks for help
Liniarian is offline
pheadxdll
AlliedModders Donor
Join Date: Jun 2008
Old 12-08-2009 , 11:16   Re: A ban question
Reply With Quote #10

Because for ban, the function wants an integer, try:

Ban(client, target, StringToInt(time), reason)

Target needs to be an integer too.
pheadxdll is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 06:13.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode