Skocz do zawartości

  • Zaloguj korzystając z Facebooka Zaloguj korzystając z Twittera Zaloguj przez Steam Zaloguj poprzez Google      Logowanie »   
  • Rejestracja

Witamy w Nieoficjalnym polskim support'cie AMX Mod X

Witamy w Nieoficjalnym polskim support'cie AMX Mod X, jak w większości społeczności internetowych musisz się zarejestrować aby móc odpowiadać lub zakładać nowe tematy, ale nie bój się to jest prosty proces w którym wymagamy minimalnych informacji.

  • Rozpoczynaj nowe tematy i odpowiedaj na inne
  • Zapisz się do tematów i for, aby otrzymywać automatyczne uaktualnienia
  • Dodawaj wydarzenia do kalendarza społecznościowego
  • Stwórz swój własny profil i zdobywaj nowych znajomych
  • Zdobywaj nowe doświadczenia

Dołączona grafika Dołączona grafika

Guest Message by DevFuse
 

Zdjęcie
Modyfikacja

ViP na DR. Przerobienie

Modyfikacja

  • Nie możesz napisać tematu
  • Zaloguj się, aby dodać odpowiedź
2 odpowiedzi w tym temacie

#1 R4x0R.

    Życzliwy

  • Użytkownik

Reputacja: 0
zer0.

  • Postów:30
  • Imię:Ładnie
  • Lokalizacja:Komputer
Offline

Napisano 30.03.2012 19:10

Witam.
Proszę o przerobienie Vipa sma ponieważ w tym temacie jestem zielony. Z góry dziękuje.
A więc Jest w vipe takie oto MENU :
1.255 Health.
2.255 Armor.
3.Gravity.
4.Speed.
5.Deagle With 2 Bullets. (Only For Terrorists)
6.He Grenade.
7.Night Vision (for dark maps).

Jak można to proszę przerobić na takie.

1.35 HP
2.35 Kamizelki
3.Grawitacja
4.Szybkość
5.Deagle z 2 nabojami [TYLKO DLA TT]
6.Noktowizor

Oraz proszę o przerobienie hp i kamizelki z 255 na 35 z góry dziękuje :D

