Skocz do zawartości

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
Nowy Plugin

Prośba o plugin Vip-a na FFA

Nowy Plugin

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

#1 ILikeSpam

    Profesjonalista

  • Użytkownik

Reputacja: 29
Życzliwy

  • Postów:190
  • Lokalizacja:Wieś
Offline

Napisano 17.10.2011 17:53

Witam Serdecznie.

Prosiłbym o napisanie pluginu Vipa na FFA, który miał by takie przywileje jak:
5 HP za killa, 15 HP za zabójstwo z hs
400 $ za killa, 500 $ za zabójstwo z hs
Podwójny skok
Granaty: Flesh i smoke
Napis VIP w scoreboard

Użytkownik ILikeSpam edytował ten post 17.10.2011 17:54

  • +
  • -
  • 0

#2 ;((

    Super Hero

  • Użytkownik

Reputacja: 347
Wszechpomocny

  • Postów:1 157
  • Lokalizacja:Aha
Offline

Napisano 17.10.2011 18:12

try


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

#define PLUGIN "VIP"
#define VERSION "1.0"
#define AUTHOR "AMXX.PL"

new moze_skoczyc[33];
new mpd, mkb, mhb
new maxplayers
new health_add
new health_hs_add
new health_max
new nKiller
new nKiller_hp
new nHp_add
new nHp_max

#define ADMIN_VIP ADMIN_LEVEL_H
#define SCOREATTRIB_NONE 0
#define SCOREATTRIB_DEAD ( 1 << 0 )
#define SCOREATTRIB_BOMB ( 1 << 1 )
#define SCOREATTRIB_VIP ( 1 << 2 )

public plugin_init(){
register_plugin(PLUGIN, VERSION, AUTHOR);

RegisterHam(Ham_Spawn, "player", "respawn", 1);
register_forward(FM_CmdStart, "CmdStart");
register_message( get_user_msgid( "ScoreAttrib" ), "MessageScoreAttrib" );
mpd = register_cvar("money_per_damage","0")
mkb = register_cvar("money_kill_bonus","400")
mhb = register_cvar("money_hs_bonus","500")
health_add = register_cvar("amx_vip_hp", "5")
health_hs_add = register_cvar("amx_vip_hp_hs", "15")
health_max = register_cvar("amx_vip_max_hp", "100")

}

public respawn(id)
{
if(is_user_alive(id) & get_user_flags(id) && ADMIN_LEVEL_H)
give_item(id, "weapon_flashbang")
give_item(id, "weapon_smokegrenade")
}
public CmdStart(id, uc_handle)
{
static moze_skoczyc;

if(!is_user_alive(id) || !(get_user_flags(id)&ADMIN_LEVEL_H))
return FMRES_IGNORED;

new button = get_uc(uc_handle, UC_Buttons);
new oldbutton = pev(id, pev_oldbuttons);
new flags = pev(id, pev_flags);
if((button & IN_JUMP) && !(flags & FL_ONGROUND) && !(oldbutton & IN_JUMP) && moze_skoczyc & (1<<id))
{
moze_skoczyc &= ~(1<<id)
new Float:velocity[3];
pev(id, pev_velocity, velocity);
velocity[2] = random_float(265.0,285.0);
set_pev(id, pev_velocity, velocity);
}
else if(flags & FL_ONGROUND){
moze_skoczyc |= (1<<id)
}

return FMRES_IGNORED;
}


public MessageScoreAttrib( iMsgID, iDest, iReceiver )
{
new iPlayer = get_msg_arg_int( 1 );
if( is_user_connected( iPlayer ) && ( get_user_flags( iPlayer ) & ADMIN_VIP ) )
{
set_msg_arg_int( 2, ARG_BYTE, is_user_alive( iPlayer ) ? SCOREATTRIB_VIP : SCOREATTRIB_DEAD );
}
}

public Damage(id)
{
new weapon, hitpoint, attacker = get_user_attacker(id,weapon,hitpoint)
if(attacker<=maxplayers && is_user_alive(attacker) && attacker!=id)
if (get_user_flags(attacker) & ADMIN_LEVEL_H)
{
new money = read_data(2) * get_pcvar_num(mpd)
if(hitpoint==1) money += get_pcvar_num(mhb)
cs_set_user_money(attacker,cs_get_user_money(attacker) + money)
}
}

