AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   help making steamid restricted plugin. (https://forums.alliedmods.net/showthread.php?t=22204)

ng1200 12-21-2005 09:40

help making steamid restricted plugin.
 
i tryed this:
Code:

/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <amxmisc>
#include <engine>
#include <fun>

#define PLUGIN "Invisible Guy"
#define VERSION "1.0"
#define AUTHOR "CBM"


public plugin_init() {
        register_plugin(PLUGIN, VERSION, AUTHOR)
       
        register_concmd("amx_invisible","invisible",ADMIN_IMMUNITY,"- <name> <1/0>")
}
public invisible(id)
{
        new authid[32]
        get_user_authid(id,authid,31)
        if (authid != "STEAM_0:0:5968622")
        {
                client_print(id,print_chat,"[Invisible] No Access")
                return PLUGIN_HANDLED
        }
        new arg[32], arg2[32]
        read_argv(1,arg,31)
        read_argv(2,arg2,31)
        new target = cmd_target(id,arg,0)
        new onoff = str_to_num(arg2)
        if(onoff != 0 && onoff != 1)
        {
                client_print(id,print_console,"Usage: amx_invisible <name> <1/0>")
                return PLUGIN_HANDLED
        }
        if(!target)
        {
                client_print(id,print_console,"Usage: amx_invisible <name> <1/0>")
                return PLUGIN_HANDLED
        }
        switch(onoff)
        {
                case 1: set_entity_visibility(target,0)
                case 0: set_entity_visibility(target,1)

        }
        return PLUGIN_HANDLED
}

but complier gives error:
Code:

Error: Array must be indexed (variable "authid") on line 22

Charr 12-21-2005 09:44

Code:
if (authid[31] != "STEAM_0:0:5968622")

PM 12-21-2005 10:02

Code:
if (!equal(authid, "STEAM_0:0:5968622"))

You need to use the equal function to compare (C-Style) strings.


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

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