[color=#000000][font=verdana, geneva, lucida,]
[/font][/color]#include <amxmodx>
#include <amxmisc>
#include <fun>
#include <hamsandwich>
#include <cstrike>
#include <fakemeta>
#include <xs>
#include <engine>

#define FLAG ADMIN_IMMUNITY

new const VIP[] = "DeathRunVip"
new const VIP_MODEL[] = "models/player/DeathRunVip/DeathRunVip.mdl"

new const MENU_POPUP[] = "misc/DeathRunVip/vip_menu_popup.wav"
new const MENU_OK[] = "misc/DeathRunVip/vip_menu_ok.wav"
new const VIP_CONNECT[] = "misc/DeathRunVip/vip_connect.wav"

#define TASKID_SHOWHUD 2931
#define TASKID_MODEL 3810

new player_model[33][32]
new Float: g_counter
new bool: g_model[33]
new g_hudsync
new cvar_gravity
new cvar_speed
new SayTxT

new gCylinderSprite;

public plugin_precache()
{
precache_model(VIP_MODEL)
		precache_sound(VIP_CONNECT)

precache_sound(MENU_POPUP)
precache_sound(MENU_OK)

gCylinderSprite = precache_model( "sprites/shockwave.spr" );
}

public plugin_init()
{
register_plugin("Deathrun V.I.P", "1.0", "DoviuX")

cvar_gravity = register_cvar("dr_vip_gravity", "500")
cvar_speed = register_cvar("dr_vip_speed", "500")

RegisterHam(Ham_Spawn, "player", "bacon_spawn", 1)
register_forward(FM_SetClientKeyValue, "fw_SetClientKeyValue")
register_forward(FM_ClientUserInfoChanged, "fw_ClientUserInfoChanged")

g_hudsync = CreateHudSyncObj()
SayTxT = get_user_msgid("SayText");
}

public client_connect(client)
{
if(get_user_flags(client) & FLAG)
{
client_cmd(client, "spk %s", VIP_CONNECT)

	 new name[32];
	 get_user_name(client, name, 31);
		 set_hudmessage( 0, 255, 0, -1.0, 0.29, 0, 6.0, 12.0 );
		 show_hudmessage( 0, "Vip %s is connecting to the server!.", name);
}
}

public bacon_spawn(id)
{
	if (!is_user_alive(id))
		return

	static CsTeams: team ; team = cs_get_user_team(id)

	if (team == CS_TEAM_T && (get_user_flags(id) & FLAG))
	{  
set_task(2.0, "T_menu", id)

	 new iOrigin[ 3 ];
	 get_user_origin( id, iOrigin );

	 Create_BeamCylinder( iOrigin, 120, gCylinderSprite, 0, 0, 6, 16, 0, random( 0 ), random( 255 ), random( 0 ), 255, 0 );
	 Create_BeamCylinder( iOrigin, 120, gCylinderSprite, 0, 0, 6, 16, 0, random( 0 ), random( 255 ), random( 0 ), 255, 0 );
	 Create_BeamCylinder( iOrigin, 120, gCylinderSprite, 0, 0, 6, 16, 0, random( 0 ), random( 255 ), random( 0 ), 255, 0 );

copy(player_model[id], 31, VIP)

new currentmodel[32];
fm_get_user_model(id, currentmodel, sizeof currentmodel - 1);

if(!equal(currentmodel, player_model[id]))
{
Task_Model(id + TASKID_MODEL)
g_counter += 0.1;
}

if(!task_exists(TASKID_SHOWHUD + id))
  set_task(0.2, "Task_ShowHUD", TASKID_SHOWHUD + id)

set_user_rendering(id,kRenderFxGlowShell,255,0,0,kRenderNormal,25)
	}
	else if (team == CS_TEAM_CT && (get_user_flags(id) & FLAG))
	{
set_task(2.0, "CT_menu", id)

	 new iOrigin[ 3 ];
	 get_user_origin( id, iOrigin );

	 Create_BeamCylinder( iOrigin, 120, gCylinderSprite, 0, 0, 6, 16, 0, random( 0 ), random( 255 ), random( 0 ), 255, 0 );
	 Create_BeamCylinder( iOrigin, 120, gCylinderSprite, 0, 0, 6, 16, 0, random( 0 ), random( 255 ), random( 0 ), 255, 0 );
	 Create_BeamCylinder( iOrigin, 120, gCylinderSprite, 0, 0, 6, 16, 0, random( 0 ), random( 255 ), random( 0 ), 255, 0 );

copy(player_model[id], 31, VIP)

strip_user_weapons(id)
give_item(id, "weapon_knife")

new currentmodel[32];
fm_get_user_model(id, currentmodel, sizeof currentmodel - 1);

if(!equal(currentmodel, player_model[id]))
{
Task_Model(id + TASKID_MODEL)
g_counter += 0.1;
}

if(!task_exists(TASKID_SHOWHUD + id))
  set_task(0.2, "Task_ShowHUD", TASKID_SHOWHUD + id)

set_user_rendering(id,kRenderFxGlowShell,255,0,0,kRenderNormal,25)
	}
}

public T_menu(id)
{
if(!is_user_alive(id))
  return PLUGIN_HANDLED

client_cmd(id, "spk %s", MENU_POPUP)

	 new gmenu = menu_create("\y~::*V.I.P Menu*::~" , "Vip_Handler");
	 menu_additem(gmenu ,"\r255 \wHealth", "1" , 0);
	 menu_additem(gmenu ,"\r255 \wArmor", "2" , 0);
	 menu_additem(gmenu ,"\wGravity", "3" , 0);
	 menu_additem(gmenu ,"\wSpeed", "4" , 0);
	 menu_additem(gmenu ,"\wDeagle with \r2 ammo", "5" , 0);
	 menu_additem(gmenu ,"\wHegrenade", "6" , 0);
	 menu_additem(gmenu ,"\wNightVision (\rFor dark maps\w)", "7" , 0);

	 menu_setprop(gmenu , MPROP_EXIT , MEXIT_ALL);

	 menu_display(id , gmenu , 0);

return PLUGIN_CONTINUE
}

public CT_menu(id)
{
if(!is_user_alive(id))
  return PLUGIN_HANDLED

client_cmd(id, "spk %s", MENU_POPUP)

	 new gmenu = menu_create("\y~::*V.I.P Menu*::~" , "VipCt_Handler");
	 menu_additem(gmenu ,"\r255 \wHealth", "1" , 0);
	 menu_additem(gmenu ,"\r255 \wArmor", "2" , 0);
	 menu_additem(gmenu ,"\wGravity", "3" , 0);
	 menu_additem(gmenu ,"\wSpeed", "4" , 0);
	 menu_additem(gmenu ,"\wHegrenade", "5" , 0);
	 menu_additem(gmenu ,"\wNightVision (\rFor dark maps\w)", "6" , 0);

	 menu_setprop(gmenu , MPROP_EXIT , MEXIT_ALL);

	 menu_display(id , gmenu , 0);

return PLUGIN_CONTINUE
}

public Vip_Handler(id, gmenu, item, player)
{
   if (item == MENU_EXIT)
   {
	  menu_destroy(gmenu)
	  return PLUGIN_HANDLED
   }

   new data[6], iName[64]
   new access, callback
   menu_item_getinfo(gmenu, item, access, data, 5, iName, 63, callback)

   new key = str_to_num(data)

   switch(key)
   {
	  case 1:
	  {
client_cmd(id, "spk %s", MENU_OK)

set_user_health(id, 255)
client_printcolor(player, "/g[V.I.P]/y: You choosed /w255 /ghealth!")
	  }

	  case 2:
	  {
client_cmd(id, "spk %s", MENU_OK)

set_user_armor(id, 255)
client_printcolor(player, "/g[V.I.P]/y: You choosed /w255 /garmor!")
	  }

	  case 3:
	  {
client_cmd(id, "spk %s", MENU_OK)

new Float: gravity
gravity = get_pcvar_float(cvar_gravity) / 800

set_user_gravity(id, gravity)
client_printcolor(player, "/g[V.I.P]/y: You choosed /ggravity!")
	  }

	  case 4:
	  {
new Float: speed
speed = get_pcvar_float(cvar_speed)

client_cmd(id, "spk %s", MENU_OK)

set_user_maxspeed(id, speed)
client_printcolor(player, "/g[V.I.P]/y: You choosed /gspeed!")
	  }

	  case 5:
	  {
give_item(id, "weapon_deagle")

new weapon_id = find_ent_by_owner(-1, "weapon_deagle", id);
if(weapon_id)
{
cs_set_weapon_ammo(weapon_id, 2);
}

client_cmd(id, "spk %s", MENU_OK)

client_printcolor(player, "/g[V.I.P]/y: You choosed deagle with /g2 /ybullets!")
	  }

	  case 6:
	  {
give_item(id, "weapon_hegrenade")

client_cmd(id, "spk %s", MENU_OK)

client_printcolor(player, "/g[V.I.P]/y: You choosed /wexplosive /gHe /yGrenade!")
	  }

	  case 7:
	  {
cs_set_user_nvg(id)

client_cmd(id, "spk %s", MENU_OK)

client_printcolor(player, "/g[V.I.P]/y: You choosed nightvision!")
	  }
   }
   menu_destroy(gmenu)
   return PLUGIN_HANDLED;
}

public VipCt_Handler(id, gmenu, item, player)
{
   if (item == MENU_EXIT)
   {
	  menu_destroy(gmenu)
	  return PLUGIN_HANDLED
   }

   new data[6], iName[64]
   new access, callback
   menu_item_getinfo(gmenu, item, access, data, 5, iName, 63, callback)

   new key = str_to_num(data)

   switch(key)
   {
	  case 1:
	  {
client_cmd(id, "spk %s", MENU_OK)

set_user_health(id, 255)
client_printcolor(player, "/g[V.I.P]/y: You choosed /w255 /ghealth!")
	  }

	  case 2:
	  {
client_cmd(id, "spk %s", MENU_OK)

set_user_armor(id, 255)
client_printcolor(player, "/g[V.I.P]/y: You choosed /w255 /garmor!")
	  }

	  case 3:
	  {
client_cmd(id, "spk %s", MENU_OK)

new Float: gravity
gravity = get_pcvar_float(cvar_gravity) / 800

set_user_gravity(id, gravity)
client_printcolor(player, "/g[V.I.P]/y: You choosed /ggravity!")
	  }

	  case 4:
	  {
new Float: speed
speed = get_pcvar_float(cvar_speed)

client_cmd(id, "spk %s", MENU_OK)

set_user_maxspeed(id, speed)
client_printcolor(player, "/g[V.I.P]/y: You choosed /gspeed!")
	  }

	  case 5:
	  {
give_item(id, "weapon_hegrenade")

client_cmd(id, "spk %s", MENU_OK)

client_printcolor(player, "/g[V.I.P]/y: You choosed /wexplosive /gHe /yGrenade!")
	  }

	  case 6:
	  {
cs_set_user_nvg(id)

client_cmd(id, "spk %s", MENU_OK)

client_printcolor(player, "/g[V.I.P]/y: You choosed nightvision!")
	  }
   }
   menu_destroy(gmenu)
   return PLUGIN_HANDLED;
}

public Task_ShowHUD(task)
{
new id = task - TASKID_SHOWHUD

if(!is_user_alive(id))
return PLUGIN_HANDLED

static health, armour
health = get_user_health(id)
armour = get_user_armor(id)

set_hudmessage(150, 150, 150, 0.40, 0.92, 0, 0.0, 0.3, 0.0, 0.0)
ShowSyncHudMsg(id, g_hudsync , ".::*Health: %d -|V.I.P|- Armour: %d*::.", health, armour)

set_task(0.1, "Task_ShowHUD", TASKID_SHOWHUD + id)

return PLUGIN_CONTINUE
}

public client_PreThink(id)
{
	if(is_user_alive(id))
	{
		if(get_user_flags(id) & FLAG)
		{

			new oldbuttons = get_user_oldbutton(id);


			oldbuttons &= ~IN_JUMP;
			entity_set_int(id, EV_INT_oldbuttons, oldbuttons);
		}
	}
}  

public Task_Model(task)
{
new id = task - TASKID_MODEL

fm_set_user_model(id, player_model[id])
}

stock Create_BeamCylinder( origin[ 3 ], addrad, sprite, startfrate, framerate, life, width, amplitude, red, green, blue, brightness, speed )
{
message_begin( MSG_PVS, SVC_TEMPENTITY, origin );
write_byte( TE_BEAMCYLINDER );
write_coord( origin[ 0 ] );
write_coord( origin[ 1 ] );
write_coord( origin[ 2 ] );
write_coord( origin[ 0 ] );
write_coord( origin[ 1 ] );
write_coord( origin[ 2 ] + addrad );
write_short( sprite );
write_byte( startfrate );
write_byte( framerate );
write_byte(life );
write_byte( width );
write_byte( amplitude );
write_byte( red );
write_byte( green );
write_byte( blue );
write_byte( brightness );
write_byte( speed );
message_end();
}

stock te_sprite(id, Float:origin[3], sprite, scale, brightness)
{
message_begin(MSG_ONE, SVC_TEMPENTITY, _, id)
write_byte(TE_SPRITE)
write_coord(floatround(origin[0]))
write_coord(floatround(origin[1]))
write_coord(floatround(origin[2]))
write_short(sprite)
write_byte(scale)
write_byte(brightness)
message_end()
}

stock normalize(Float:fIn[3], Float:fOut[3], Float:fMul)
{
new Float:fLen = xs_vec_len(fIn)
xs_vec_copy(fIn, fOut)

fOut[0] /= fLen, fOut[1] /= fLen, fOut[2] /= fLen
fOut[0] *= fMul, fOut[1] *= fMul, fOut[2] *= fMul
}

public fw_SetClientKeyValue(id, infobuffer, key[], value[])
{  
if (g_model[id] && equal(key, "model"))
return FMRES_SUPERCEDE

return FMRES_IGNORED
}

public fw_ClientUserInfoChanged(id, infobuffer)
{  
if (!g_model[id])
return FMRES_IGNORED

new currentmodel[32];
fm_get_user_model(id, currentmodel, sizeof currentmodel - 1);

if(!equal(currentmodel, player_model[id]))
fm_set_user_model(id, player_model[id])

return FMRES_IGNORED
}

stock fm_set_user_model(player, modelname[])
{  
engfunc(EngFunc_SetClientKeyValue, player, engfunc(EngFunc_GetInfoKeyBuffer, player), "model", modelname)

g_model[player] = true
}

stock fm_get_user_model(player, model[], len)
{  
engfunc(EngFunc_InfoKeyValue, engfunc(EngFunc_GetInfoKeyBuffer, player), "model", model, len)
}

stock fm_reset_user_model(player)
{		
g_model[player] = false

dllfunc(DLLFunc_ClientUserInfoChanged, player, engfunc(EngFunc_GetInfoKeyBuffer, player))
}

stock client_printcolor(const id, const input[], any:...)
{
new count = 1, players[32];
static msg[191];
vformat(msg,190,input,3);
replace_all(msg,190,"/g","^4");// green txt
replace_all(msg,190,"/y","^1");// orange txt
replace_all(msg,190,"/ctr","^3");// team txt
replace_all(msg,190,"/w","^0");// team txt
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, SayTxT, _, players[i]);
write_byte(players[i]);
write_string(msg);
message_end();
}
}

  • +
  • -
  • 0

