User
Pass
2FA
 
 

Probleme script

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Freakz Forum Index -> Trash Bin -> CS 2006-2019 (Archived) -> Counter-Strike: Help zone
Author Message1194
Sponge*BoB.

[Mentally Stable]



Status: Offline
(since 13-10-2016 11:59)
Joined: 24 Jul 2016
Posts: 84, Topics: 7
Location: Romania

Reputation: 6.8

Post Posted: 29-07-2016, 14:10:15 | Translate post to: ... (Click for more languages)

Buna Ziua , am inceput sa lucrez la un script mai exact un meniu doar pentru vip , am sa postez aici sursa si as dori sa mi se adauge la furien unde e katana, sa se puna super knife-ul ,locatia lui ii in cstrike/models/v_knife_frfreakz.mdl , sa fie folosit doar de cei care au flag-ul "Q" , si sa mai poata avea 2 arme cand apesi 1 ,de asemenea sa poata fi accessat doar de vipi

sursa :

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


const MAX_PLAYERS = 32

new g_bHasAutoBhop[MAX_PLAYERS+1]
new jumpnum[33] = 0
new bool:dojump[33] = false



public plugin_init()
{
register_plugin( "furiens_shop", "1.2", "Gae si Jupi");
RegisterHam(Ham_Player_Jump, "player", "Ham_CBasePlayer_Jump_Pre")
RegisterHam(Ham_Spawn, "player", "Player_Spawn", 1)
register_logevent("round_end", 2, "1=Round_End");
register_clcmd("say /vip", "shopmenu")

register_dictionary( "shop_furiens.txt");
}

public Player_Spawn(id)
{
g_bHasAutoBhop[id] = false
jumpnum[id] = 0
dojump[id] = false
}

public shopmenu(id)
{
if(is_user_alive(id) && cs_get_user_team( id ) == CS_TEAM_CT)
{
new Menu = menu_create("Anti-Furien Shop VIP :", "montrer_menu")
menu_additem(Menu, "HE Granade [300 $]", "1", 0)
menu_additem(Menu, "Flash Granade[200 $]", "2", 0)
menu_additem(Menu, "Smoke Granade [200 $]", "3", 0)
menu_additem(Menu, "NightVision [10000 $]", "4", 0)
menu_additem(Menu, "+50 HP [800 $]", "5", 0)
menu_additem(Menu, "+200 Armure [1500$]", "6", 0)
menu_additem(Menu, "MachineGun [10000 $]", "7", 0)


menu_setprop(Menu,MPROP_EXITNAME,"Exit")
menu_setprop(Menu, MPROP_EXIT, MEXIT_ALL)

menu_display(id, Menu, 0)
}
if(is_user_alive(id) && cs_get_user_team( id ) == CS_TEAM_T)
{
new Menu2 = menu_create("Furien Shop VIP:", "tero_menu")
menu_additem(Menu2, "Katana [3000 $]", "1", 0)
menu_additem(Menu2, "He Granade [300 $]", "2", 0)
menu_additem(Menu2, "Flash Granade [200 $]", "3", 0)
menu_additem(Menu2, "Smoke Granade [200 $]", "4", 0)
menu_additem(Menu2, "+50 HP [800 $]", "5", 0)
menu_additem(Menu2, "+200 Armure [1500 $]", "6", 0)

menu_setprop(Menu2,MPROP_EXITNAME,"Exit")
menu_setprop(Menu2, MPROP_EXIT, MEXIT_ALL)

menu_display(id, Menu2, 0)
}
}
public montrer_menu(id, Menu, item)
{
if (item == MENU_EXIT)
{
menu_destroy(Menu)
return PLUGIN_HANDLED
}

// variables
new iData[6];
new iAccess;
new iCallback;
new iName[64];
menu_item_getinfo(Menu, item, iAccess, iData, 5, iName, 63, iCallback)

switch (str_to_num(iData))
{
case 1:
{
if(cs_get_user_money(id) < 300)
{
client_print( id, print_chat,"%L",id, "SHOP_ITEM_LOST");
//return PLUGIN_HANDLED;
client_print(id, print_chat, "%L", id, "SHOP_ITEM_DEATH");
return PLUGIN_HANDLED;
}
else
{
cs_take_user_money(id, 300)
give_item(id, "weapon_hegrenade")
client_print( id, print_chat,"%L",id, "SHOP_ITEMCT_1");
}
}
case 2:
{
if(cs_get_user_money(id) < 200)
{
client_print(id, print_chat,"%L",id, "SHOP_ITEM_LOST");
return PLUGIN_HANDLED;
}
else
{

cs_take_user_money(id, 200)
give_item(id, "weapon_flashbang")
client_print( id, print_chat,"%L",id, "SHOP_ITEMCT_2");

}
}
case 3:
{
if(cs_get_user_money(id) < 200)
{
client_print( id, print_chat,"%L",id, "SHOP_ITEM_LOST");
return PLUGIN_HANDLED;
}
else
{
cs_take_user_money(id, 200)
give_item(id, "weapon_smokegrenade")
client_print( id, print_chat,"%L",id, "SHOP_ITEMCT_3");
}
}
case 4:
{
if(cs_get_user_money(id) < 10000)
{
client_print( id, print_chat,"%L",id, "SHOP_ITEM_LOST");
return PLUGIN_HANDLED;
}
else
{
cs_set_user_nvg(id,1)
cs_take_user_money(id, 10000)
client_print( id, print_chat,"%L",id, "SHOP_ITEMCT_4");
}
}

case 5:
{
if(cs_get_user_money(id) < 800)
{
client_print(id, print_chat,"%L",id, "SHOP_ITEM_LOST");
return PLUGIN_HANDLED;
}
else
{
cs_take_user_money(id, 800)
set_user_health( id, get_user_health(id) + 50 );
client_print( id, print_chat,"%L",id, "SHOP_ITEMCT_5");
}
}
case 6:
{
if(cs_get_user_money(id) < 1500)
{
client_print( id, print_chat,"%L",id, "SHOP_ITEM_LOST");
return PLUGIN_HANDLED;
}
else
{
cs_take_user_money(id, 1500)
set_user_armor(id, get_user_armor(id) + 300);
client_print(id, print_chat,"%L",id, "SHOP_ITEMCT_6");
}
}
case 7:
{
if(cs_get_user_money(id) < 10000)
{
client_print( id, print_chat,"%L",id, "SHOP_ITEM_LOST");
return PLUGIN_HANDLED;
}
else
{
cs_take_user_money(id, 10000)
strip_user_weapons(id)
give_item(id,"weapon_m249")
cs_set_user_bpammo(id, CSW_M249, 200)

}
}


}
return PLUGIN_HANDLED
}

