Raised This Month: $ Target: $400
 0% 

Need Help


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
sea$oned pRo
New Member
Join Date: Sep 2008
Old 09-11-2008 , 19:39   Need Help
Reply With Quote #1

I am doing an alltalk status script. I did this about 2 years ago and had it working, however i forgot how. my current script is not working.

code
Code:
17  public handle_say(id) {
18     new said[192]
19      read_args(said, 192)
20      if ( (containi(said, "alltalk") != -1 && ( containi(said, "on") != -1 ) || 21        (  containi(said, "alltalk") != -1 && (containi(said, "off") != -1 ) || 22        contain(said, "/alltalk") != -1 ) ) )
23          set_task(0.1, "print_allTalk", id)
24               return PLUGIN_CONTINUE
25    
26  }
27  public print_allTalk(user) 
28  {
29      new alltalkStatus[256], authid[32]
30      new cvarnum, len, id
31    
32      get_user_authid(id, authid, 31)
33          if(is_user_admin(id))
34              if(get_cvar_num(sv_alltalk[cvarnum])==1)
35            {
36              format(alltalkStatus, 255, "%s All Talk: ON %s", COLOR]
37              }
38              else
39              {
40              format(alltalkStatus, 255, "%s All Talk: ON %s", COLOR]
41              }
42          else
43             
44              {
45              format(alltalkStatus, 255, "%s All Talk: Off %s", COLOR]
46              }
47              else
48              format(alltalkStatus, 255, "%s All Talk: Off %s", COLOR]
error
Code:
alltalkstatus.sma(32) : error 017: undefined symbole "sv_alltalk"
alltalkstatus.sma(32) : error 001: expected token: ";", but found "]"
alltalkstatus.sma(32) : error 029: invalid expression, assumed zero.
sea$oned pRo is offline
FeuerSturm
AlliedModders Donor
Join Date: Apr 2004
Old 09-12-2008 , 00:56   Re: Need Help
Reply With Quote #2

Looks like you're in the wrong section, buddy, this is for SourceMod
scripting help.

Anyways:

PHP Code:
public print_allTalk(id
{
 new 
alltalkStatus[256]
 if(
is_user_admin(id))
 {
  if(
get_cvar_num("sv_alltalk") == 1)
  {
   
format(alltalkStatus255"%s All Talk: ON %s"COLOR]
  }
  else
  {
   
format(alltalkStatus255"%s All Talk: Off %s"COLOR]
  }
  
//show the message and do other stuff here
 
}
 return 
Plugin_Handled

hope that helps

Last edited by FeuerSturm; 09-12-2008 at 00:59. Reason: using [php] tags instead of [code] looks better :)
FeuerSturm is offline
sea$oned pRo
New Member
Join Date: Sep 2008
Old 09-12-2008 , 20:19   Re: Need Help
Reply With Quote #3

Sorry for the miss-post. I used your code, and added my display, this is what I am using now.

PHP Code:
public print_allTalk(id
{
 new 
alltalkStatus[256]
 if(
is_user_admin(id))
 {
  if(
get_cvar_num("sv_alltalk") == 1)
  {
 
format(alltalkStatus255"%s All Talk: ON %s"COLOR)
    
  }
  else
  {
 
format(alltalkStatus255"%s All Talk: Off %s"COLOR) <-- Line 38

  
}
  
client_print(id255alltalkStatus)
 }
 return 
PLUGIN_HANDLED

It compiles great, but in game when i use the command, I get this error:
PHP Code:
17:06:59"sea$oned pRo<1><STEAM_0><CT>" say "/alltalk"
L 09/12/2008 17:06:59String formatted incorrectly parameter 5 (total 4)
L 09/12/2008 17:06:59: [AMXXDisplaying debug trace (plugin "alltalk.amxx")
L 09/12/2008 17:06:59: [AMXXRun time error 25parameter error 
L 09
/12/2008 17:06:59: [AMXX]    [0alltalk.sma::print_allTalk (line 38
Any suggestions?
sea$oned pRo is offline
FeuerSturm
AlliedModders Donor
Join Date: Apr 2004
Old 09-13-2008 , 07:06   Re: Need Help
Reply With Quote #4

Quote:
Originally Posted by sea$oned pRo View Post
Sorry for the miss-post. I used your code, and added my display, this is what I am using now.

PHP Code:
public print_allTalk(id
{
 new 
alltalkStatus[256]
 if(
is_user_admin(id))
 {
  if(
get_cvar_num("sv_alltalk") == 1)
  {
 
format(alltalkStatus255"%s All Talk: ON %s"COLOR)
 
  }
  else
  {
 
format(alltalkStatus255"%s All Talk: Off %s"COLOR) <-- Line 38
 
  
}
  
client_print(id255alltalkStatus)
 }
 return 
PLUGIN_HANDLED

It compiles great, but in game when i use the command, I get this error:
PHP Code:
17:06:59"sea$oned pRo<1><STEAM_0><CT>" say "/alltalk"
L 09/12/2008 17:06:59String formatted incorrectly parameter 5 (total 4)
L 09/12/2008 17:06:59: [AMXXDisplaying debug trace (plugin "alltalk.amxx")
L 09/12/2008 17:06:59: [AMXXRun time error 25parameter error 
L 09
/12/2008 17:06:59: [AMXX]    [0alltalk.sma::print_allTalk (line 38
Any suggestions?
Yes, i don't know what "COLOR" is that you're using, so showing the
complete source code would help me to help you
FeuerSturm is offline
curlefry
Senior Member
Join Date: Jun 2008
Location: Georgia, USA
Old 09-13-2008 , 17:29   Re: Need Help
Reply With Quote #5

I'm no good in SourcePawn, but I have one idea I wish for you to consider as a last resort. (I wish the best for ya, though.)

Check out DJ Tsunami's Advertisements plugin:

Advertisements

He's been creative enough to add the BOOL option for boolean cvars such as sv_alltalk. What I did for my server was added a quick chat message like so, in advertisements.txt:


Code:
    {
        "type"        "S"
        "text"        "Alltalk Status: {GREEN}{BOOL:SV_ALLTALK}"
    }
__________________
curlefry is offline
Send a message via MSN to curlefry
Lebson506th
Veteran Member
Join Date: Jul 2008
Old 09-13-2008 , 17:39   Re: Need Help
Reply With Quote #6

That is for SM, this code is for AMX X
__________________
My Plugins
Spray Tracer by Nican, maintained by me
Simple TK Manager
DoD:S Admin Weapons

Links
Resistance and Liberation (A HL2 Multiplayer Modification)
Lebson506th is offline
bl4nk
SourceMod Developer
Join Date: Jul 2007
Old 09-13-2008 , 17:50   Re: Need Help
Reply With Quote #7

You can find better help here.
bl4nk is offline
curlefry
Senior Member
Join Date: Jun 2008
Location: Georgia, USA
Old 09-13-2008 , 18:03   Re: Need Help
Reply With Quote #8

Quote:
Originally Posted by Lebson506th View Post
That is for SM, this code is for AMX X
Oopseh. Didn't realize I was in the wrong section.
__________________
curlefry is offline
Send a message via MSN to curlefry
YamiKaitou
Has a lovely bunch of coconuts
Join Date: Apr 2006
Location: Texas
Old 09-13-2008 , 18:15   Re: Need Help
Reply With Quote #9

You need another parameter in the format command. Or remove one of the %s


As per the Global Forum Rules, you need to have a descriptive topic title. If you wish for this topic to stay open, please correct the topic title before you post again.
__________________
ProjectYami Laboratories

I do not browse the forums regularly anymore. If you need me for anything (asking questions or anything else), then PM me (be descriptive in your PM, message containing only a link to a thread will be ignored).
YamiKaitou 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 03:01.


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