#2 adamsa1

    Profesjonalista

  • Zbanowany

Reputacja: 2
Nowy

  • Postów:217
  • GG:
  • Imię:Adam
  • Lokalizacja:Katowice
Offline

Napisano 30.03.2012 22:01

#include <amxmodx>
#include <amxmisc>
#include <fun>
#include <hamsandwich>
#include <cstrike>
#include <fakemeta>
#include <xs>
#include <engine>
#define FLAG ADMIN_IMMUNITY
new const VIP[] = "DeathRunVip"
new const VIP_MODEL[] = "models/player/DeathRunVip/DeathRunVip.mdl"
new const MENU_POPUP[] = "misc/DeathRunVip/vip_menu_popup.wav"
new const MENU_OK[] = "misc/DeathRunVip/vip_menu_ok.wav"
new const VIP_CONNECT[] = "misc/DeathRunVip/vip_connect.wav"
#define TASKID_SHOWHUD 2931
#define TASKID_MODEL 3810
new player_model[33][32]
new Float: g_counter
new bool: g_model[33]
new g_hudsync
new cvar_gravity
new cvar_speed
new SayTxT
new gCylinderSprite;
public plugin_precache()
{
precache_model(VIP_MODEL)
precache_sound(VIP_CONNECT)
precache_sound(MENU_POPUP)
precache_sound(MENU_OK)
gCylinderSprite = precache_model( "sprites/shockwave.spr" );
}
public plugin_init()
{
register_plugin("Deathrun V.I.P spolszczony", "1.0", "Spolszczony by adamsa1")
cvar_gravity = register_cvar("dr_vip_gravity", "500")
cvar_speed = register_cvar("dr_vip_speed", "500")
RegisterHam(Ham_Spawn, "player", "bacon_spawn", 1)
register_forward(FM_SetClientKeyValue, "fw_SetClientKeyValue")
register_forward(FM_ClientUserInfoChanged, "fw_ClientUserInfoChanged")
g_hudsync = CreateHudSyncObj()
SayTxT = get_user_msgid("SayText");
}
public client_connect(client)
{
if(get_user_flags(client) & FLAG)
{
client_cmd(client, "spk %s", VIP_CONNECT)
new name[32];
get_user_name(client, name, 31);
set_hudmessage( 0, 255, 0, -1.0, 0.29, 0, 6.0, 12.0 );
show_hudmessage( 0, "Vip %s Polaczyl sie z serwerem!.", name);
}
}
public bacon_spawn(id)
{
if (!is_user_alive(id))
return
static CsTeams: team ; team = cs_get_user_team(id)
if (team == CS_TEAM_T && (get_user_flags(id) & FLAG))
{
set_task(2.0, "T_menu", id)
new iOrigin[ 3 ];
get_user_origin( id, iOrigin );
Create_BeamCylinder( iOrigin, 120, gCylinderSprite, 0, 0, 6, 16, 0, random( 0 ), random( 255 ), random( 0 ), 255, 0 );
Create_BeamCylinder( iOrigin, 120, gCylinderSprite, 0, 0, 6, 16, 0, random( 0 ), random( 255 ), random( 0 ), 255, 0 );
Create_BeamCylinder( iOrigin, 120, gCylinderSprite, 0, 0, 6, 16, 0, random( 0 ), random( 255 ), random( 0 ), 255, 0 );
copy(player_model[id], 31, VIP)
new currentmodel[32];
fm_get_user_model(id, currentmodel, sizeof currentmodel - 1);
if(!equal(currentmodel, player_model[id]))
{
Task_Model(id + TASKID_MODEL)
g_counter += 0.1;
}
if(!task_exists(TASKID_SHOWHUD + id))
set_task(0.2, "Task_ShowHUD", TASKID_SHOWHUD + id)
set_user_rendering(id,kRenderFxGlowShell,255,0,0,kRenderNormal,25)
}
else if (team == CS_TEAM_CT && (get_user_flags(id) & FLAG))
{
set_task(2.0, "CT_menu", id)
new iOrigin[ 3 ];
get_user_origin( id, iOrigin );
Create_BeamCylinder( iOrigin, 120, gCylinderSprite, 0, 0, 6, 16, 0, random( 0 ), random( 255 ), random( 0 ), 255, 0 );
Create_BeamCylinder( iOrigin, 120, gCylinderSprite, 0, 0, 6, 16, 0, random( 0 ), random( 255 ), random( 0 ), 255, 0 );
Create_BeamCylinder( iOrigin, 120, gCylinderSprite, 0, 0, 6, 16, 0, random( 0 ), random( 255 ), random( 0 ), 255, 0 );
copy(player_model[id], 31, VIP)
strip_user_weapons(id)
give_item(id, "weapon_knife")
new currentmodel[32];
fm_get_user_model(id, currentmodel, sizeof currentmodel - 1);
if(!equal(currentmodel, player_model[id]))
{
Task_Model(id + TASKID_MODEL)
g_counter += 0.1;
}
if(!task_exists(TASKID_SHOWHUD + id))
set_task(0.2, "Task_ShowHUD", TASKID_SHOWHUD + id)
set_user_rendering(id,kRenderFxGlowShell,255,0,0,kRenderNormal,25)
}
}
public T_menu(id)
{
if(!is_user_alive(id))
return PLUGIN_HANDLED
client_cmd(id, "spk %s", MENU_POPUP)
new gmenu = menu_create("\y~::*V.I.P Menu*::~" , "Vip_Handler");
menu_additem(gmenu ,"\r35 \wHP", "1" , 0);
menu_additem(gmenu ,"\r35 \wKamizelki", "2" , 0);
menu_additem(gmenu ,"\wGrawitka", "3" , 0);
menu_additem(gmenu ,"\wPredkosc", "4" , 0);
menu_additem(gmenu ,"\wDeagle z \r2 nabojami[TYLKO DLA TT]", "5" , 0);
menu_additem(gmenu ,"\wNightVision (\rNa ciemnie mapy\w)", "7" , 0);
menu_setprop(gmenu , MPROP_EXIT , MEXIT_ALL);
menu_display(id , gmenu , 0);
return PLUGIN_CONTINUE
}
public CT_menu(id)
{
if(!is_user_alive(id))
return PLUGIN_HANDLED
client_cmd(id, "spk %s", MENU_POPUP)
new gmenu = menu_create("\y~::*V.I.P Menu*::~" , "VipCt_Handler");
menu_additem(gmenu ,"\r35 \wZycia", "1" , 0);
menu_additem(gmenu ,"\r35 \wKamizelki", "2" , 0);
menu_additem(gmenu ,"\wGrawitacja", "3" , 0);
menu_additem(gmenu ,"\wPredkosc", "4" , 0);
menu_additem(gmenu ,"\wNightVision (\rNa ciemnie mapy\w)", "6" , 0);
menu_setprop(gmenu , MPROP_EXIT , MEXIT_ALL);
menu_display(id , gmenu , 0);
return PLUGIN_CONTINUE
}
public Vip_Handler(id, gmenu, item, player)
{
if (item == MENU_EXIT)
{
menu_destroy(gmenu)
return PLUGIN_HANDLED
}
new data[6], iName[64]
new access, callback
menu_item_getinfo(gmenu, item, access, data, 5, iName, 63, callback)
new key = str_to_num(data)
switch(key)
{
case 1:
{
client_cmd(id, "spk %s", MENU_OK)
set_user_health(id, 35)
client_printcolor(player, "/g[V.I.P]/y: Wybrales /w35 /gHP!")
}
case 2:
{
client_cmd(id, "spk %s", MENU_OK)
set_user_armor(id, 35)
client_printcolor(player, "/g[V.I.P]/y: Wybrales /w35 /gkamizelki!")
}
case 3:
{
client_cmd(id, "spk %s", MENU_OK)
new Float: gravity
gravity = get_pcvar_float(cvar_gravity) / 800
set_user_gravity(id, gravity)
client_printcolor(player, "/g[V.I.P]/y: Wybrales /ggrawitacje!")
}
case 4:
{
new Float: speed
speed = get_pcvar_float(cvar_speed)
client_cmd(id, "spk %s", MENU_OK)
set_user_maxspeed(id, speed)
client_printcolor(player, "/g[V.I.P]/y: Wybrales /gpredkosc!")
}
case 5:
{
give_item(id, "weapon_deagle")
new weapon_id = find_ent_by_owner(-1, "weapon_deagle", id);
if(weapon_id)
{
cs_set_weapon_ammo(weapon_id, 2);
}
client_cmd(id, "spk %s", MENU_OK)
client_printcolor(player, "/g[V.I.P]/y: Wybrales deagla z /g2 /ynabojami")
}
case 6:
{
cs_set_user_nvg(id)
client_cmd(id, "spk %s", MENU_OK)
client_printcolor(player, "/g[V.I.P]/y: Wybrales Noktowizor!")
}
}
menu_destroy(gmenu)
return PLUGIN_HANDLED;
}
public VipCt_Handler(id, gmenu, item, player)
{
if (item == MENU_EXIT)
{
menu_destroy(gmenu)
return PLUGIN_HANDLED
}
new data[6], iName[64]
new access, callback
menu_item_getinfo(gmenu, item, access, data, 5, iName, 63, callback)
new key = str_to_num(data)
switch(key)
{
case 1:
{
client_cmd(id, "spk %s", MENU_OK)
set_user_health(id, 35)
client_printcolor(player, "/g[V.I.P]/y: Wybrales /w35 /ghp!")
}
case 2:
{
client_cmd(id, "spk %s", MENU_OK)
set_user_armor(id, 35)
client_printcolor(player, "/g[V.I.P]/y: Wybrales /w35 /gkamizelki!")
}
case 3:
{
client_cmd(id, "spk %s", MENU_OK)
new Float: gravity
gravity = get_pcvar_float(cvar_gravity) / 800
set_user_gravity(id, gravity)
client_printcolor(player, "/g[V.I.P]/y: Wybrales /ggrawitacje!")
}
case 4:
{
new Float: speed
speed = get_pcvar_float(cvar_speed)
client_cmd(id, "spk %s", MENU_OK)
set_user_maxspeed(id, speed)
client_printcolor(player, "/g[V.I.P]/y: Wybrales /gpredkosc!")
}
case 5:
{
cs_set_user_nvg(id)
client_cmd(id, "spk %s", MENU_OK)
client_printcolor(player, "/g[V.I.P]/y: Wybrales Noktowizor!")
}
}
menu_destroy(gmenu)
return PLUGIN_HANDLED;
}
public Task_ShowHUD(task)
{
new id = task - TASKID_SHOWHUD
if(!is_user_alive(id))
return PLUGIN_HANDLED
static health, armour
health = get_user_health(id)
armour = get_user_armor(id)
set_hudmessage(150, 150, 150, 0.40, 0.92, 0, 0.0, 0.3, 0.0, 0.0)
ShowSyncHudMsg(id, g_hudsync , ".::*Health: %d -|V.I.P|- Armour: %d*::.", health, armour)
set_task(0.1, "Task_ShowHUD", TASKID_SHOWHUD + id)
return PLUGIN_CONTINUE
}
public client_PreThink(id)
{
if(is_user_alive(id))
{
if(get_user_flags(id) & FLAG)
{
new oldbuttons = get_user_oldbutton(id);

oldbuttons &= ~IN_JUMP;
entity_set_int(id, EV_INT_oldbuttons, oldbuttons);
}
}
}
public Task_Model(task)
{
new id = task - TASKID_MODEL
fm_set_user_model(id, player_model[id])
}
stock Create_BeamCylinder( origin[ 3 ], addrad, sprite, startfrate, framerate, life, width, amplitude, red, green, blue, brightness, speed )
{
message_begin( MSG_PVS, SVC_TEMPENTITY, origin );
write_byte( TE_BEAMCYLINDER );
write_coord( origin[ 0 ] );
write_coord( origin[ 1 ] );
write_coord( origin[ 2 ] );
write_coord( origin[ 0 ] );
write_coord( origin[ 1 ] );
write_coord( origin[ 2 ] + addrad );
write_short( sprite );
write_byte( startfrate );
write_byte( framerate );
write_byte(life );
write_byte( width );
write_byte( amplitude );
write_byte( red );
write_byte( green );
write_byte( blue );
write_byte( brightness );
write_byte( speed );
message_end();
}
stock te_sprite(id, Float:origin[3], sprite, scale, brightness)
{
message_begin(MSG_ONE, SVC_TEMPENTITY, _, id)
write_byte(TE_SPRITE)
write_coord(floatround(origin[0]))
write_coord(floatround(origin[1]))
write_coord(floatround(origin[2]))
write_short(sprite)
write_byte(scale)
write_byte(brightness)
message_end()
}
stock normalize(Float:fIn[3], Float:fOut[3], Float:fMul)
{
new Float:fLen = xs_vec_len(fIn)
xs_vec_copy(fIn, fOut)
fOut[0] /= fLen, fOut[1] /= fLen, fOut[2] /= fLen
fOut[0] *= fMul, fOut[1] *= fMul, fOut[2] *= fMul
}
public fw_SetClientKeyValue(id, infobuffer, key[], value[])
{
if (g_model[id] && equal(key, "model"))
return FMRES_SUPERCEDE
return FMRES_IGNORED
}
public fw_ClientUserInfoChanged(id, infobuffer)
{
if (!g_model[id])
return FMRES_IGNORED
new currentmodel[32];
fm_get_user_model(id, currentmodel, sizeof currentmodel - 1);
if(!equal(currentmodel, player_model[id]))
fm_set_user_model(id, player_model[id])
return FMRES_IGNORED
}
stock fm_set_user_model(player, modelname[])
{
engfunc(EngFunc_SetClientKeyValue, player, engfunc(EngFunc_GetInfoKeyBuffer, player), "model", modelname)
g_model[player] = true
}
stock fm_get_user_model(player, model[], len)
{
engfunc(EngFunc_InfoKeyValue, engfunc(EngFunc_GetInfoKeyBuffer, player), "model", model, len)
}
stock fm_reset_user_model(player)
{
g_model[player] = false
dllfunc(DLLFunc_ClientUserInfoChanged, player, engfunc(EngFunc_GetInfoKeyBuffer, player))
}
stock client_printcolor(const id, const input[], any:...)
{
new count = 1, players[32];
static msg[191];
vformat(msg,190,input,3);
replace_all(msg,190,"/g","^4");// green txt
replace_all(msg,190,"/y","^1");// orange txt
replace_all(msg,190,"/ctr","^3");// team txt
replace_all(msg,190,"/w","^0");// team txt
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, SayTxT, _, players[i]);
write_byte(players[i]);
write_string(msg);
message_end();
}
}


