Raised This Month: $ Target: $400
 0% 

Help with /spec plugin .


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Skyliner
Member
Join Date: Sep 2011
Location: Fagaras
Old 04-20-2017 , 12:12   Help with /spec plugin .
Reply With Quote #1

Hey lads, so, I got the code.
I modified an ond plugin but no luck.
So, I wanna make this plugin to only use the command /spec and /back only admins with immunity, with flag "a" .

I tried with "register_concmd("say /spec", "spec", ADMIN_LEVEL_C)" but no luck.
The code it's don't here.
Any help please?
Thanks!

Code:
#include <amxmodx>
#include <cstrike>
#include <fun>

#define PLUGIN "Spectator"
#define VERSION "1.0.0"
#define AUTHOR "AlexN"

new CsTeams:zTeam[33]
new zDeath[33]

public plugin_init() 
{
    register_plugin(PLUGIN, VERSION, AUTHOR)
    register_concmd("say /spec", "spec", ADMIN_LEVEL_C)
    register_concmd("say_team /spec", "spec", ADMIN_LEVEL_C)	
    register_concmd("say /back", "back", ADMIN_LEVEL_C)
    register_concmd("say_team /back", "back", ADMIN_LEVEL_C)
	
	//register_clcmd("say_team /back", "back", ADMIN_LEVEL_C)
	
}

public cmdExample(id, level, cid)
{
    if( (get_user_flags(id) & level) != level )
    {
        // User does NOT have both flags
        return PLUGIN_HANDLED
    }
    
    // User has both flags
}  

public client_putinserver(id)
    set_task(20.0,"rule",id)


public spec(id) 
{
    zDeath[id] = cs_get_user_deaths(id)
    if(cs_get_user_team(id) == CS_TEAM_SPECTATOR) return 1;
    else
    zTeam[id] = cs_get_user_team(id)
    cs_set_user_team(id, CS_TEAM_SPECTATOR)
    user_kill(id, 1)
    return 0;
}

public back(id) 
{
    if(cs_get_user_team(id) == CS_TEAM_SPECTATOR)
    cs_set_user_team(id, zTeam[id])
    cs_set_user_deaths(id, zDeath[id])

}

public rule(id)
{
    client_print(id,print_chat,"[WAR3.FGSCS.RO] Scrie /spec daca vrei sa treci la SPECTATOR (valabil doar pentru admini si vip)."),
	client_print(id,print_chat,"[WAR3.FGSCS.RO] Scrie /back ca sa revii inapoi in echipa (valabil doar pentru admini si vip).")
}
__________________

Skyliner is offline
Send a message via Yahoo to Skyliner Send a message via Skype™ to Skyliner
CrazY.
Veteran Member
Join Date: May 2015
Location: SP, Brazil
Old 04-20-2017 , 12:54   Re: Help with /spec plugin .
Reply With Quote #2

Use cmd_access (amxmisc.Inc), don't get_user_flags().
__________________








CrazY. is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 04-20-2017 , 13:27   Re: Help with /spec plugin .
Reply With Quote #3

Or you can try my /spec plugin - https://github.com/OciXCrom/GoSpec/archive/master.zip
By default it's on flag "e", but you can change it with the cvar gospec_spec_flag.
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
Skyliner
Member
Join Date: Sep 2011
Location: Fagaras
Old 04-20-2017 , 13:34   Re: Help with /spec plugin .
Reply With Quote #4

Quote:
Originally Posted by OciXCrom View Post
Or you can try my /spec plugin - https://github.com/OciXCrom/GoSpec/archive/master.zip
By default it's on flag "e", but you can change it with the cvar gospec_spec_flag.
Oh, nice.
Thanks for the plugin and for the help .
__________________

Skyliner is offline
Send a message via Yahoo to Skyliner Send a message via Skype™ to Skyliner
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 13:36.


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