public death_msg()
{
if(read_data(1)<=maxplayers && read_data(1) && read_data(1)!=read_data(2)) cs_set_user_money(read_data(1),cs_get_user_money(read_data(1)) + get_pcvar_num(mkb) - 300)
}


public hook_death()
{
// Killer id
nKiller = read_data(1)

if ( (read_data(3) == 1) && (read_data(5) == 0) )
{
nHp_add = get_pcvar_num (health_hs_add)
}
else
nHp_add = get_pcvar_num (health_add)
nHp_max = get_pcvar_num (health_max)
// Updating Killer HP
if(!(get_user_flags(nKiller) & ADMIN_LEVEL_H))
return;

nKiller_hp = get_user_health(nKiller)
nKiller_hp += nHp_add
// Maximum HP check
if (nKiller_hp > nHp_max) nKiller_hp = nHp_max
set_user_health(nKiller, nKiller_hp)
// Hud message "Healed +15/+30 hp"
set_hudmessage(0, 255, 0, -1.0, 0.15, 0, 1.0, 1.0, 0.1, 0.1, -1)
show_hudmessage(nKiller, "Healed +%d hp", nHp_add)
// Screen fading
message_begin(MSG_ONE, get_user_msgid("ScreenFade"), {0,0,0}, nKiller)
write_short(1<<10)
write_short(1<<10)
write_short(0x0000)
write_byte(0)
write_byte(0)
write_byte(200)
write_byte(75)
message_end()

}

  • +
  • -
  • 1

#3 ILikeSpam

    Profesjonalista

  • Autor tematu
  • Użytkownik

Reputacja: 29
Życzliwy

  • Postów:190
  • Lokalizacja:Wieś
Offline

Napisano 17.10.2011 19:58

Nie działa opcja z dodawaniem HP po zabiciu.

Prosiłbym jeszcze o dodaniu info o vipach po wpisaniu na say "/vips" oraz informacje o Vipie po wpisaniu "vip", które będę czytane z cstrike/vip.txt

PS. Otrzymujesz +a
  • +
  • -
  • 0

#4 ;((

    Super Hero

  • Użytkownik

Reputacja: 347
Wszechpomocny

  • Postów:1 157
  • Lokalizacja:Aha
Offline

Napisano 18.10.2011 15:11

try


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

#define PLUGIN "VIP"
#define VERSION "1.0"
#define AUTHOR "AMXX.PL"

#define SCOREATTRIB_NONE 0
#define SCOREATTRIB_DEAD ( 1 << 0 )
#define SCOREATTRIB_BOMB ( 1 << 1 )
#define SCOREATTRIB_VIP ( 1 << 2 )

new mpd, mkb, mhb
new maxplayers

public plugin_init(){
register_plugin(PLUGIN, VERSION, AUTHOR);

register_clcmd("say /vips", "vips")
register_clcmd("say_team /vips", "vips")
register_clcmd("say /vip", "vip")
register_clcmd("say_team /vip", "vip")

register_event("Damage","Damage","b")
RegisterHam(Ham_Spawn, "player", "respawn", 1);
register_event("DeathMsg", "DeathMsg", "a")
register_event("DeathMsg", "death_msg","a")
register_forward(FM_CmdStart, "CmdStart");
register_message( get_user_msgid( "ScoreAttrib" ), "MessageScoreAttrib" );
mpd = register_cvar("money_per_damage","0")
mkb = register_cvar("money_kill_bonus","400")
mhb = register_cvar("money_hs_bonus","500")

}

public respawn(id)
{
if(is_user_alive(id) & get_user_flags(id) && ADMIN_LEVEL_H)
give_item(id, "weapon_flashbang")
give_item(id, "weapon_smokegrenade")
}

public CmdStart(id, uc_handle)
{
static moze_skoczyc;

if(!is_user_alive(id) || !(get_user_flags(id)& ADMIN_LEVEL_H))
return FMRES_IGNORED;

new button = get_uc(uc_handle, UC_Buttons);
new oldbutton = pev(id, pev_oldbuttons);
new flags = pev(id, pev_flags);
if((button & IN_JUMP) && !(flags & FL_ONGROUND) && !(oldbutton & IN_JUMP) && moze_skoczyc & (1<<id))
{
moze_skoczyc &= ~(1<<id)
new Float:velocity[3];
pev(id, pev_velocity, velocity);
velocity[2] = random_float(265.0,285.0);
set_pev(id, pev_velocity, velocity);
}
else if(flags & FL_ONGROUND){
moze_skoczyc |= (1<<id)
}

return FMRES_IGNORED;
}


public MessageScoreAttrib( iMsgID, iDest, iReceiver )
{
new iPlayer = get_msg_arg_int( 1 );
if( is_user_connected( iPlayer ) && ( get_user_flags( iPlayer ) & ADMIN_LEVEL_H ) )
{
set_msg_arg_int( 2, ARG_BYTE, is_user_alive( iPlayer ) ? SCOREATTRIB_VIP : SCOREATTRIB_DEAD );
}
}

public Damage(id)
{
new weapon, hitpoint, attacker = get_user_attacker(id,weapon,hitpoint)
if(attacker<=maxplayers && is_user_alive(attacker) && attacker!=id)
if (get_user_flags(attacker) & ADMIN_LEVEL_H)
{
new money = read_data(2) * get_pcvar_num(mpd)
if(hitpoint==1) money += get_pcvar_num(mhb)
cs_set_user_money(attacker,cs_get_user_money(attacker) + money)
}
}

public death_msg()
{
if(read_data(1)<=maxplayers && read_data(1) && read_data(1)!=read_data(2)) cs_set_user_money(read_data(1),cs_get_user_money(read_data(1)) + get_pcvar_num(mkb) - 300)
}




public DeathMsg()
{
new kid = read_data(1)
new hs = read_data(3)

if(is_user_connected(kid) && is_user_alive(kid))
{
if(hs)
set_user_health(kid, get_user_health(kid) + 15)
else
set_user_health(kid, get_user_health(kid) + 5)
}
}


public vips(id) {

new mVips = menu_create("Vips", "mh_Vips")
new mcbVips = menu_makecallback("mcb_Vips")
for(new i=1;i<33;i++){
if(is_user_connected(i) && (get_user_flags(i) & ADMIN_LEVEL_H)){
new name[33]
get_user_name(i,name,32)
menu_additem(mVips, name, "ma_Vips", ADMIN_LEVEL_H, mcbVips)
}
}

menu_display(id, mVips, 0)
}

public vip(id) {
show_motd(id, "vip.txt", "Informacje o przywilejach VIPa");
}


  • +
  • -
  • 1

#5 ILikeSpam

    Profesjonalista

  • Autor tematu
  • Użytkownik

Reputacja: 29
Życzliwy

  • Postów:190
  • Lokalizacja:Wieś
Offline

Napisano 18.10.2011 15:39

Dwa błędy:
Nic się nie wyświetla po wpisaniu /vips
Wszyscy mają vipa... Oprócz napisu w scoreboard
  • +
  • -
  • 0

#6 ;((

    Super Hero

  • Użytkownik

Reputacja: 347
Wszechpomocny

  • Postów:1 157
  • Lokalizacja:Aha
Offline

Napisano 18.10.2011 19:10

try


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

#define PLUGIN "VIP"
#define VERSION "1.0"
#define AUTHOR "AMXX.PL"

#define SCOREATTRIB_NONE 0
#define SCOREATTRIB_DEAD ( 1 << 0 )
#define SCOREATTRIB_BOMB ( 1 << 1 )
#define SCOREATTRIB_VIP ( 1 << 2 )

new mpd, mkb, mhb
new maxplayers

