Modificare plugin VIP DeathRun

Modificari necesare ale pluginurilor

Moderators: Moderatori ajutatori, Moderatori, Echipa eXtreamCS.com

Post Reply
User avatar
Myty CSG
Utilizator neserios (tepar)
Utilizator neserios (tepar)
Posts: 770
Joined: 27 Aug 2013, 11:44
Detinator Steam: Da
Detinator server CS: Nu.
SteamID: PM.
Reputatie: Utilizator neserios ( tepar )
Been thanked: 1 time

06 Aug 2018, 22:49

Salut.
Am urmatorul plugin VIP de DR:
| Afiseaza codul
#include <amxmodx>
#include <fakemeta>
#include <fakemeta_util>
#include <hamsandwich>
#include <cstrike>
#include <amxmisc>
#include <fun>

#define PLUGIN_NAME "vipas"
#define PLUGIN_AUTHOR "Kukulis"
#define PLUGIN_VERSION "0.1"

static const COLOR[] = "^x04"
static const CONTACT[] = ""

new maxplayers
new gmsgSayText

public plugin_init()
{
register_plugin(PLUGIN_NAME, PLUGIN_AUTHOR, PLUGIN_VERSION);

register_event("ResetHUD","event_reset_hud","be");
register_event("ResetHUD", "resetModel", "b")
register_clcmd("say /vip","admin_motd",0,"- Shows the MOTD.")

register_clcmd("say", "handle_say")
register_cvar("amx_contactinfo", CONTACT, FCVAR_SERVER)
gmsgSayText = get_user_msgid("SayText")

maxplayers = get_maxplayers()

return PLUGIN_CONTINUE

}

public plugin_precache() {
precache_model("models/player/smith/smith.mdl")
precache_model("models/player/smith/smith.mdl")

return PLUGIN_CONTINUE
}

public resetModel(id, level, cid) {
if (get_user_flags(id) & ADMIN_CVAR) {
new CsTeams:userTeam = cs_get_user_team(id)
if (userTeam == CS_TEAM_T) {
cs_set_user_model(id, "smith")
}
else if(userTeam == CS_TEAM_CT) {
cs_set_user_model(id, "smith")
}
else {
cs_reset_user_model(id)
}
}

return PLUGIN_CONTINUE
}


public event_reset_hud(id)
{
if(!is_user_connected(id))
return PLUGIN_CONTINUE;

client_print(id, print_chat, "[VIP] Write /vip To see the VIP privileges.")

if(!access(id,ADMIN_CVAR))
return PLUGIN_CONTINUE;

set_task(1.0,"give_stuff",id);

return PLUGIN_CONTINUE;
}

public admin_motd(id,level,cid) {

	if (!cmd_access(id,level,cid,1))
	return PLUGIN_CONTINUE
	
	show_motd(id,"vip.txt","VIP by Kukulis")
	return PLUGIN_CONTINUE   
}




public give_stuff(id)
{
if(!is_user_connected(id))
return;

   fm_give_item(id, "item_assaultsuit");
   fm_give_item(id, "weapon_flashbang");
   fm_give_item(id, "weapon_flashbang");
   fm_give_item(id, "weapon_hegrenade");
   fm_give_item(id, "weapon_smokegrenade");
   cs_set_user_money(id, cs_get_user_money(id) + 500); 
   set_user_gravity (id, 0.70);
}

public handle_say(id)
{
	new said[192]
	read_args(said,192)
	if(( containi(said, "who") != -1 && containi(said, "admin") != -1) || contain(said, "/vips") != -1)
		set_task(0.1,"print_viplist", id)
	return PLUGIN_CONTINUE
}