#3 sNH.

    Czy MisieQ ukradł ciasteczko?

  • Power User

Reputacja: 297
Wszechwidzący

  • Postów:1070
  • Steam:steam
  • Imię:Bartek
  • Lokalizacja:Ełk
Offline

Napisano 30.03.2012 22:25

Proszę bardzo. Spolszczyłem ci go.

#include <amxmodx>
#include <amxmisc>
#include <fun>
#include <hamsandwich>
#include <cstrike>
#include <fakemeta>
#include <xs>
#include <engine>

#define FLAG ADMIN_IMMUNITY

new const VIP[] = "DeathRunVip"
new const VIP_MODEL[] = "models/player/DeathRunVip/DeathRunVip.mdl"

new const MENU_POPUP[] = "misc/DeathRunVip/vip_menu_popup.wav"
new const MENU_OK[] = "misc/DeathRunVip/vip_menu_ok.wav"
new const VIP_CONNECT[] = "misc/DeathRunVip/vip_connect.wav"

#define TASKID_SHOWHUD 2931
#define TASKID_MODEL 3810

new player_model[33][32]
new Float: g_counter
new bool: g_model[33]
new g_hudsync
new cvar_gravity
new cvar_speed
new SayTxT

new gCylinderSprite;

public plugin_precache()
{
precache_model(VIP_MODEL)
precache_sound(VIP_CONNECT)

precache_sound(MENU_POPUP)
precache_sound(MENU_OK)

gCylinderSprite = precache_model( "sprites/shockwave.spr" );
}

