Raised This Month: $235 Target: $400
 58% 

Undefined symbol "id"


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
blAck.
Junior Member
Join Date: Jun 2018
Old 06-23-2018 , 08:27   Undefined symbol "id"
Reply With Quote #1

Why am I getting error message "undefined symbol 'id'" on this code?
Code:
if(get_user_flags(id) & ADMIN_CHAT)
blAck. is online now
DJ Tsunami
DJ Post Spammer
Join Date: Feb 2008
Old 06-23-2018 , 08:31   Re: Undefined symbol "id"
Reply With Quote #2

Because the variable 'id' doesn't exist.
__________________
DJ Tsunami is offline
blAck.
Junior Member
Join Date: Jun 2018
Old 06-23-2018 , 08:32   Re: Undefined symbol "id"
Reply With Quote #3

Quote:
Originally Posted by DJ Tsunami View Post
Because the variable 'id' doesn't exist.
So what should I do?
blAck. is online now
DJ Tsunami
DJ Post Spammer
Join Date: Feb 2008
Old 06-23-2018 , 08:44   Re: Undefined symbol "id"
Reply With Quote #4

You should create that variable and assign the client index. Since you only posted one line of code, I don't know where the client index is supposed to come from.
__________________

Last edited by DJ Tsunami; 06-23-2018 at 08:44.
DJ Tsunami is offline
Rohanlogs
Senior Member
Join Date: Nov 2015
Old 06-23-2018 , 11:38   Re: Undefined symbol "id"
Reply With Quote #5

Tsunami gave you a perfect answer but if you don't know what a client index is then show us the whole function and we can fix it for you.
Also, this is the Sourcemod section, only SourcePawn is related here.
That's one of AMXX core functions so I'm assuming that's Pawn language which should be posted in the AMXX scripting section.
__________________
Rohanlogs is offline
Natsheh
Veteran Member
Join Date: Sep 2012
Location: Muslim and proud!
Old 06-23-2018 , 18:22   Re: Undefined symbol "id"
Reply With Quote #6

Quote:
Originally Posted by Rohanlogs View Post
Tsunami gave you a perfect answer but if you don't know what a client index is then show us the whole function and we can fix it for you.
Also, this is the Sourcemod section, only SourcePawn is related here.
That's one of AMXX core functions so I'm assuming that's Pawn language which should be posted in the AMXX scripting section.
You are on the wrong section.
__________________
@Jailbreak API MODE 100% done !
@User Tag Prefix 100% done !
@Mystery Box 100% done !

@Arena Mod 90% done !


Donate for more
Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
Rohanlogs
Senior Member
Join Date: Nov 2015
Old 06-23-2018 , 18:40   Re: Undefined symbol "id"
Reply With Quote #7

Quote:
Originally Posted by Natsheh View Post
You are on the wrong section.
I wasn't. This was originally posted in the SourceMod section.
__________________
Rohanlogs is offline
DJ Tsunami
DJ Post Spammer
Join Date: Feb 2008
Old 06-24-2018 , 03:09   Re: Undefined symbol "id"
Reply With Quote #8

Here's the code that he PM'ed me. Apparently he's new to coding.

PHP Code:
public plugin_init()
{
    
register_plugin("blAck-pack""1.0""blAck.")
    
    new 
flags get_user_flags(id)
    
    if(
flags ADMIN_CHAT)
    {
        
register_clcmd("say /apravila","apravila_motd")
        
register_clcmd("say_team /apravila","apravila_motd")
    }
    else    
    { 
I don't know if he needs to use client_authorized or if AMXX has another post admin check forward.
__________________

Last edited by DJ Tsunami; 06-24-2018 at 03:10.
DJ Tsunami is offline
Ghosted
Senior Member
Join Date: Apr 2015
Location: Georgia
Old 06-24-2018 , 03:42   Re: Undefined symbol "id"
Reply With Quote #9

I was scripting like this when i started coding first time
__________________
|||||||||||||||||||||||||
Donate
CSWM

Ghosted is offline
Send a message via Skype™ to Ghosted
instinctpt1
Senior Member
Join Date: Dec 2016
Location: Rajasthan, India
Old 06-24-2018 , 06:33   Re: Undefined symbol "id"
Reply With Quote #10

PHP Code:
// INCLUDE Amxmodx and amxmisc here

public plugin_init()
{
   
// register plugin here
   
register_clcmd("say /apravila""apravila_motd"ADMIN_CHAT )
}

public 
apravila_motd(id,lvl,cid)
{
   if(!
cmd_access(id,lvl,cid,0) return PLUGIN_HANDLED
   
   
// do your thing now
   

Wrote on phone sorry... Figure it out yourself
__________________
CSIndia The only Indian Scripters Community
instinctpt1 is offline
Reply


Thread Tools
Display Modes

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 10:19.


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