Raised This Month: $51 Target: $400
 12% 

[REQ] VIP plugin for paintball + shop plugin for normal players


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
waizedzzy
Member
Join Date: May 2016
Location: France
Old 11-20-2016 , 17:12   [REQ] VIP plugin for paintball + shop plugin for normal players
Reply With Quote #1

Hello guys, I'm here to ask you for 2 plugins

So the first plugin VIP menu i want it to have auto every round start:
1. HP 250
2. Armour 200
3. 1 HE, 2 FB, 1 SG
4. Speed 300
5. 16000$ at every spawn
Access: ADMIN_LEVEL_H



The second plugin i request is shop for paintball too but for all players:
1. HP 50 - 5500 $ (Players can't have more than 250 HP)
2. Armor 50 - 2000$ (Players can't have more than 250 Armour)
3. 1 He grenades - 6000$ (Can't be bought more than 1 time per round)
4. 1 Smoke grenade - 3000$ (Can't be bought more than 1 time per round)



PS: Found 1 plugin like this but can't be downloaded and it's in other language.
#Thanks
__________________
Invincible Wxx ^.^

Last edited by waizedzzy; 11-20-2016 at 17:13.
waizedzzy is offline
edon1337
Penguin Enthusiast
Join Date: Jun 2016
Location: Macedonia
Old 11-22-2016 , 07:15   Re: [REQ] VIP plugin for paintball + shop plugin for normal players
Reply With Quote #2

1)
PHP Code:
#include <amxmodx>
#include <hamsandwich>
#include <cstrike>
#include <fakemeta_util>
#include <fun>

#define PLUGIN "Crazy V.I.P"
#define VERSION "1.0"
#define AUTHOR "DoNii"

public plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
RegisterHam(Ham_Spawn"player""fwHamPlayerSpawnPost"1
}

public 
playerResetMaxSpeed(id)
{
    static 
Float:maxspeed
    pev
(id,pev_maxspeed,maxspeed)
    
    if(
maxspeed != 1.0 && get_user_flags(id) & ADMIN_LEVEL_H)
    {
        
set_pev(id,pev_maxspeed,300)
    }
}  

public 
fwHamPlayerSpawnPost(id) {
    
    if(
is_user_alive(id) && get_user_flags(id) & ADMIN_LEVEL_H) {
        
        
set_user_health(idget_user_health(id) + 250)
        
set_user_armor(idget_user_armor(id) + 200)
        
give_item(id"weapon_hegrenade");
        
give_item(id"weapon_flashbang");
        
give_item(id"weapon_smokegrenade");
        
cs_set_user_bpammo(idCSW_FLASHBANG2);
        
cs_set_user_bpammo(idCSW_SMOKEGRENADE3);
        
cs_set_user_money(id16000);
    }

2)
PHP Code:
#include <amxmodx>
#include <hamsandwich>
#include <cstrike>
#include <fun>

#define PLUGIN "PaintBall Shop System"
#define VERSION "1.0"
#define AUTHOR "DoNii"

new bool:item_used[33];

public 
plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
register_clcmd"say /pbmenu","menumenu" );
    
register_clcmd"say pbmenu","menumenu" );
    
RegisterHam(Ham_Spawn"player""Fwd_PlayerSpawn_Pre"0);
}

public 
Fwd_PlayerSpawn_Pre(id) {
    
    static 
player[32], num;    
    
get_players(playernum)    
    
    for ( new 
inumi++ ) {
        
        
item_used[player[i]] = false
    
}
}

public 
menumenuid )
{
    if(
is_user_alive(id)) {
        new 
menu menu_create"\rPaintBall Menu!:""menu_handler" );
        
        
menu_additemmenu"\r[ \wPRICE : \r5500$ \w] 50 HP """);
        
menu_additemmenu"\r[ \wPRICE : \r2000$ \w] 50 Armor""");
        
menu_additemmenu"\r[ \wPRICE : \r6000$ \w] 1 HE Grenade""");
        
menu_additemmenu"\r[ \wPRICE : \r3000$ \w] 1 Smoke Grenade""");    
        
        
menu_setpropmenuMPROP_EXITMEXIT_ALL );
        
        
menu_displayidmenu);
    }
    
    else {
        
client_print(idprint_chat"You Can't Use This Menu While Dead");
        return 
PLUGIN_HANDLED;    
    }
    
    return 
PLUGIN_HANDLED;
}