public plugin_init()
{
register_plugin("Deathrun V.I.P", "1.0", "DoviuX")

cvar_gravity = register_cvar("dr_vip_gravity", "500")
cvar_speed = register_cvar("dr_vip_speed", "500")

RegisterHam(Ham_Spawn, "player", "bacon_spawn", 1)
register_forward(FM_SetClientKeyValue, "fw_SetClientKeyValue")
register_forward(FM_ClientUserInfoChanged, "fw_ClientUserInfoChanged")

g_hudsync = CreateHudSyncObj()
SayTxT = get_user_msgid("SayText");
}

public client_connect(client)
{
if(get_user_flags(client) & FLAG)
{
client_cmd(client, "spk %s", VIP_CONNECT)

new name[32];
get_user_name(client, name, 31);
set_hudmessage( 0, 255, 0, -1.0, 0.29, 0, 6.0, 12.0 );
show_hudmessage( 0, "Vip %s wchodzi na serwer!.", name);
}
}

public bacon_spawn(id)
{
if (!is_user_alive(id))
return

static CsTeams: team ; team = cs_get_user_team(id)

if (team == CS_TEAM_T && (get_user_flags(id) & FLAG))
{
set_task(2.0, "T_menu", id)

new iOrigin[ 3 ];
get_user_origin( id, iOrigin );

Create_BeamCylinder( iOrigin, 120, gCylinderSprite, 0, 0, 6, 16, 0, random( 0 ), random( 255 ), random( 0 ), 255, 0 );
Create_BeamCylinder( iOrigin, 120, gCylinderSprite, 0, 0, 6, 16, 0, random( 0 ), random( 255 ), random( 0 ), 255, 0 );
Create_BeamCylinder( iOrigin, 120, gCylinderSprite, 0, 0, 6, 16, 0, random( 0 ), random( 255 ), random( 0 ), 255, 0 );

copy(player_model[id], 31, VIP)

new currentmodel[32];
fm_get_user_model(id, currentmodel, sizeof currentmodel - 1);

if(!equal(currentmodel, player_model[id]))
{
Task_Model(id + TASKID_MODEL)
g_counter += 0.1;
}

if(!task_exists(TASKID_SHOWHUD + id))
set_task(0.2, "Task_ShowHUD", TASKID_SHOWHUD + id)

set_user_rendering(id,kRenderFxGlowShell,255,0,0,kRenderNormal,25)
}
else if (team == CS_TEAM_CT && (get_user_flags(id) & FLAG))
{
set_task(2.0, "CT_menu", id)

new iOrigin[ 3 ];
get_user_origin( id, iOrigin );

Create_BeamCylinder( iOrigin, 120, gCylinderSprite, 0, 0, 6, 16, 0, random( 0 ), random( 255 ), random( 0 ), 255, 0 );
Create_BeamCylinder( iOrigin, 120, gCylinderSprite, 0, 0, 6, 16, 0, random( 0 ), random( 255 ), random( 0 ), 255, 0 );
Create_BeamCylinder( iOrigin, 120, gCylinderSprite, 0, 0, 6, 16, 0, random( 0 ), random( 255 ), random( 0 ), 255, 0 );

copy(player_model[id], 31, VIP)

strip_user_weapons(id)
give_item(id, "weapon_knife")

new currentmodel[32];
fm_get_user_model(id, currentmodel, sizeof currentmodel - 1);

if(!equal(currentmodel, player_model[id]))
{
Task_Model(id + TASKID_MODEL)
g_counter += 0.1;
}

if(!task_exists(TASKID_SHOWHUD + id))
set_task(0.2, "Task_ShowHUD", TASKID_SHOWHUD + id)

set_user_rendering(id,kRenderFxGlowShell,255,0,0,kRenderNormal,25)
}
}

