Senior Member
|
11-21-2014
, 10:56
[HELP] Edit this plugin.
|
#1
|
Hey!
Can someone edit this plugin and then i will be happy
Here is the code below:
PHP Code:
/* Plugin generated by AMXX-Studio */
#include <amxmodx> #include <amxmisc> #include <fun> #include <cstrike> #include <hamsandwich> #include <fakemeta>
#define PLUGIN "Furien Shop" #define VERSION "1.0" #define AUTHOR "PauLz"
#define MAX_PLAYERS 32 #define MAX_HP 200 #define MAX_ARMOR 200
new const g_ModelSuperKnife[] = "models/SG/furien_superknife_SG.mdl"
new g_iMaxPlayers
new bool:g_HasSuperKnife[MAX_PLAYERS+1]
new money[33];
public plugin_init() { register_plugin(PLUGIN, VERSION, AUTHOR) register_clcmd("say /shop", "cmdShop", 0); register_clcmd("say_team /shop", "cmdShop", 0); register_clcmd("say shop", "cmdShop", 0); register_clcmd("say_team /shop", "cmdShop", 0); RegisterHam(Ham_Spawn, "player", "Player_Spawn_Post", 1) RegisterHam(Ham_TakeDamage, "player", "ham_TakeDamage_Pre") RegisterHam(Ham_Item_Deploy, "weapon_knife", "ham_ItemDeploy_Post", 1) }
public plugin_precache() { precache_model(g_ModelSuperKnife) }
public client_connect(id) { g_HasSuperKnife[id] = false }
public cmdShop(id) { if(is_user_alive(id)) { if(cs_get_user_team(id) == CS_TEAM_T) { new menu = menu_create("\w[\rFurien Shop\w]", "Furiens") menu_additem(menu, "\wHe Grenade \y[\r3000 $\y]", "1", 0); menu_additem(menu, "\wSmoke Grenade \y[\r2000 $\y]", "2", 0); menu_additem(menu, "\wFlash Bang \y[\r1000 $\y]", "3", 0); menu_additem(menu, "\wHP +25 \y[\r4000 $\y]", "4", 0); menu_additem(menu, "\wHP +100 \y[\r16000 $\y]", "5", 0); menu_additem(menu, "\wArmor +25 \y[\r4000 $\y]", "6", 0); menu_additem(menu, "\wSuper Knife \y[\r16000 $\y]", "7", 0); menu_setprop(menu, MPROP_EXIT, MEXIT_ALL); menu_display(id, menu, 0); } else { new menu2 = menu_create("\w[\rAnti-Furiens Shop\w]", "AntiFuriens") menu_additem(menu2, "\wHe Grenade \y[\r3000 $\y]", "1", 0); menu_additem(menu2, "\wSmoke Grenade \y[\r3000 $\y]", "2", 0); menu_additem(menu2, "\wFlash Bang \y[\r3000 $\y]", "3", 0); menu_additem(menu2, "\wHP +25 \y[\r3000 $\y]", "4", 0); menu_additem(menu2, "\wHP +100 \y[\r3000 $\y]", "5", 0); menu_additem(menu2, "\wArmor +25 \y[\r3000 $\y]", "6", 0); menu_additem(menu2, "\wM249 \y[\r3000 $\y]", "7", 0); menu_setprop(menu2, MPROP_EXIT, MEXIT_ALL); menu_display(id, menu2, 0); } } else { client_print(id, print_chat, "You must be alive for buy!") } }
public Furiens(id, menu, item) { if (item == MENU_EXIT) { menu_destroy(menu); PLUGIN_HANDLED; } new data[6], szName[64]; new access, callback; new menu_item_getinfo(menu, item, access, data,charmax(data), szName,charmax(szName), callback); money[id] = cs_get_user_money(id) new key = str_to_num(data); switch(key) { case 1: { if(money[id] > 3000) { client_print(id, print_chat, "You bought a He Grenade"); cs_set_user_money(id, money[id] - 3000); give_item(id, "weapon_hegrenade"); } else { client_print(id, print_chat, "You don't have enough money!"); } } case 2: { if(money[id] > 2000) { client_print(id, print_chat, "You bought a Smoke Grenade"); cs_set_user_money(id, money[id] - 2000); give_item(id, "weapon_smokegrenade"); } else { client_print(id, print_chat, "You don't have enough money!"); } } case 3: { if(money[id] > 1000) { client_print(id, print_chat, "You bought a Flash Bang"); cs_set_user_money(id, money[id] - 1000); give_item(id, "weapon_flashbang"); } else { client_print(id, print_chat, "You don't have enough money!"); } } case 4: { if(money[id] > 4000) { client_print(id, print_chat, "You bought +25 Health"); cs_set_user_money(id, money[id] - 4000); set_user_health(id, (get_user_health(id) + 25, MAX_HP)); } else { client_print(id, print_chat, "You don't have enough money!"); } } case 5: { if(money[id] > 16000) { client_print(id, print_chat, "You bought +100 Health"); cs_set_user_money(id, money[id] - 16000); set_user_health(id, (get_user_health(id) + 100, MAX_HP)); } else { client_print(id, print_chat, "You don't have enough money!"); } } case 6: { if(money[id] > 4000) { client_print(id, print_chat, "You bought +25 Armor"); cs_set_user_money(id, money[id] - 4000); set_user_armor(id, (get_user_armor(id) + 25, MAX_ARMOR)); } else { client_print(id, print_chat, "You don't have enough money!"); } } case 7: { if(money[id] > 16000) { client_print(id, print_chat, "You bought Super Knife"); cs_set_user_money(id, money[id] - 16000); g_HasSuperKnife[id] = true; } else { client_print(id, print_chat, "You don't have enough money!"); } } } menu_destroy(menu); PLUGIN_HANDLED; }
public AntiFuriens(id, menu2, item) { if ( item == MENU_EXIT) { menu_destroy(menu2); PLUGIN_HANDLED; } new data[6], szName[64]; new access, callback; menu_item_getinfo(menu2, item, access, data,charsmax(data), szName,charsmax(szName), callback); money[id] = cs_get_user_money(id); new key = str_to_num(id); switch(key) { case 1: { if(money[id] > 3000) { client_print(id, print_chat, "You bought a He Grenade"); cs_set_user_money(id, money[id] - 3000); give_item(id, "weapon_hegrenade"); } else { client_print(id, print_chat, "You don't have enough money!"); } } case 2: { if(money[id] > 2000) { client_print(id, print_chat, "You bought a Smoke Grenade"); cs_set_user_money(id, money[id] - 2000); give_item(id, "weapon_smokegrenade"); } else { client_print(id, print_chat, "You don't have enough money!"); } } case 3: { if(money[id] > 1000) { client_print(id, print_chat, "You bought a Flash Bang"); cs_set_user_money(id, money[id] - 1000); give_item(id, "weapon_flashbang"); } else { client_print(id, print_chat, "You don't have enough money!"); } } case 4: { if(money[id] > 4000) { client_print(id, print_chat, "You bought +25 Health"); cs_set_user_money(id, money[id] - 4000); set_user_health(id, (get_user_health(id) + 25, MAX_HP)); } else { client_print(id, print_chat, "You don't have enough money!"); } } case 5: { if(money[id] > 16000) { client_print(id, print_chat, "You bought +100 Health"); cs_set_user_money(id, money[id] - 16000); set_user_health(id, (get_user_health(id) + 100, MAX_HP)); } else { client_print(id, print_chat, "You don't have enough money!"); } } case 6: { if(money[id] > 4000) { client_print(id, print_chat, "You bought +25 Armor"); cs_set_user_money(id, money[id] - 4000); set_user_armor(id, (get_user_armor(id) + 25, MAX_ARMOR)); } else { client_print(id, print_chat, "You don't have enough money!"); } } case 7: { if(money[id] > 16000) { client_print(id, print_chat, "You bought a M249"); cs_set_user_money(id, money[id] - 16000); give_item(id, "weapon_m249"); } else { client_print(id, print_chat, "You don't have enough money!"); } } } menu_destroy(menu2); PLUGIN_HANDLED; }
public Player_Spawn_Post(id) { if ( is_user_alive ( id ) ) { client_print(id, print_chat, "Say /shop in the chat for buy an item !") if ( g_HasSuperKnife[id] && get_user_weapon(id) == CSW_KNIFE ) { set_pev(id, pev_viewmodel2, "models/v_knife.mdl") } g_HasSuperKnife[id] = false } }
public ham_TakeDamage_Pre(victim, inflictor, attacker, Float:damage, damage_bits) { if ( IsPlayer(attacker) && g_HasSuperKnife[attacker] && is_user_alive(attacker) && inflictor == attacker && get_user_weapon(attacker) == CSW_KNIFE ) { SetHamParamFloat( 2, damage * 192.0 ) } }
I got 4 errors:
Error: Expected token: ";", but found "(" on line 104
Error: Invalid function call, not a valid address on line 104
Error: Invalid expression, assumed zero on line 104
Error: Too many error messages on one line 104
Fix these 3 errors and then i will be very happy
PLEASE!!
__________________
Hello!
I'm learning AMXX right now, so please No Hate if i suck
-----------------------------------------------------------------------
Check out my Furien Mod v0.3 here
Last edited by ImYourBro; 11-21-2014 at 17:14.
|
|