Raised This Month: $32 Target: $400
 8% 

I have a questions


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
GabrielYaHHo
Member
Join Date: May 2016
Old 04-22-2018 , 10:29   I have a questions
Reply With Quote #1

How can I make the boolean put it for register_clcmd ("say / model", "admin") true / false? to make the boolean if I put it false can not be used anymore, and if I'm true I can do it

Code:
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
//#include <colorchat>


#define PLUGIN "modele"
#define VERSION "1.0"
#define AUTHOR "dimsion."

new bool: preparing

public plugin_init() 
{
    register_plugin(PLUGIN, VERSION, AUTHOR)
    register_clcmd("say /model", "admin")
}

public plugin_precache() 
{
        precache_model("models/player/skin1/skin1.mdl")
        precache_model("models/player/skin2/skin2.mdl")
        precache_model("models/player/skin3/skin3.mdl")
        //precache_model("models/player/admin1/admin1.mdl")
        //precache_model("models/player/admin2/admin2.mdl")
        //precache_model("models/player/admin3/admin3.mdl")
}
		
public admin(id)
{
	if (get_user_flags(id) & ADMIN_KICK)
		{
			model_menu(id)
		}
		else
        {
               //ColorChat(id, GREEN, "Nu esti owner/castigator")
	       zp_colored_print(id, "!yDoar !gowneri!y/!gcastigatori !ypot folosi aceasta !teamcomanda")
        }
	
}
public model_menu(id)
{
    new menu = menu_create("\rModelele mai jos", "menu_wybierz") 
    preparing= true
	
    menu_additem(menu, "\wModel \yMineral Quantum", "1", 0)
    menu_additem(menu, "\wModel \yHitman", "2", 0)
    menu_additem(menu, "\wModel \yAgent 007", "3", 0)
    //menu_additem(menu, "\wModel \yDodatkowy1", "4", 0)
    //menu_additem(menu, "\wModel \yDodatkowy2", "5", 0)
    //menu_additem(menu, "\wModel \yDodatkowy3", "6", 0)

    
    menu_setprop(menu, MPROP_EXIT, MEXIT_ALL)
    
    menu_display(id, menu, 0)
}

public menu_wybierz(id, menu, item)
{
    if(preparing ==true)	
    if (item == MENU_EXIT)
    {
        menu_destroy(menu)
        return PLUGIN_HANDLED
    }
    new data[6], iName[64]
    new acces, callback
    menu_item_getinfo(menu, item, acces, data,5, iName, 63, callback)
    
    new key = str_to_num(data)
    
    switch(key)
    { 
       case 1 : cs_set_user_model(id, "skin1")
       case 2 : cs_set_user_model(id, "skin2")
       case 3 : cs_set_user_model(id, "skin3")
       //case 4 :	cs_set_user_model(id, "admin1")
       //case 5 : cs_set_user_model(id, "admin2")
       //case 6 : cs_set_user_model(id, "admin3")
    }
    menu_destroy(menu)
    return PLUGIN_HANDLED
}  

stock zp_colored_print(const id,const input[], any:...)
{
	new msg[191], players[32], count = 1;
	vformat(msg,190,input,3);
	replace_all(msg,190,"!g","^x04");// green
	replace_all(msg,190,"!y","^x01");// normal
	replace_all(msg,190,"!team","^x03");// team
	
	if (id) players[0] = id; else get_players(players,count,"ch");

	for (new i=0;i<count;i++)
	{
		if (is_user_connected(players[i]))
		{
			message_begin(MSG_ONE_UNRELIABLE,get_user_msgid("SayText"),_,players[i]);
			write_byte(players[i]);
			write_string(msg);
			message_end();
		}
	}
}
GabrielYaHHo is offline
Relaxing
AlliedModders Donor
Join Date: Jun 2016
Location: White Plains
Old 04-22-2018 , 10:47   Re: I have a questions
Reply With Quote #2

