AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Error while making prefix plugin. (https://forums.alliedmods.net/showthread.php?t=324739)

supertrio17 05-25-2020 15:06

Error while making prefix plugin.
 
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])
    }



fysiks 05-25-2020 15:25

Re: Error while making prefix plugin.
 
[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.

Shadows Adi 05-25-2020 15:28

Re: Error while making prefix plugin.
 
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]")         }     } }

supertrio17 05-25-2020 15:35

Re: Error while making prefix plugin.
 
It gives me the same errors

supertrio17 05-25-2020 15:38

Re: Error while making prefix plugin.
 
Quote:

Originally Posted by fysiks (Post 2702296)
[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

OciXCrom 05-25-2020 15:40

Re: Error while making prefix plugin.
 
Did you not see the plugin I made for you in two different threads?!

supertrio17 05-25-2020 15:57

Re: Error while making prefix plugin.
 
Quote:

Originally Posted by OciXCrom (Post 2702301)
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.

OciXCrom 05-25-2020 16:25

Re: Error while making prefix plugin.
 
Quote:

Originally Posted by supertrio17 (Post 2702307)
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?

supertrio17 05-25-2020 20:51

Re: Error while making prefix plugin.
 
Quote:

Originally Posted by OciXCrom (Post 2702315)
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.

OciXCrom 05-25-2020 21:45

Re: Error while making prefix plugin.
 
I made both variants...


All times are GMT -4. The time now is 17:10.

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