Raised This Month: $ Target: $400
 0% 

Error while making prefix plugin.


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
supertrio17
Senior Member
Join Date: May 2020
Location: Serbia
Old 05-25-2020 , 15:06   Error while making prefix plugin.
Reply With Quote #1

Hi, so I tried making extension for OciXCrom's plugin, but I can't get it right.
So I wan't to give someone prefix on righ setinfo. | setinfo "vip" "1"

So I got this far but I can't quite make it.

PHP Code:
#include <amxmodx>
#include <chatmanager>

public plugin_init()
{
    
register_plugin("SetInfo Prefix""1.2""OciXCrom")
}

public 
client_authorized(id)
{
    static 
szInfo[5]
    
get_user_info(id"vip"szInfocharsmax(szInfo))
    
    if( 
szInfo[0] == '1' )
    {
        
cm_set_user_prefix(id, [VIP])
    }

supertrio17 is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 05-25-2020 , 15:25   Re: Error while making prefix plugin.
Reply With Quote #2

[VIP] probably needs to be a string: "[VIP]". This should give you a compile error and it's always wise to post the compile error when you post for help here.
__________________
fysiks is offline
supertrio17
Senior Member
Join Date: May 2020
Location: Serbia
Old 05-25-2020 , 15:38   Re: Error while making prefix plugin.
Reply With Quote #3

Quote:
Originally Posted by fysiks View Post
[VIP] probably needs to be a string: "[VIP]". This should give you a compile error and it's always wise to post the compile error when you post for help here.
It compiles now, problem is there is no prefix
supertrio17 is offline
Shadows Adi
AlliedModders Donor
Join Date: Aug 2019
Location: Romania
Old 05-25-2020 , 15:28   Re: Error while making prefix plugin.
Reply With Quote #4

You should call a task to check if is user connected. Try this:

Code:
#include <amxmodx> #include <chatmanager> const TASKCHECK = 324 static szInfo[5] public plugin_init() {     register_plugin("SetInfo Prefix", "1.2", "OciXCrom") } public client_putinserver(id) {     get_user_info(id, "vip", szInfo, charsmax(szInfo))       set_task( 10.0, "check_prefix", id + TASKCHECK) } public check_prefix(id) {     if(is_user_connected(id)     {         if( szInfo[0] == '1' )         {             cm_set_user_prefix(id, "[VIP]")         }     } }
__________________


Accepting Paid Requests, contact PM.

MVP Of The Round View project on GITHUB / AlliedModders
CSGO REMAKE ~ CSGO MOD [STABLE + SOURCE CODE]

Last edited by Shadows Adi; 05-25-2020 at 15:42.
Shadows Adi is offline
supertrio17
Senior Member
Join Date: May 2020
Location: Serbia
Old 05-25-2020 , 15:35   Re: Error while making prefix plugin.
Reply With Quote #5

It gives me the same errors
supertrio17 is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 05-25-2020 , 15:40   Re: Error while making prefix plugin.
Reply With Quote #6

Did you not see the plugin I made for you in two different threads?!
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
supertrio17
Senior Member
Join Date: May 2020
Location: Serbia
Old 05-25-2020 , 15:57   Re: Error while making prefix plugin.
Reply With Quote #7

Quote:
Originally Posted by OciXCrom View Post
Did you not see the plugin I made for you in two different threads?!
Hi, I did now. But is there any way to set it like this? Not setting it with direct input. I would like if it could be all done by plugin, that I can set color and prefix inside plugin.
supertrio17 is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 05-25-2020 , 16:25   Re: Error while making prefix plugin.
Reply With Quote #8

Quote:
Originally Posted by supertrio17 View Post
Hi, I did now. But is there any way to set it like this? Not setting it with direct input. I would like if it could be all done by plugin, that I can set color and prefix inside plugin.
That's exactly how I made it and I don't see you doing anything differently in this thread, so what is your point?
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
supertrio17
Senior Member
Join Date: May 2020
Location: Serbia
Old 05-25-2020 , 20:51   Re: Error while making prefix plugin.
Reply With Quote #9

Quote:
Originally Posted by OciXCrom View Post
That's exactly how I made it and I don't see you doing anything differently in this thread, so what is your point?
Hm, I was thinking that you made it so everything that player has set as their setinfo vip value will be their prefix. But I don't want that. What I want is to have each player type setinfo vip 1 and have their prefix set. But for some reason that doesnt work.
supertrio17 is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 05-25-2020 , 21:45   Re: Error while making prefix plugin.
Reply With Quote #10

I made both variants...
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
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 17:10.


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