Raised This Month: $32 Target: $400
 8% 

[HELP] Edit this plugin.


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
ImYourBro
Senior Member
Join Date: Jun 2014
Old 11-21-2014 , 10:56   [HELP] Edit this plugin.
Reply With Quote #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(PLUGINVERSIONAUTHOR)
    
    
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(menuMPROP_EXITMEXIT_ALL);
            
            
menu_display(idmenu0);
        }
        
        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(menu2MPROP_EXITMEXIT_ALL);
            
            
menu_display(idmenu20);
        }
    }
    else
    {
        
client_print(idprint_chat"You must be alive for buy!")
    }
}

public 
Furiens(idmenuitem)
{
    if (
item == MENU_EXIT)
    {
        
menu_destroy(menu);
        
PLUGIN_HANDLED;
    }
    
    new 
data[6], szName[64];
    new 
accesscallback;
    
    new 
menu_item_getinfo(menuitemaccessdata,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(idprint_chat"You bought a He Grenade");
                
cs_set_user_money(idmoney[id] - 3000);
                
give_item(id"weapon_hegrenade");
            }
            else {
                
client_print(idprint_chat"You don't have enough money!");
            }
        }
        
        case 
2:
        {
            if(
money[id] > 2000)
            {
                
client_print(idprint_chat"You bought a Smoke Grenade");
                
cs_set_user_money(idmoney[id] - 2000);
                
give_item(id"weapon_smokegrenade");
            }
            else {
                
client_print(idprint_chat"You don't have enough money!");
            }
        }
        
        case 
3:
        {
            if(
money[id] > 1000)
            {
                
client_print(idprint_chat"You bought a Flash Bang");
                
cs_set_user_money(idmoney[id] - 1000);
                
give_item(id"weapon_flashbang");
            }
            else {
                
client_print(idprint_chat"You don't have enough money!");
            }
        }
        
        case 
4:
        {
            if(
money[id] > 4000)
            {
                
client_print(idprint_chat"You bought +25 Health");
                
cs_set_user_money(idmoney[id] - 4000);
                
set_user_health(id, (get_user_health(id) + 25MAX_HP));
            }
            else {
                
client_print(idprint_chat"You don't have enough money!");
            }
        }
        
        case 
5:
        {
            if(
money[id] > 16000)
            {
                
client_print(idprint_chat"You bought +100 Health");
                
cs_set_user_money(idmoney[id] - 16000);
                
set_user_health(id, (get_user_health(id) + 100MAX_HP));
            }
            else {
                
client_print(idprint_chat"You don't have enough money!");
            }
        }
        
        case 
6:
        {
            if(
money[id] > 4000)
            {
                
client_print(idprint_chat"You bought +25 Armor");
                
cs_set_user_money(idmoney[id] - 4000);
                
set_user_armor(id, (get_user_armor(id) + 25MAX_ARMOR));
            }
            else {
                
client_print(idprint_chat"You don't have enough money!");
            }
        }
        
        case 
7:
        {
            if(
money[id] > 16000)
            {
                
client_print(idprint_chat"You bought Super Knife");
                
cs_set_user_money(idmoney[id] - 16000);
                
g_HasSuperKnife[id] = true;
            }
            else {
                
client_print(idprint_chat"You don't have enough money!");
            }
        }
    }
    
menu_destroy(menu);
    
PLUGIN_HANDLED;
}

public 
AntiFuriens(idmenu2item)
{
    if ( 
item == MENU_EXIT)
    {
        
menu_destroy(menu2);
        
PLUGIN_HANDLED;
    }
    
    new 
data[6], szName[64];
    new 
accesscallback;
    
    
menu_item_getinfo(menu2itemaccessdata,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(idprint_chat"You bought a He Grenade");
                
cs_set_user_money(idmoney[id] - 3000);
                
give_item(id"weapon_hegrenade");
            }
            else {
                
client_print(idprint_chat"You don't have enough money!");
            }
        }
        
        case 
2:
        {
            if(
money[id] > 2000)
            {
                
client_print(idprint_chat"You bought a Smoke Grenade");
                
cs_set_user_money(idmoney[id] - 2000);
                
give_item(id"weapon_smokegrenade");
            }
            else {
                
client_print(idprint_chat"You don't have enough money!");
            }
        }
    
        case 
3:
        {
            if(
money[id] > 1000)
            {
                
client_print(idprint_chat"You bought a Flash Bang");
                
cs_set_user_money(idmoney[id] - 1000);
                
give_item(id"weapon_flashbang");
            }
            else {
                
client_print(idprint_chat"You don't have enough money!");
            }
        }
        
        case 