public T_menu(id)
{
if(!is_user_alive(id))
return PLUGIN_HANDLED

client_cmd(id, "spk %s", MENU_POPUP)

new gmenu = menu_create("\y~::*V.I.P Menu*::~" , "Vip_Handler");
menu_additem(gmenu ,"\r255 \wHealth", "1" , 0);
menu_additem(gmenu ,"\r255 \wArmor", "2" , 0);
menu_additem(gmenu ,"\wGravity", "3" , 0);
menu_additem(gmenu ,"\wSpeed", "4" , 0);
menu_additem(gmenu ,"\wDeagle with \r2 ammo", "5" , 0);
menu_additem(gmenu ,"\wHegrenade", "6" , 0);
menu_additem(gmenu ,"\wNightVision (\rFor dark maps\w)", "7" , 0);

menu_setprop(gmenu , MPROP_EXIT , MEXIT_ALL);

menu_display(id , gmenu , 0);

return PLUGIN_CONTINUE
}

public CT_menu(id)
{
if(!is_user_alive(id))
return PLUGIN_HANDLED

client_cmd(id, "spk %s", MENU_POPUP)

new gmenu = menu_create("\y~::*V.I.P Menu*::~" , "VipCt_Handler");
menu_additem(gmenu ,"\r255 \wZycie", "1" , 0);
menu_additem(gmenu ,"\r255 \wArmor", "2" , 0);
menu_additem(gmenu ,"\wGravitacja", "3" , 0);
menu_additem(gmenu ,"\wPrzyspieszenie", "4" , 0);
menu_additem(gmenu ,"\wDeagle z 2 nabojami", "5" , 0);
menu_additem(gmenu ,"\wNoktowizor (\rNa ciemne mapy\w)", "6" , 0);

menu_setprop(gmenu , MPROP_EXIT , MEXIT_ALL);

menu_display(id , gmenu , 0);

return PLUGIN_CONTINUE
}

