[ROZWIĄZANE] Podmiana modeli w sklepie
Dudek1921
15.07.2012
proszę o pomoc jak podmienic te modele na moje PB . Z góry dziekuje za pomoc

/* Plugin generated by AMXX-Studio */
#include <amxmodx>
#include <engine>
#include <cstrike>
#include <fun>
#define PLUGIN "Pb Shop"
#define VERSION "1.0"
#define AUTHOR "[AvP] ELOS"
public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)
register_clcmd("say /sklep", "Sklep");
register_clcmd("say_team /sklep", "Sklep");
register_clcmd("say /shop", "Sklep");
register_clcmd("say_team /shop", "Sklep");
}
public Sklep(id)
{
new tytul[25];
format(tytul, 24, "\rSklep \yPaintball \rVIP");
new menu = menu_create(tytul, "Sklep_Handler");
menu_additem(menu, "Granat Wybuchowy \yKoszt: \r5000$");//1
menu_additem(menu, "Wyrzutnia Granatow \yKoszt: \r14000$");//2
menu_additem(menu, "Granat Dymny \yKoszt: \r4000$");//3
menu_additem(menu, "Super Marker \yKoszt: \r6000$");//4
menu_display(id, menu);
}
public Sklep_Handler(id, menu, item)
{
if(!is_user_alive(id) || !is_user_connected(id))
return PLUGIN_CONTINUE;
new kasa = cs_get_user_money(id);
if(item == MENU_EXIT)
{
menu_destroy(menu);
return PLUGIN_CONTINUE;
}
switch(item)
{
case 0:
{
if(kasa >= 5000)
{
cs_set_user_money(id, kasa-5000);
give_item(id, "weapon_hegrenade")
client_print(id, print_chat, "[Sklep] Kupiles Granat Wybuchowy!");
}
else
client_print(id, print_chat, "[Sklep] Masz za malo kasy!");
}
case 1:
{
if(kasa >= 14000)
{
cs_set_user_money(id, kasa-14000);
give_item(id, "weapon_flashbang")
give_item(id, "weapon_flashbang")
client_print(id, print_chat, "[Sklep] Kupiles Wyrzutnie Granatow posiadasz 2 ladunki!");
}
else
client_print(id, print_chat, "[Sklep] Masz za malo kasy!");
}
case 2:
{
if(kasa >= 4000)
{
cs_set_user_money(id, kasa-4000);
give_item(id, "weapon_smokegrenade")
client_print(id, print_chat, "[Sklep] Kupiles Granat Dymny!");
}
else
client_print(id, print_chat, "[Sklep] Masz za malo kasy!");
}
case 3:
{
if(kasa >= 6000)
{
cs_set_user_money(id, kasa-6000);
give_item(id, "weapon_p90")
give_item(id, "weapon_primammo");
give_item(id, "weapon_primammo");
client_print(id, print_chat, "[Sklep] Kupiles Super Marker!");
}
else
client_print(id, print_chat, "[Sklep] Masz za malo kasy!");
}
}
return PLUGIN_CONTINUE;
}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1045\\ f0\\ fs16 \n\\ par }
*/
Użytkownik Dudek1921 edytował ten post 15.07.2012 09:01
dasiek
15.07.2012
entity_set_string(id, EV_SZ_viewmodel, "sciezka/do/modelu");
scieżke musisz precache'ować. I dobrze byłoby gdybyś sprawdzał czy gracz kupil takowe p90 zeby przy jego wyjęciu od razu zmieniało model (CurWeapon'em to zrobisz) Jak dasz nazwe modelu to Ci To zrobię.
Dudek1921
15.07.2012

dasiek
15.07.2012
i podaj ścieżke do modelu - się napisałem za pierwszym razem

