Modificare plugin V.I.P

Categoria cu cereri de pluginuri si nu numai.

Moderators: Moderatori ajutatori, Moderatori, Echipa eXtreamCS.com

Forum rules
Accesează link-ul pentru a putea vedea regulile forumului

Daca doriti sa vi se modifice un plugin, va rugam postati aici .
Post Reply
Effect-Special
Membru, skill 0
Membru, skill 0
Posts: 10
Joined: 30 May 2012, 16:39
Detinator Steam: Nu
CS Status: Citesc forumul eXtreamCS.com...!
Has thanked: 3 times
Contact:

30 May 2012, 16:48

Salut!Vreau si eu sa imi modificati un plugin V.I.P. Pluginul este foarte bun doar ca nu imi place Godmod-ul (oricine ar trage intr-un player V.I.P care are activat godmod-ul, playerul nu v-a muri)

Code: Select all

/*************************************************************************
* You can set it on/off by typing 'amx_cvar amx_vipmenu 1/0' in console
* Credits: XuNTriC -> Helped us with the menu
*          p4ddy -> Original idea with his /adminmenu at Prokreedz Plugin
*
* To activate the menu type /vmenu or /vipmenu 
* 
* Copyright (C) 2008-2009 Dragosh/AMXX Communit
*
* NOTE* Only admins can use it!
**************************************************************************
*/ 


#include <amxmodx>
#include <fun>
#include <amxmisc>
#include <cstrike>
			
new plugin_on

enum Color
{
	NORMAL = 1, // clients scr_concolor cvar color
	GREEN, // Green Color
	TEAM_COLOR, // Red, grey, blue
	GREY, // grey
	RED, // Red
	BLUE, // Blue
}

new TeamName[][] = 
{
	"",
	"TERRORIST",
	"CT",
	"SPECTATOR"
}


public plugin_init(){

    register_plugin("VIP MENU", "1.1", "dragosh, MIk3")
    register_menucmd(register_menuid("VIP MENU"), 1023, "setoption") 
    plugin_on = register_cvar("amx_vipmenu", "1")


    register_clcmd("say /vipmenu","vip_menu",ADMIN_CVAR)
    register_clcmd("say_team /vipmenu","vip_menu",ADMIN_CVAR)

    register_clcmd("say /vmenu","vip_menu",ADMIN_CVAR)
    register_clcmd("say_team /vmenu","vip_menu",ADMIN_CVAR)

  
}

public vip_menu(id,level,cid) 
{
	if ( !get_pcvar_num(plugin_on) ) 
	{	
		ColorChat(id, RED, "Vip Menu is currently disabled");
		return PLUGIN_HANDLED;
	}
 
        if(!cmd_access(id,level,cid,2))
		return PLUGIN_HANDLED
		
	chooseoption(id)
	
	return PLUGIN_HANDLED
       
}

public chooseoption(id)
{
    new menu[192] 
    new keys = MENU_KEY_0|MENU_KEY_1|MENU_KEY_2|MENU_KEY_3|MENU_KEY_4|MENU_KEY_5|MENU_KEY_6|MENU_KEY_7|MENU_KEY_8|MENU_KEY_9     
    format(menu, 191, "\yVIP MENU^n^n\r1.\w Gravity^n\r2.\w Health^n\r3.\w Vip Model^n\r4.\w Noclip^n\r5.\w Armor^n\r6.\w Godmode^n^n\r7.\w Remove Godmode^n\r8.\w Remove Noclip ^n\r9.\w Reset Vip Model^n^n\r0.\w Exit") 
    show_menu(id, keys, menu)      
    return PLUGIN_CONTINUE
}