public print_viplist(user) 
{
	new adminnames[33][32]
	new message[256]
	new contactinfo[256], contact[112]
	new id, count, x, len
	
	for(id = 1 ; id <= maxplayers ; id++)
		if(is_user_connected(id))
			if(get_user_flags(id) & ADMIN_CVAR)
				get_user_name(id, adminnames[count++], 31)

	len = format(message, 255, "%s Online VIP: ",COLOR)
	if(count > 0) {
		for(x = 0 ; x < count ; x++) {
			len += format(message[len], 255-len, "%s%s ", adminnames[x], x < (count-1) ? ", ":"")
			if(len > 96 ) {
				print_message(user, message)
				len = format(message, 255, "%s ",COLOR)
			}
		}
		print_message(user, message)
	}
	else {
		len += format(message[len], 255-len, "No online VIP.")
		print_message(user, message)
	}

	get_cvar_string("amx_contactinfo", contact, 63)
	if(contact[0])  {
		format(contactinfo, 111, "%s Contact Server Admin -- %s", COLOR, contact)
		print_message(user, contactinfo)
	}
}

print_message(id, msg[])
{
	message_begin(MSG_ONE, gmsgSayText, {0,0,0}, id)
	write_byte(id)
	write_string(msg)
	message_end()
}
Doresc să nu primească setul de grenade, 200HP si AP, si VIP in TAB, iar accesul sa fie pe ADMIN_LEVEL_H adica flag t.
HP si AP si scoaterea grenadelor stiu sa le fac, doar ca nu stiu sa integrez VIP in TAB si sa schimb flag-ul. El are flag "abegi".
Multumesc.
Image
RoyalServer 2
Aneimar
Membru, skill 0
Membru, skill 0
Posts: 90
Joined: 07 Apr 2016, 00:16
Detinator Steam: Nu
CS Status: Citesc forumul eXtreamCS.com...!
Fond eXtream: 0
Has thanked: 1 time
Contact:

20 Aug 2018, 02:57

Code: Select all

if(get_user_flags(id) & ADMIN_CVAR)
de aici modifici accesul .

Daca nu stii sa il integrezi in plugin-ul tau imi dai pm .

Code: Select all

#include < amxmodx >

#define PLUGIN_NAME ""
#define PLUGIN_VERSION "1.0"
#define PLUGIN_AUTHOR "falseq"

const TASK_ID = 12323;

#define FLAG	ADMIN_LEVEL_H

public plugin_init( )
{
	register_plugin( PLUGIN_NAME, PLUGIN_VERSION, PLUGIN_AUTHOR );
	
	register_event( "ResetHUD", "ev_ResetHud", "be" );
}

public ev_ResetHud( id )
{
	set_task( 0.1, "addviptab", id + TASK_ID );
}

public addviptab( taskid )
{
	new i_Index = taskid - TASK_ID;
	
	if( get_user_flags( i_Index ) & FLAG )
	{
		message_begin( MSG_ALL, get_user_msgid( "ScoreAttrib" ) );
		
		write_byte( i_Index );
		write_byte( 4 );
		
		message_end( );
	}
}
User avatar
Laurentiu P.
Fost moderator
Fost moderator
Posts: 2549
Joined: 10 Jul 2013, 21:26
Detinator Steam: Da
Reputatie: Fost super moderator
Fond eXtream: 100
Has thanked: 26 times
Been thanked: 62 times
Contact:

20 Aug 2018, 07:47

Myty CSG wrote:Salut.
Am urmatorul plugin VIP de DR:
| Afiseaza codul
#include <amxmodx>
#include <fakemeta>
#include <fakemeta_util>
#include <hamsandwich>
#include <cstrike>
#include <amxmisc>
#include <fun>

#define PLUGIN_NAME "vipas"
#define PLUGIN_AUTHOR "Kukulis"
#define PLUGIN_VERSION "0.1"

static const COLOR[] = "^x04"
static const CONTACT[] = ""

new maxplayers
new gmsgSayText

public plugin_init()
{
register_plugin(PLUGIN_NAME, PLUGIN_AUTHOR, PLUGIN_VERSION);

register_event("ResetHUD","event_reset_hud","be");
register_event("ResetHUD", "resetModel", "b")
register_clcmd("say /vip","admin_motd",0,"- Shows the MOTD.")

register_clcmd("say", "handle_say")
register_cvar("amx_contactinfo", CONTACT, FCVAR_SERVER)
gmsgSayText = get_user_msgid("SayText")

maxplayers = get_maxplayers()

return PLUGIN_CONTINUE

}