Code:
#include <amxmodx> #include <amxmisc> #include <cstrike> //#include <colorchat> #define PLUGIN "modele" #define VERSION "1.0" #define AUTHOR "dimsion." new bool: preparing[32] public plugin_init() {     register_plugin(PLUGIN, VERSION, AUTHOR)     register_event("DeathMsg", "death", "a")     register_clcmd("say /model", "admin") } public plugin_precache() {         precache_model("models/player/skin1/skin1.mdl")         precache_model("models/player/skin2/skin2.mdl")         precache_model("models/player/skin3/skin3.mdl")         //precache_model("models/player/admin1/admin1.mdl")         //precache_model("models/player/admin2/admin2.mdl")         //precache_model("models/player/admin3/admin3.mdl") }         public admin(id) {     if (get_user_flags(id) & ADMIN_KICK)         {             model_menu(id)         }         else         {                //ColorChat(id, GREEN, "Nu esti owner/castigator")            zp_colored_print(id, "!yDoar !gowneri!y/!gcastigatori !ypot folosi aceasta !teamcomanda")         }     } public death(id)     preparing[id] = false; public model_menu(id) {     if (!preparing[id]) return 0;     new menu = menu_create("\rModelele mai jos", "menu_wybierz")         menu_additem(menu, "\wModel \yMineral Quantum", "1", 0)     menu_additem(menu, "\wModel \yHitman", "2", 0)     menu_additem(menu, "\wModel \yAgent 007", "3", 0)     //menu_additem(menu, "\wModel \yDodatkowy1", "4", 0)     //menu_additem(menu, "\wModel \yDodatkowy2", "5", 0)     //menu_additem(menu, "\wModel \yDodatkowy3", "6", 0)         menu_setprop(menu, MPROP_EXIT, MEXIT_ALL)         menu_display(id, menu, 0)     return 0; } public menu_wybierz(id, menu, item) {    if (item == MENU_EXIT)     {         menu_destroy(menu)         return PLUGIN_HANDLED     }     new data[6], iName[64]     new acces, callback     menu_item_getinfo(menu, item, acces, data,5, iName, 63, callback)         new key = str_to_num(data)         switch(key)     {        case 1 : cs_set_user_model(id, "skin1")        case 2 : cs_set_user_model(id, "skin2")        case 3 : cs_set_user_model(id, "skin3")        //case 4 :   cs_set_user_model(id, "admin1")        //case 5 : cs_set_user_model(id, "admin2")        //case 6 : cs_set_user_model(id, "admin3")     }     menu_destroy(menu)     preparing[id] = true;     return PLUGIN_HANDLED }  stock zp_colored_print(const id,const input[], any:...) {     new msg[191], players[32], count = 1;     vformat(msg,190,input,3);     replace_all(msg,190,"!g","^x04");// green     replace_all(msg,190,"!y","^x01");// normal     replace_all(msg,190,"!team","^x03");// team         if (id) players[0] = id; else get_players(players,count,"ch");     for (new i=0;i<count;i++)     {         if (is_user_connected(players[i]))         {             message_begin(MSG_ONE_UNRELIABLE,get_user_msgid("SayText"),_,players[i]);             write_byte(players[i]);             write_string(msg);             message_end();         }     } }
__________________

Last edited by Relaxing; 04-22-2018 at 10:48.
Relaxing is offline
GabrielYaHHo
Member
Join Date: May 2016
Old 04-22-2018 , 12:39   Re: I have a questions
Reply With Quote #3

and if I want to put the boolee out of another plugin, just change the public, right?
GabrielYaHHo is offline
Relaxing
AlliedModders Donor
Join Date: Jun 2016
Location: White Plains
Old 04-22-2018 , 13:51   Re: I have a questions
Reply With Quote #4

What do you mean? Didn't quite got that.
__________________
Relaxing is offline
GabrielYaHHo
Member
Join Date: May 2016
Old 04-23-2018 , 02:54   Re: I have a questions
Reply With Quote #5

I know that it can cause bool (restriction) to other plugins, such as doing a boolean connection in another plugin
GabrielYaHHo is offline
Natsheh
Veteran Member
Join Date: Sep 2012
Old 04-23-2018 , 03:10   Re: I have a questions
Reply With Quote #6

Quote:
Originally Posted by GabrielYaHHo View Post
I know that it can cause bool (restriction) to other plugins, such as doing a boolean connection in another plugin
Create a native.
__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !

Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
GabrielYaHHo
Member
Join Date: May 2016
Old 04-23-2018 , 08:48   Re: I have a questions
Reply With Quote #7

give me an example, please beautifully
GabrielYaHHo is offline
GabrielYaHHo
Member
Join Date: May 2016
Old 04-23-2018 , 08:49   Re: I have a questions
Reply With Quote #8

Quote:
Originally Posted by Natsheh View Post
Create a native.
give me an example, please beautifully
GabrielYaHHo is offline
Relaxing
AlliedModders Donor
Join Date: Jun 2016
Location: White Plains
Old 04-23-2018 , 09:45   Re: I have a questions
Reply With Quote #9

Code:
native get_bool_state(id) get_bool_state(id){     return preparing[id]; }
__________________
Relaxing is offline
Natsheh
Veteran Member
Join Date: Sep 2012
Old 04-23-2018 , 09:56   Re: I have a questions
Reply With Quote #10

Quote:
Originally Posted by GabrielYaHHo View Post
give me an example, please beautifully
https://forums.alliedmods.net/showthread.php?t=41251
__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !

Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
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:23.


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