public setoption(id, key, menu)
{
    if(key == 0) {
         new name[17]
         get_user_name(id, name, 18)
         set_user_gravity(id,0.7)
         ColorChat(0, GREEN, "^x04[VIP] ^x03%s^x01 has purchased ^x04gravity^x01 (700)", name)
         return PLUGIN_HANDLED
    }

    if(key == 1) {
         new name[17]
         get_user_name(id, name, 18)
         set_user_health(id, 150)
         ColorChat(0, GREEN, "^x04[VIP] ^x03%s^x01 has purchased^x04 150hp", name)
         return PLUGIN_HANDLED

    }

    if(key == 2) {
         new name[17]
         get_user_name(id, name, 18)
         cs_set_user_model(id, "vip")
         ColorChat(id, TEAM_COLOR, "^x04[VIP] ^x03%s^x01 has set a ^x03VIP model", name)
         return PLUGIN_HANDLED
    }

    if(key == 3) {
         new name[17]
         get_user_name(id, name, 18)
         set_user_noclip(id, 1)
         ColorChat(0, GREEN, "^x04[VIP] ^x03%s^x01 has purchased ^x04noclip", name)
         return PLUGIN_HANDLED

    }

    if(key == 4) {
         new name[17]
         get_user_name(id, name, 18)
         set_user_armor(id, 150)
         ColorChat(0, GREEN, "^x04[VIP] ^x03%s^x01 has purchased^x04 armor", name)
         return PLUGIN_HANDLED
    }

    if(key == 5) {
         new name[17]
         get_user_name(id, name, 18)
         set_user_godmode(id, 1)
         ColorChat(0, GREEN, "^x04[VIP] ^x03%s^x01 has set^x04 godmode", name)
         return PLUGIN_HANDLED
    }
    
    if(key == 6) {
         new name[17]
         get_user_name(id, name, 18)
         set_user_godmode(id, 0)
         ColorChat(0, GREEN, "^x04[VIP] ^x03%s^x01 has removed^x04 godmode", name)
         return PLUGIN_HANDLED
    }

    if(key == 7) {
         new name[17]
         get_user_name(id, name, 18)
         set_user_noclip(id, 0)
         ColorChat(0, RED, "^x04[VIP] ^x03%s^x01 has  removed ^x04noclip", name)
         return PLUGIN_HANDLED
    }

    if(key == 8) {
         new name[17]
         get_user_name(id, name, 18)
         cs_reset_user_model (id)
         ColorChat(0, RED, "^x04[VIP] ^x03%s^x01  has  resetted his ^x04Vip model", name)
         return PLUGIN_HANDLED
    }
         
    else {
         return PLUGIN_HANDLED
    }

    return PLUGIN_HANDLED
}

public plugin_precache()
{
        precache_model("models/player/vip/vip.mdl")
	return PLUGIN_CONTINUE 

}

ColorChat(id, Color:type, const msg[], {Float,Sql,Result,_}:...)
{
	new message[256];

	switch(type)
	{
		case NORMAL: // clients scr_concolor cvar color
		{
			message[0] = 0x01;
		}
		case GREEN: // Green
		{
			message[0] = 0x04;
		}
		default: // White, Red, Blue
		{
			message[0] = 0x03;
		}
	}

	vformat(message[1], 251, msg, 4);

	// Make sure message is not longer than 192 character. Will crash the server.
	message[192] = '^0';

	new team, ColorChange, index, MSG_Type;
	
	if(id)
	{
		MSG_Type = MSG_ONE;
		index = id;
	} else {
		index = FindPlayer();
		MSG_Type = MSG_ALL;
	}
	
	team = get_user_team(index);
	ColorChange = ColorSelection(index, MSG_Type, type);

	ShowColorMessage(index, MSG_Type, message);
		
	if(ColorChange)
	{
		Team_Info(index, MSG_Type, TeamName[team]);
	}
}

ShowColorMessage(id, type, message[])
{
	static bool:saytext_used;
	static get_user_msgid_saytext;
	if(!saytext_used)
	{
		get_user_msgid_saytext = get_user_msgid("SayText");
		saytext_used = true;
	}
	message_begin(type, get_user_msgid_saytext, _, id);
	write_byte(id)		
	write_string(message);
	message_end();	
}

Team_Info(id, type, team[])
{
	static bool:teaminfo_used;
	static get_user_msgid_teaminfo;
	if(!teaminfo_used)
	{
		get_user_msgid_teaminfo = get_user_msgid("TeamInfo");
		teaminfo_used = true;
	}
	message_begin(type, get_user_msgid_teaminfo, _, id);
	write_byte(id);
	write_string(team);
	message_end();

	return 1;
}