Użytkownik CheQ edytował ten post 15.07.2012 09:58
Dudek1921
15.07.2012
dasiek
15.07.2012
/* Plugin generated by AMXX-Studio */ #include <amxmodx> #include <engine> #include <cstrike> #include <fun> #define PLUGIN "Pb Shop" #define VERSION "1.0" #define AUTHOR "[AvP] ELOS" new model_p90[] = "cstrike/models/v_pbgun5.mdl"; new model_smoke[] = "cstrike/models/v_pb_sniper.mdl"; new model_he[] = "cstrike/models/ v_pb_launcher.mdl" new bool:kupil[33][3]; #define HE 1 #define SMOKE 2 #define P90 0 public plugin_init() { register_plugin(PLUGIN, VERSION, AUTHOR) register_clcmd("say /sklep", "Sklep"); register_clcmd("say_team /sklep", "Sklep"); register_clcmd("say /shop", "Sklep"); register_clcmd("say_team /shop", "Sklep"); register_event("CurWeapon","CurWeapon","be", "1=1"); } public Sklep(id) { new tytul[25]; format(tytul, 24, "\rSklep \yPaintball \rVIP"); new menu = menu_create(tytul, "Sklep_Handler"); menu_additem(menu, "Granat Wybuchowy \yKoszt: \r5000$");//1 menu_additem(menu, "Wyrzutnia Granatow \yKoszt: \r14000$");//2 menu_additem(menu, "Granat Dymny \yKoszt: \r4000$");//3 menu_additem(menu, "Super Marker \yKoszt: \r6000$");//4 menu_display(id, menu); } public plugin_precache() { precache_model(model_p90); precache_model(model_smoke); precache_model(model_he); } public CurWeapon(id) { if(kupil[id][HE] && get_user_weapon(id) == CSW_HEGRENADE) entity_set_string(id, EV_SZ_viewmodel, model_he); if(kupil[id][SMOKE] && get_user_weapon(id) == CSW_SMOKEGRENADE) entity_set_string(id, EV_SZ_viewmodel, model_smoke); if(kupil[id][P90] && get_user_weapon(id) == CSW_P90) entity_set_string(id, EV_SZ_viewmodel, model_p90); } public Sklep_Handler(id, menu, item) { if(!is_user_alive(id) || !is_user_connected(id)) return PLUGIN_CONTINUE; new kasa = cs_get_user_money(id); if(item == MENU_EXIT) { menu_destroy(menu); return PLUGIN_CONTINUE; } switch(item) { case 0: { if(kasa >= 5000) { cs_set_user_money(id, kasa-5000); give_item(id, "weapon_hegrenade") client_print(id, print_chat, "[Sklep] Kupiles Granat Wybuchowy!"); kupil[id][HE] = true; } else client_print(id, print_chat, "[Sklep] Masz za malo kasy!"); } case 1: { if(kasa >= 14000) { cs_set_user_money(id, kasa-14000); give_item(id, "weapon_flashbang") give_item(id, "weapon_flashbang") client_print(id, print_chat, "[Sklep] Kupiles Wyrzutnie Granatow posiadasz 2 ladunki!"); } else client_print(id, print_chat, "[Sklep] Masz za malo kasy!"); } case 2: { if(kasa >= 4000) { cs_set_user_money(id, kasa-4000); give_item(id, "weapon_smokegrenade") kupil[id][SMOKE] = true; client_print(id, print_chat, "[Sklep] Kupiles Granat Dymny!"); } else client_print(id, print_chat, "[Sklep] Masz za malo kasy!"); } case 3: { if(kasa >= 6000) { cs_set_user_money(id, kasa-6000); give_item(id, "weapon_p90") give_item(id, "weapon_primammo"); give_item(id, "weapon_primammo"); kupil[id][P90] = true; client_print(id, print_chat, "[Sklep] Kupiles Super Marker!"); } else client_print(id, print_chat, "[Sklep] Masz za malo kasy!"); } } return PLUGIN_CONTINUE; }
nie wiem czy bronie są dobrze zrobione.
Dudek1921
15.07.2012
MarWit
15.07.2012
Ten temat został zamknięty przez moderatora.
Powód: Pomoc udzielona
Jeśli się z tym nie zgadzasz,

Z pozdrowieniami,
Zespół AMXX.PL