public Vip_Handler(id, gmenu, item, player)
{
if (item == MENU_EXIT)
{
menu_destroy(gmenu)
return PLUGIN_HANDLED
}

new data[6], iName[64]
new access, callback
menu_item_getinfo(gmenu, item, access, data, 5, iName, 63, callback)

new key = str_to_num(data)

switch(key)
{
case 1:
{
client_cmd(id, "spk %s", MENU_OK)

set_user_health(id, 35)
client_printcolor(player, "/g[V.I.P]/y: Wybrales /w35 /gHP!")
}

case 2:
{
client_cmd(id, "spk %s", MENU_OK)

set_user_armor(id, 35)
client_printcolor(player, "/g[V.I.P]/y: Wybrales /w35 /gArmoru!")
}

case 3:
{
client_cmd(id, "spk %s", MENU_OK)

new Float: gravity
gravity = get_pcvar_float(cvar_gravity) / 800

set_user_gravity(id, gravity)
client_printcolor(player, "/g[V.I.P]/y: Wybrales /gGravitacje!")
}

case 4:
{
new Float: speed
speed = get_pcvar_float(cvar_speed)

client_cmd(id, "spk %s", MENU_OK)

set_user_maxspeed(id, speed)
client_printcolor(player, "/g[V.I.P]/y: Wybrales /gPrzyspieszenie!")
}

case 5:
{
give_item(id, "weapon_deagle")

new weapon_id = find_ent_by_owner(-1, "weapon_deagle", id);
if(weapon_id)
{
cs_set_weapon_ammo(weapon_id, 2);
}

client_cmd(id, "spk %s", MENU_OK)

client_printcolor(player, "/g[V.I.P]/y: Wybrales deagle z /g2 /ynabojami!")
}

case 6:
{
cs_set_user_nvg(id)

client_cmd(id, "spk %s", MENU_OK)

client_printcolor(player, "/g[V.I.P]/y: Wybrales noktowizor!")
}
}
menu_destroy(gmenu)
return PLUGIN_HANDLED;
}