public 
menu_handleridmenuitem )
{
    
    if(
item_used[id]) {
        
client_print(idprint_chat"Can't Buy Again, Next Round Only");
        return 
PLUGIN_HANDLED;
    }
    
    if(!
is_user_alive(id)) {
        
client_print(idprint_chat"You Can't Use This Menu While Dead");
                return 
PLUGIN_HANDLED;
    }
    
    else  {
        
        switch( 
item )
        {
            case 
0:
            {
                if(
get_user_health(id) > 250) {
                    
client_print(idprint_chat"You Can't Have More Than 250 HP");
                    return 
PLUGIN_HANDLED;    
                }
                
                
                if(
cs_get_user_money(id) >= 5500) {
                    
set_user_health(idget_user_health(id) + 50);
                    
cs_set_user_money(idcs_get_user_money(id) - 5500)
                    
client_print(idprint_chat"You Just Bought 50 HP For 5500$");
                    
                    
                }
                
                else {
                    
client_print(idprint_chat"Not Enough Money");
                    return 
PLUGIN_HANDLED;
                }
                
                
            }
            case 
1:
            {
                if(
get_user_armor(id) > 250) {
                    
client_print(idprint_chat"You Can't Have More Than 250 Armor");
                    return 
PLUGIN_HANDLED;    
                }
                
                
                if(
cs_get_user_money(id) >= 2000) {
                    
set_user_health(idget_user_health(id) + 50);
                    
cs_set_user_money(idcs_get_user_money(id) - 2000)
                    
client_print(idprint_chat"You Just Bought 50 Armor For 2000$");
                    
                    
                }
                
                else {
                    
client_print(idprint_chat"Not Enough Money");
                    return 
PLUGIN_HANDLED;
                }
                
                
                
            }
            case 
2:
            {
                if(
cs_get_user_money(id) >= 6000) {
                    
give_item(id"weapon_hegrenade");
                    
client_print(idprint_chat"You Just Bought A HE Grenade For 6000$");
                    
                    
item_used[id] = true
                
}
                
            }
            
            case 
3:
            {
                if(
cs_get_user_money(id) >= 3000) {
                    
give_item(id"weapon_smokegrenade");
                    
client_print(idprint_chat"You Just Bought A Smoke Grenade For 3000$");
                    
                    
item_used[id] = true
                
}
                
            }
            case 
MENU_EXIT:
            {
                
client_printidprint_chat"Exited The Menu!" );
            }
        }
        
    }
    return 
PLUGIN_HANDLED;

__________________

Last edited by edon1337; 11-22-2016 at 16:57.
edon1337 is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 11-22-2016 , 10:34   Re: [REQ] VIP plugin for paintball + shop plugin for normal players
Reply With Quote #3

That is totally wrong. Ham_Spawn is called for one client only, why are you looping through all of them?! The menu won't work. The plugin won't read anything below the first few lines in the handler. Also, you should do the checks (if he's alive/used the menu) before you add the items/make the menu. What's the point of creating a menu that will get destroyed instantly?

//Колега, се разбираме ли?
__________________

Last edited by OciXCrom; 11-22-2016 at 10:42.
OciXCrom is offline
Send a message via Skype™ to OciXCrom
edon1337
Penguin Enthusiast
Join Date: Jun 2016
Location: Macedonia
Old 11-22-2016 , 14:38   Re: [REQ] VIP plugin for paintball + shop plugin for normal players
Reply With Quote #4

I guess, registering a round start event would be the right choice? Yeah, I saw that, removed menu_destroy after switch. Should this work instead of Ham_spawn? ,
PHP Code:
register_event("HLTV""event_new_round""a""1=0""2=0"
// da bre kolega haha
__________________
edon1337 is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 11-22-2016 , 15:04   Re: [REQ] VIP plugin for paintball + shop plugin for normal players
Reply With Quote #5

Giving the items at round start is not such a good idea, since a player can spawn after the round has started, therefore he won't get any of the items. Simply use the previous Ham_Spawn method, but instead of looping through all players, simply give the item only to that client. Also, the round start event doesn't have an (id) parameter.

PHP Code:
public OnSpawn(id)
{
    if(
is_user_alive(id) && get_user_flags(id) & ADMIN_LEVEL_H)
    {
        
set_user_health(idget_user_health(id) + 250)
        
set_user_armor(idget_user_armor(id) + 200)
        
give_item(id"weapon_hegrenade");
        
give_item(id"weapon_flashbang");
        
give_item(id"weapon_smokegrenade");
        
cs_set_user_bpammo(idCSW_FLASHBANG2);
        
cs_set_user_money(id16000);
    }

You should check if the user is alive in the handler as well.
__________________

Last edited by OciXCrom; 11-22-2016 at 15:05.
OciXCrom is offline
Send a message via Skype™ to OciXCrom
edon1337
Penguin Enthusiast
Join Date: Jun 2016
Location: Macedonia
Old 11-22-2016 , 16:57   Re: [REQ] VIP plugin for paintball + shop plugin for normal players
Reply With Quote #6

good?
__________________
edon1337 is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 11-22-2016 , 18:48   Re: [REQ] VIP plugin for paintball + shop plugin for normal players
Reply With Quote #7

You didn't register the max speed event. In the second plugin you did the same thing with looping through all players on player spawn.
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
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 07:17.


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