public plugin_precache() {
precache_model("models/player/smith/smith.mdl")
precache_model("models/player/smith/smith.mdl")

return PLUGIN_CONTINUE
}

public resetModel(id, level, cid) {
if (get_user_flags(id) & ADMIN_CVAR) {
new CsTeams:userTeam = cs_get_user_team(id)
if (userTeam == CS_TEAM_T) {
cs_set_user_model(id, "smith")
}
else if(userTeam == CS_TEAM_CT) {
cs_set_user_model(id, "smith")
}
else {
cs_reset_user_model(id)
}
}

return PLUGIN_CONTINUE
}


public event_reset_hud(id)
{
if(!is_user_connected(id))
return PLUGIN_CONTINUE;

client_print(id, print_chat, "[VIP] Write /vip To see the VIP privileges.")

if(!access(id,ADMIN_CVAR))
return PLUGIN_CONTINUE;

set_task(1.0,"give_stuff",id);

return PLUGIN_CONTINUE;
}

public admin_motd(id,level,cid) {

	if (!cmd_access(id,level,cid,1))
	return PLUGIN_CONTINUE
	
	show_motd(id,"vip.txt","VIP by Kukulis")
	return PLUGIN_CONTINUE   
}




public give_stuff(id)
{
if(!is_user_connected(id))
return;

   fm_give_item(id, "item_assaultsuit");
   fm_give_item(id, "weapon_flashbang");
   fm_give_item(id, "weapon_flashbang");
   fm_give_item(id, "weapon_hegrenade");
   fm_give_item(id, "weapon_smokegrenade");
   cs_set_user_money(id, cs_get_user_money(id) + 500); 
   set_user_gravity (id, 0.70);
}

public handle_say(id)
{
	new said[192]
	read_args(said,192)
	if(( containi(said, "who") != -1 && containi(said, "admin") != -1) || contain(said, "/vips") != -1)
		set_task(0.1,"print_viplist", id)
	return PLUGIN_CONTINUE
}

public print_viplist(user) 
{
	new adminnames[33][32]
	new message[256]
	new contactinfo[256], contact[112]
	new id, count, x, len
	
	for(id = 1 ; id <= maxplayers ; id++)
		if(is_user_connected(id))
			if(get_user_flags(id) & ADMIN_CVAR)
				get_user_name(id, adminnames[count++], 31)

	len = format(message, 255, "%s Online VIP: ",COLOR)
	if(count > 0) {
		for(x = 0 ; x < count ; x++) {
			len += format(message[len], 255-len, "%s%s ", adminnames[x], x < (count-1) ? ", ":"")
			if(len > 96 ) {
				print_message(user, message)
				len = format(message, 255, "%s ",COLOR)
			}
		}
		print_message(user, message)
	}
	else {
		len += format(message[len], 255-len, "No online VIP.")
		print_message(user, message)
	}

	get_cvar_string("amx_contactinfo", contact, 63)
	if(contact[0])  {
		format(contactinfo, 111, "%s Contact Server Admin -- %s", COLOR, contact)
		print_message(user, contactinfo)
	}
}

print_message(id, msg[])
{
	message_begin(MSG_ONE, gmsgSayText, {0,0,0}, id)
	write_byte(id)
	write_string(msg)
	message_end()
}
Doresc să nu primească setul de grenade, 200HP si AP, si VIP in TAB, iar accesul sa fie pe ADMIN_LEVEL_H adica flag t.
HP si AP si scoaterea grenadelor stiu sa le fac, doar ca nu stiu sa integrez VIP in TAB si sa schimb flag-ul. El are flag "abegi".
Multumesc.
Nici tu nu sti ce vrei. La inceput vrei sa iti scoata hp ap pe care nu le ai in sursa, grenazile si VIP in TABSCORE(pe care nu il ai in sursa) mai apoi sa iți adaugam VIP in TABSCORE.
no...
Post Reply

Return to “Modificari pluginuri”

  • Information