public tero_menu(id, Menu2, item)
{
if (item == MENU_EXIT)
{
menu_destroy(Menu2)
return PLUGIN_HANDLED
}

// variables
new iData[6];
new iAccess;
new iCallback;
new iName[64];
menu_item_getinfo(Menu2, item, iAccess, iData, 5, iName, 63, iCallback)

switch (str_to_num(iData))
{

case 1:
{
if(cs_get_user_money(id) < 3000)
{
client_print( id, print_chat,"%L",id, "SHOP_ITEM_LOST");
return PLUGIN_HANDLED;
}
else
{
cs_take_user_money(id, 3000)
give_item(id, "v_superknife_")
client_print( id, print_chat,"%L",id, "SHOP_ITEMT_1");
}
}
case 2:
{
if(cs_get_user_money(id) < 300)
{
client_print( id, print_chat,"%L",id, "SHOP_ITEM_LOST");
return PLUGIN_HANDLED;
}
else
{
cs_take_user_money(id, 300)
give_item(id, "weapon_hegrenade")
client_print( id, print_chat,"%L",id, "SHOP_ITEMT_2");
}
}
case 3:
{
if(cs_get_user_money(id) < 200)
{
client_print(id, print_chat,"%L",id, "SHOP_ITEM_LOST");
return PLUGIN_HANDLED;
}
else
{

cs_take_user_money(id, 200)
give_item(id, "weapon_flashbang")
client_print( id, print_chat,"%L",id, "SHOP_ITEMT_3");

}
}
case 4:
{
if(cs_get_user_money(id) < 200)
{
client_print( id, print_chat,"%L",id, "SHOP_ITEM_LOST");
return PLUGIN_HANDLED;
}
else
{
cs_take_user_money(id, 200)
give_item(id, "weapon_smokegrenade")
client_print( id, print_chat,"%L",id, "SHOP_ITEMT_4");
}
}

case 5:
{
if(cs_get_user_money(id) < 800)
{
client_print( id, print_chat,"%L",id, "SHOP_ITEM_LOST" );
return PLUGIN_HANDLED;
}
else
{
cs_take_user_money(id, 800)
set_user_health( id, get_user_health(id) + 50 );
client_print( id, print_chat,"%L",id, "SHOP_ITEMT_5");
}
}
case 6:
{
if(cs_get_user_money(id) < 1500)
{
client_print( id, print_chat,"%L",id, "SHOP_ITEM_LOST");
return PLUGIN_HANDLED;
}
else
{
cs_take_user_money(id, 1500)
set_user_armor(id, get_user_armor(id) + 200);
client_print(id, print_chat,"%L",id, "SHOP_ITEMT_6");
}
}

case 7:
{
if(cs_get_user_money(id) < 3000)
{
client_print( id, print_chat,"%L",id, "SHOP_ITEM_LOST");
return PLUGIN_HANDLED;
}
else
{
cs_take_user_money(id, 16000)
give_item(id,"weapon_deagle")
client_print( id, print_chat,"%L",id, "SHOP_ITEMT_7");
}
}
}
return PLUGIN_HANDLED
}