4:
        {
            if(
money[id] > 4000)
            {
                
client_print(idprint_chat"You bought +25 Health");
                
cs_set_user_money(idmoney[id] - 4000);
                
set_user_health(id, (get_user_health(id) + 25MAX_HP));
            }
            else {
                
client_print(idprint_chat"You don't have enough money!");
            }
        }
        
        case 
5:
        {
            if(
money[id] > 16000)
            {
                
client_print(idprint_chat"You bought +100 Health");
                
cs_set_user_money(idmoney[id] - 16000);
                
set_user_health(id, (get_user_health(id) + 100MAX_HP));
            }
            else {
                
client_print(idprint_chat"You don't have enough money!");
            }
        }
        
        case 
6:
        {
            if(
money[id] > 4000)
            {
                
client_print(idprint_chat"You bought +25 Armor");
                
cs_set_user_money(idmoney[id] - 4000);
                
set_user_armor(id, (get_user_armor(id) + 25MAX_ARMOR));
            }
            else {
                
client_print(idprint_chat"You don't have enough money!");
            }
        }
        
        case 
7:
        {
            if(
money[id] > 16000)
            {
                
client_print(idprint_chat"You bought a M249");
                
cs_set_user_money(idmoney[id] - 16000);
                
give_item(id"weapon_m249");
            }
            else {
                
client_print(idprint_chat"You don't have enough money!");
            }
        }
    }
    
menu_destroy(menu2);
    
PLUGIN_HANDLED;
}

public 
Player_Spawn_Post(id)
{
    if ( 
is_user_alive id ) )
    {
        
client_print(idprint_chat"Say /shop in the chat for buy an item !")
 
        if ( 
g_HasSuperKnife[id] && get_user_weapon(id) == CSW_KNIFE )
        {
            
set_pev(idpev_viewmodel2"models/v_knife.mdl")
        }
        
g_HasSuperKnife[id] = false
    
}
}

public 
ham_TakeDamage_Pre(victiminflictorattackerFloat:damagedamage_bits)
{
    if ( 
IsPlayer(attacker) && g_HasSuperKnife[attacker] && is_user_alive(attacker) && inflictor == attacker && get_user_weapon(attacker) == CSW_KNIFE )
    {
        
SetHamParamFloat2damage 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.
ImYourBro is offline
Eagle07
Veteran Member
Join Date: May 2014
Location: Morocco :D
Old 11-21-2014 , 14:22   Re: [HELP] Edit this plugin.
Reply With Quote #2

Why you add new thread just follow on this thread
https://forums.alliedmods.net/showthread.php?t=251588
__________________
Eagle07 is offline
ImYourBro
Senior Member
Join Date: Jun 2014
Old 11-21-2014 , 14:47   Re: [HELP] Edit this plugin.
Reply With Quote #3

Eagle07.

The link you had send me in the other thread is for both teams. I want special items for them.
__________________
Hello!
I'm learning AMXX right now, so please No Hate if i suck

-----------------------------------------------------------------------
Check out my Furien Mod v0.3 here

ImYourBro is offline
Eagle07
Veteran Member
Join Date: May 2014
Location: Morocco :D
Old 11-21-2014 , 14:53   Re: [HELP] Edit this plugin.
Reply With Quote #4

its just a tutorial for make Shop menu
__________________
Eagle07 is offline
ImYourBro
Senior Member
Join Date: Jun 2014
Old 11-21-2014 , 15:38   Re: [HELP] Edit this plugin.
Reply With Quote #5

I only need this shop menu and then im done. please just make the menu. It will make me very happy
__________________
Hello!
I'm learning AMXX right now, so please No Hate if i suck

-----------------------------------------------------------------------
Check out my Furien Mod v0.3 here

ImYourBro is offline
Eagle07
Veteran Member
Join Date: May 2014
Location: Morocco :D
Old 11-21-2014 , 15:44   Re: [HELP] Edit this plugin.
Reply With Quote #6

I'M NOT TALKING ABOUT SHOP MENU
I'M TALKING ABOUT THREAD WHY YOU ADD NEW THREAD
WHY YOU DON'T FOLLOW JUST THE LAST THREAD :@
THIS => https://forums.alliedmods.net/showthread.php?t=251588
__________________
Eagle07 is offline
RateX
Veteran Member
Join Date: Jun 2012
Location: 0o. SEA .o0
Old 11-22-2014 , 00:01   Re: [HELP] Edit this plugin.
Reply With Quote #7

Just read the line with error, compare it with the same native in your code and you will know how to fix it by yourself.
Don't be lazy.
RateX is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 11:25.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode