Raised This Month: $ Target: $400
 0% 

Help with /spec plugin .


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
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
 


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 09:38.


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