public plugin_init(){
register_plugin(PLUGIN, VERSION, AUTHOR);

register_clcmd("say /vips", "vips")
register_clcmd("say_team /vips", "vips")
register_clcmd("say /vip", "vip")
register_clcmd("say_team /vip", "vip")

register_event("Damage","Damage","b")
RegisterHam(Ham_Spawn, "player", "respawn", 1);
register_event("DeathMsg", "DeathMsg", "a")
register_event("DeathMsg", "death_msg","a")
register_forward(FM_CmdStart, "CmdStart");
register_message( get_user_msgid( "ScoreAttrib" ), "MessageScoreAttrib" );
mpd = register_cvar("money_per_damage","0")
mkb = register_cvar("money_kill_bonus","400")
mhb = register_cvar("money_hs_bonus","500")

}

public respawn(id)
{
if(is_user_alive(id) & get_user_flags(id) && ADMIN_LEVEL_H)
give_item(id, "weapon_flashbang")
give_item(id, "weapon_smokegrenade")
}

public CmdStart(id, uc_handle)
{
static moze_skoczyc;

if(is_user_alive(id) || (get_user_flags(id) & ADMIN_LEVEL_H))
return FMRES_IGNORED;

new button = get_uc(uc_handle, UC_Buttons);
new oldbutton = pev(id, pev_oldbuttons);
new flags = pev(id, pev_flags);
if((button & IN_JUMP) && !(flags & FL_ONGROUND) && !(oldbutton & IN_JUMP) && moze_skoczyc & (1<<id))
{
moze_skoczyc &= ~(1<<id)
new Float:velocity[3];
pev(id, pev_velocity, velocity);
velocity[2] = random_float(265.0,285.0);
set_pev(id, pev_velocity, velocity);
}
else if(flags & FL_ONGROUND){
moze_skoczyc |= (1<<id)
}

return FMRES_IGNORED;
}


public MessageScoreAttrib( iMsgID, iDest, iReceiver )
{
new iPlayer = get_msg_arg_int( 1 );
if( is_user_connected( iPlayer ) && ( get_user_flags( iPlayer ) & ADMIN_LEVEL_H ) )
{
set_msg_arg_int( 2, ARG_BYTE, is_user_alive( iPlayer ) ? SCOREATTRIB_VIP : SCOREATTRIB_DEAD );
}
}

public Damage(id)
{
new weapon, hitpoint, attacker = get_user_attacker(id,weapon,hitpoint)
if(attacker<=maxplayers && is_user_alive(attacker) && attacker!=id)
if (get_user_flags(attacker) & ADMIN_LEVEL_H)
{
new money = read_data(2) * get_pcvar_num(mpd)
if(hitpoint==1) money += get_pcvar_num(mhb)
cs_set_user_money(attacker,cs_get_user_money(attacker) + money)
}
}

public death_msg()
{
if(read_data(1)<=maxplayers && read_data(1) && read_data(1)!=read_data(2)) cs_set_user_money(read_data(1),cs_get_user_money(read_data(1)) + get_pcvar_num(mkb) - 300)
}




public DeathMsg()
{
new kid = read_data(1)
new hs = read_data(3)

if(is_user_connected(kid) && is_user_alive(kid) && get_user_flags(kid) & ADMIN_LEVEL_H)
{
if(hs)
set_user_health(kid, get_user_health(kid) + 15)
else
set_user_health(kid, get_user_health(kid) + 5)
}
}


public vips(id) {

new mVips = menu_create("Vips", "mh_Vips")
new mcbVips = menu_makecallback("mcb_Vips")
for(new i=1;i<33;i++){
if(is_user_connected(i) && (get_user_flags(i) & ADMIN_LEVEL_H)){
new name[33]
get_user_name(i,name,32)
menu_additem(mVips, name, "ma_Vips", ADMIN_ALL, mcbVips)
}
}

menu_display(id, mVips, 0)
}

public vip(id) {
show_motd(id, "vip.txt", "Informacje o przywilejach VIPa");
}


  • +
  • -
  • 0

#7 ILikeSpam

    Profesjonalista

  • Autor tematu
  • Użytkownik

Reputacja: 29
Życzliwy

  • Postów:190
  • Lokalizacja:Wieś
Offline

Napisano 22.10.2011 10:07

Jest jeszcze gorzej.
Te same błędy co wcześniej i jeszcze podwójny skok nie działa.

Refresh

Refresh
  • +
  • -
  • 0





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

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

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