Raised This Month: $12 Target: $400
 3% 

Solved Undefined symbol "id"


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
blAck.
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)

Last edited by blAck.; 08-05-2018 at 14:07.
blAck. is offline
DJ Tsunami
DJ Post Spammer
Join Date: Feb 2008
Location: The Netherlands
Old 06-23-2018 , 08:31   Re: Undefined symbol "id"
Reply With Quote #2

Because the variable 'id' doesn't exist.
__________________
Advertisements | REST in Pawn - HTTP client for JSON REST APIs
Please do not PM me with questions. Post in the plugin thread.
DJ Tsunami is offline
blAck.
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 offline
DJ Tsunami
DJ Post Spammer
Join Date: Feb 2008
Location: The Netherlands
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.
__________________
Advertisements | REST in Pawn - HTTP client for JSON REST APIs
Please do not PM me with questions. Post in the plugin thread.

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
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 Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !

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
Location: The Netherlands
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.
__________________
Advertisements | REST in Pawn - HTTP client for JSON REST APIs
Please do not PM me with questions. Post in the plugin thread.

Last edited by DJ Tsunami; 06-24-2018 at 03:10.
DJ Tsunami is offline
Ghosted
Veteran 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
__________________

[MOD] CS Weapon Mod V1.7.1
[MM] MetaMod-C V1.0
[MOD] CS NPC Mod (5%)


Probably Left AM
Ghosted is offline
instinctpt1
Senior Member
Join Date: Dec 2016
Location: Chandigarh, 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
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 21:19.


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