stock cs_take_user_money(id, amount)
{
new money = cs_get_user_money(id)
if (money - amount < 0)
return 0
cs_set_user_money(id, clamp( money - amount, 0, 25000))
return 1
}

public client_connect(id)
{
g_bHasAutoBhop[id] =false
jumpnum[id] = 0
dojump[id] = false
}

public client_putinserver(id)
{
g_bHasAutoBhop[id] =false
jumpnum[id] = 0
dojump[id] = false
}

public client_disconnect(id)
{
g_bHasAutoBhop[id] =false
jumpnum[id] = 0
dojump[id] = false
}

public round_end(id)
{
g_bHasAutoBhop[id] =false
jumpnum[id] = 0
dojump[id] = false
}

public Ham_CBasePlayer_Jump_Pre(id)
{
if( g_bHasAutoBhop[id] && is_user_alive(id) )
{
if( pev(id, pev_flags) & (FL_WATERJUMP|FL_ONGROUND) == FL_ONGROUND
&& pev(id, pev_waterlevel) < 2 )
{
new iOldButtons = pev(id, pev_oldbuttons)
if( iOldButtons & IN_JUMP )
{
set_pev(id, pev_oldbuttons, iOldButtons & ~IN_JUMP)
}
}
}
}

public client_PreThink(id)
{
if(!is_user_alive(id)) return PLUGIN_CONTINUE
new nbut = get_user_button(id)
new obut = get_user_oldbutton(id)
if((nbut & IN_JUMP) && !(get_entity_flags(id) & FL_ONGROUND) && !(obut & IN_JUMP))
{
if(jumpnum[id] < 1)
{
dojump[id] = true
jumpnum[id]++
return PLUGIN_CONTINUE
}
}
if((nbut & IN_JUMP) && (get_entity_flags(id) & FL_ONGROUND))
{
jumpnum[id] = 0
return PLUGIN_CONTINUE
}
return PLUGIN_CONTINUE
}

public client_PostThink(id)
{
if(!is_user_alive(id)) return PLUGIN_CONTINUE
if(dojump[id] == true)
{
new Float:velocity[3]
entity_get_vector(id,EV_VEC_velocity,velocity)
velocity[2] = random_float(265.0,285.0)
entity_set_vector(id,EV_VEC_velocity,velocity)
dojump[id] = false
return PLUGIN_CONTINUE
}
return PLUGIN_CONTINUE
}

1 0
  
Back to top
View user's profile Send private message
destroi112

[DEV]



Status: Offline
(since 12-03-2020 22:13)
Joined: 24 May 2014
Posts: 4042, Topics: 119
Location: ---------

Reputation: 515.9
Votes: 118

   
Post Posted: 15-08-2016, 01:04:57 | Translate post to: ... (Click for more languages)

1.
menu_additem(Menu2, "Katana [3000 $]", "1", read_flags("q") //sau cauti care e flagul q din ADMIN_ACCES(Nu le stiu pe derost)
2.
give_item(id, "v_superknife_") wtf?
->
Code:

has_vipknife[id] = true;
if(get_user_weapon(id) == CSW_KNIFE)
set_pev(id,pev_viewmodel2,"models/v_knife_frfreakz.mdl");

si mai folosesti si Ham_Item_Deploy sau Cur_Weapon pentru ai da hook modelului ... avand in vedere ca tu ai 1 model e mai efectiv deply..
mai exact
->
Code:

adagui la inceput in plugin (dp inc-uri)
new has_vipknife[33];
adaugi in plugin_ini()

RegisterHam(Ham_Item_Deploy, "weapon_knife", "Weapon_Deploy_Post", 1)

si prin sma ->
public Weapon_Deploy_Post(ent)
{
    static id;
    id = get_pdata_cbase(ent, 41, 4);
    if(get_user_flags(id) & read_flags("q") && has_vipknife[id])
      set_pev(id,pev_viewmodel2,"models/v_knife_frfreakz.mdl");
}

si daca vrei sa aiba 2 arme trebuie sa ai un meniu de pe net (nu meniul de arme clasice) si sa cauti unde e strip_user_weapon(id) si sa verifici if(count_guns[id] < 2 && get_user_flags(id) & read_flags("q"))
count_guns e o constanta care o sa creasca de fiecare data cand ia o arma si o sa scada cand arunca o arma tr sa pui hook pe Drop Weapon si sa verifici si count_guns sa nu ajunga pe -
aici e mai mult de scris daca nu te descurci imi lasi reply cu meniu de arme si ti-l modific eu .



Retired from Amxmodx

0 0
  
Back to top
View user's profile Send private message

  Topic locked


Topic is closed, you cannot post any messages in it anymore

Locked by destroi112, 22 August 2016 04:12



 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Freakz Forum Index -> Trash Bin -> CS 2006-2019 (Archived) -> Counter-Strike: Help zone  


The time now is 02-12-2024, 16:55:42
Copyright info

Based on phpBB ro/com
B

 
 
 







I forgot my password


This message appears only once, so
like us now until it's too late ! :D
x