ColorSelection(index, type, Color:Type)
{
	switch(Type)
	{
		case RED:
		{
			return Team_Info(index, type, TeamName[1]);
		}
		case BLUE:
		{
			return Team_Info(index, type, TeamName[2]);
		}
		case GREY:
		{
			return Team_Info(index, type, TeamName[0]);
		}
	}

	return 0;
}

FindPlayer()
{
	new i = -1;

	while(i <= get_maxplayers())
	{
		if(is_user_connected(++i))
			return i;
	}

	return -1;
}
Nu vreau sa umblati la alte chestii decat sa scoateti din pluginul asta Godmod-ul

Multumesc!!!
RoyalServer 2
User avatar
sDs|Aragon*
Membru, skill +2
Membru, skill +2
Posts: 576
Joined: 29 Dec 2011, 21:38
Detinator Steam: Da
SteamID: Mihai_Parkour10
Reputatie: Fost scripter eXtreamCS
Has thanked: 4 times
Been thanked: 132 times

30 May 2012, 18:53

| Afiseaza codul
/*************************************************************************
* You can set it on/off by typing 'amx_cvar amx_vipmenu 1/0' in console
* Credits: XuNTriC -> Helped us with the menu
*          p4ddy -> Original idea with his /adminmenu at Prokreedz Plugin
*
* To activate the menu type /vmenu or /vipmenu 
* 
* Copyright (C) 2008-2009 Dragosh/AMXX Communit
*
* NOTE* Only admins can use it!
**************************************************************************
*/ 


#include <amxmodx>
#include <fun>
#include <amxmisc>
#include <cstrike>

new plugin_on

enum Color
{
NORMAL = 1, // clients scr_concolor cvar color
GREEN, // Green Color
TEAM_COLOR, // Red, grey, blue
GREY, // grey
RED, // Red
BLUE, // Blue
}

new TeamName[][] = 
{
"",
"TERRORIST",
"CT",
"SPECTATOR"
}


public plugin_init(){

register_plugin("VIP MENU", "1.1", "dragosh, MIk3")
register_menucmd(register_menuid("VIP MENU"), 1023, "setoption") 
plugin_on = register_cvar("amx_vipmenu", "1")


register_clcmd("say /vipmenu","vip_menu",ADMIN_CVAR)
register_clcmd("say_team /vipmenu","vip_menu",ADMIN_CVAR)

register_clcmd("say /vmenu","vip_menu",ADMIN_CVAR)
register_clcmd("say_team /vmenu","vip_menu",ADMIN_CVAR)


}

public vip_menu(id,level,cid) 
{
if ( !get_pcvar_num(plugin_on) ) 
{   
ColorChat(id, RED, "Vip Menu is currently disabled");
return PLUGIN_HANDLED;
}

if(!cmd_access(id,level,cid,2))
return PLUGIN_HANDLED

chooseoption(id)

return PLUGIN_HANDLED

}

public chooseoption(id)
{
new menu[192] 
new keys = MENU_KEY_0|MENU_KEY_1|MENU_KEY_2|MENU_KEY_3|MENU_KEY_4|MENU_KEY_5|MENU_KEY_6|MENU_KEY_7|MENU_KEY_8|MENU_KEY_9     
format(menu, 191, "\yVIP MENU^n^n\r1.\w Gravity^n\r2.\w Health^n\r3.\w Vip Model^n\r4.\w Noclip^n\r5.\w Armor^n\r8.\w Remove Noclip ^n\r9.\w Reset Vip Model^n^n\r0.\w Exit") 
show_menu(id, keys, menu)      
return PLUGIN_CONTINUE
}