public VipCt_Handler(id, gmenu, item, player)
{
if (item == MENU_EXIT)
{
menu_destroy(gmenu)
return PLUGIN_HANDLED
}

new data[6], iName[64]
new access, callback
menu_item_getinfo(gmenu, item, access, data, 5, iName, 63, callback)

new key = str_to_num(data)

switch(key)
{
case 1:
{
client_cmd(id, "spk %s", MENU_OK)

set_user_health(id, 35)
client_printcolor(player, "/g[V.I.P]/y: Wybrales /w35 /gHP!")
}

case 2:
{
client_cmd(id, "spk %s", MENU_OK)

set_user_armor(id, 35)
client_printcolor(player, "/g[V.I.P]/y: Wybrales /w35 /gKamizelki!")
}

case 3:
{
client_cmd(id, "spk %s", MENU_OK)

new Float: gravity
gravity = get_pcvar_float(cvar_gravity) / 800

set_user_gravity(id, gravity)
client_printcolor(player, "/g[V.I.P]/y: Wybrales /gGravitacje!")
}

case 4:
{
new Float: speed
speed = get_pcvar_float(cvar_speed)

client_cmd(id, "spk %s", MENU_OK)

set_user_maxspeed(id, speed)
client_printcolor(player, "/g[V.I.P]/y: Wybrales /gPrzyspieszenie!")
}

case 5:
{
give_item(id, "weapon_deagle")

new weapon_id = find_ent_by_owner(-1, "weapon_deagle", id);
if(weapon_id)
{
cs_set_weapon_ammo(weapon_id, 2);
}

client_cmd(id, "spk %s", MENU_OK)

client_printcolor(player, "/g[V.I.P]/y: Wybrales deagle z /g2 /ynabojami!")
}

case 6:
{
cs_set_user_nvg(id)

client_cmd(id, "spk %s", MENU_OK)

client_printcolor(player, "/g[V.I.P]/y: Wybrales noktowizor!")
}
}
menu_destroy(gmenu)
return PLUGIN_HANDLED;
}

public Task_ShowHUD(task)
{
new id = task - TASKID_SHOWHUD

if(!is_user_alive(id))
return PLUGIN_HANDLED

static health, armour
health = get_user_health(id)
armour = get_user_armor(id)

set_hudmessage(150, 150, 150, 0.40, 0.92, 0, 0.0, 0.3, 0.0, 0.0)
ShowSyncHudMsg(id, g_hudsync , ".::*Zycie: %d -|V.I.P|- Armor: %d*::.", health, armour)

set_task(0.1, "Task_ShowHUD", TASKID_SHOWHUD + id)

return PLUGIN_CONTINUE
}

public client_PreThink(id)
{
if(is_user_alive(id))
{
if(get_user_flags(id) & FLAG)
{

new oldbuttons = get_user_oldbutton(id);


oldbuttons &= ~IN_JUMP;
entity_set_int(id, EV_INT_oldbuttons, oldbuttons);
}
}
}

public Task_Model(task)
{
new id = task - TASKID_MODEL

fm_set_user_model(id, player_model[id])
}

stock Create_BeamCylinder( origin[ 3 ], addrad, sprite, startfrate, framerate, life, width, amplitude, red, green, blue, brightness, speed )
{
message_begin( MSG_PVS, SVC_TEMPENTITY, origin );
write_byte( TE_BEAMCYLINDER );
write_coord( origin[ 0 ] );
write_coord( origin[ 1 ] );
write_coord( origin[ 2 ] );
write_coord( origin[ 0 ] );
write_coord( origin[ 1 ] );
write_coord( origin[ 2 ] + addrad );
write_short( sprite );
write_byte( startfrate );
write_byte( framerate );
write_byte(life );
write_byte( width );
write_byte( amplitude );
write_byte( red );
write_byte( green );
write_byte( blue );
write_byte( brightness );
write_byte( speed );
message_end();
}

stock te_sprite(id, Float:origin[3], sprite, scale, brightness)
{
message_begin(MSG_ONE, SVC_TEMPENTITY, _, id)
write_byte(TE_SPRITE)
write_coord(floatround(origin[0]))
write_coord(floatround(origin[1]))
write_coord(floatround(origin[2]))
write_short(sprite)
write_byte(scale)
write_byte(brightness)
message_end()
}

stock normalize(Float:fIn[3], Float:fOut[3], Float:fMul)
{
new Float:fLen = xs_vec_len(fIn)
xs_vec_copy(fIn, fOut)

fOut[0] /= fLen, fOut[1] /= fLen, fOut[2] /= fLen
fOut[0] *= fMul, fOut[1] *= fMul, fOut[2] *= fMul
}

public fw_SetClientKeyValue(id, infobuffer, key[], value[])
{
if (g_model[id] && equal(key, "model"))
return FMRES_SUPERCEDE

return FMRES_IGNORED
}

public fw_ClientUserInfoChanged(id, infobuffer)
{
if (!g_model[id])
return FMRES_IGNORED

new currentmodel[32];
fm_get_user_model(id, currentmodel, sizeof currentmodel - 1);

if(!equal(currentmodel, player_model[id]))
fm_set_user_model(id, player_model[id])

return FMRES_IGNORED
}

stock fm_set_user_model(player, modelname[])
{
engfunc(EngFunc_SetClientKeyValue, player, engfunc(EngFunc_GetInfoKeyBuffer, player), "model", modelname)

g_model[player] = true
}

stock fm_get_user_model(player, model[], len)
{
engfunc(EngFunc_InfoKeyValue, engfunc(EngFunc_GetInfoKeyBuffer, player), "model", model, len)
}

stock fm_reset_user_model(player)
{
g_model[player] = false

dllfunc(DLLFunc_ClientUserInfoChanged, player, engfunc(EngFunc_GetInfoKeyBuffer, player))
}

stock client_printcolor(const id, const input[], any:...)
{
new count = 1, players[32];
static msg[191];
vformat(msg,190,input,3);
replace_all(msg,190,"/g","^4");// green txt
replace_all(msg,190,"/y","^1");// orange txt
replace_all(msg,190,"/ctr","^3");// team txt
replace_all(msg,190,"/w","^0");// team txt
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, SayTxT, _, players[i]);
write_byte(players[i]);
write_string(msg);
message_end();
}
}

  • +
  • -
  • 0





Również z jednym lub większą ilością słów kluczowych: Modyfikacja

Użytkownicy przeglądający ten temat: 0

0 użytkowników, 0 gości, 0 anonimowych