public setoption(id, key, menu)
{
if(key == 0) {
	new name[17]
	get_user_name(id, name, 18)
	set_user_gravity(id,0.7)
	ColorChat(0, GREEN, "^x04[VIP] ^x03%s^x01 has purchased ^x04gravity^x01 (700)", name)
	return PLUGIN_HANDLED
}

if(key == 1) {
	new name[17]
	get_user_name(id, name, 18)
	set_user_health(id, 150)
	ColorChat(0, GREEN, "^x04[VIP] ^x03%s^x01 has purchased^x04 150hp", name)
	return PLUGIN_HANDLED
	
}

if(key == 2) {
	new name[17]
	get_user_name(id, name, 18)
	cs_set_user_model(id, "vip")
	ColorChat(id, TEAM_COLOR, "^x04[VIP] ^x03%s^x01 has set a ^x03VIP model", name)
	return PLUGIN_HANDLED
}

if(key == 3) {
	new name[17]
	get_user_name(id, name, 18)
	set_user_noclip(id, 1)
	ColorChat(0, GREEN, "^x04[VIP] ^x03%s^x01 has purchased ^x04noclip", name)
	return PLUGIN_HANDLED
	
}

if(key == 4) {
	new name[17]
	get_user_name(id, name, 18)
	set_user_armor(id, 150)
	ColorChat(0, GREEN, "^x04[VIP] ^x03%s^x01 has purchased^x04 armor", name)
	return PLUGIN_HANDLED
}

if(key == 5) {
	new name[17]
	get_user_name(id, name, 18)
	set_user_noclip(id, 0)
	ColorChat(0, RED, "^x04[VIP] ^x03%s^x01 has  removed ^x04noclip", name)
	return PLUGIN_HANDLED
}

if(key == 6) {
	new name[17]
	get_user_name(id, name, 18)
	cs_reset_user_model (id)
	ColorChat(0, RED, "^x04[VIP] ^x03%s^x01  has  resetted his ^x04Vip model", name)
	return PLUGIN_HANDLED
}

else {
	return PLUGIN_HANDLED
}

return PLUGIN_HANDLED
}

public plugin_precache()
{
precache_model("models/player/vip/vip.mdl")
return PLUGIN_CONTINUE 

}

ColorChat(id, Color:type, const msg[], {Float,Sql,Result,_}:...)
{
new message[256];

switch(type)
{
case NORMAL: // clients scr_concolor cvar color
{
	message[0] = 0x01;
}
case GREEN: // Green
{
	message[0] = 0x04;
}
default: // White, Red, Blue
{
message[0] = 0x03;
}
}

vformat(message[1], 251, msg, 4);

// Make sure message is not longer than 192 character. Will crash the server.
message[192] = '^0';

new team, ColorChange, index, MSG_Type;

if(id)
{
MSG_Type = MSG_ONE;
index = id;
} else {
index = FindPlayer();
MSG_Type = MSG_ALL;
}

team = get_user_team(index);
ColorChange = ColorSelection(index, MSG_Type, type);

ShowColorMessage(index, MSG_Type, message);

if(ColorChange)
{
Team_Info(index, MSG_Type, TeamName[team]);
}
}

ShowColorMessage(id, type, message[])
{
static bool:saytext_used;
static get_user_msgid_saytext;
if(!saytext_used)
{
get_user_msgid_saytext = get_user_msgid("SayText");
saytext_used = true;
}
message_begin(type, get_user_msgid_saytext, _, id);
write_byte(id)      
write_string(message);
message_end();   
}

Team_Info(id, type, team[])
{
static bool:teaminfo_used;
static get_user_msgid_teaminfo;
if(!teaminfo_used)
{
get_user_msgid_teaminfo = get_user_msgid("TeamInfo");
teaminfo_used = true;
}
message_begin(type, get_user_msgid_teaminfo, _, id);
write_byte(id);
write_string(team);
message_end();

return 1;
}

ColorSelection(index, type, Color:Type)
{
switch(Type)
{
case RED:
{
return Team_Info(index, type, TeamName[1]);
}
case BLUE:
{
return Team_Info(index, type, TeamName[2]);
}
case GREY:
{
return Team_Info(index, type, TeamName[0]);
}
}

return 0;
}

FindPlayer()
{
new i = -1;

while(i <= get_maxplayers())
{
if(is_user_connected(++i))
return i;
}

return -1;
}
Effect-Special
Membru, skill 0
Membru, skill 0
Posts: 10
Joined: 30 May 2012, 16:39
Detinator Steam: Nu
CS Status: Citesc forumul eXtreamCS.com...!
Has thanked: 3 times
Contact:

30 May 2012, 19:57

Multumesc mult
Post Reply

Return to “Cereri”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 40 guests