Raised This Month: $ Target: $400
 0% 

I cant script help me .. :)


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Damir
Member
Join Date: Jul 2006
Old 06-02-2007 , 12:05   I cant script help me .. :)
Reply With Quote #1

#include <amxmodx>
#include <amxmisc>
#define PLUGIN "Gummi_Bears"
#define VERSION "1.0"
#define AUTHOR "Gummi_Bears_fan"

public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)

register_clcmd("say /GBJ","buy_GummiBerryJuice")

public event_ResetHUD(id)
set_user_health(id, 999)
set_user_armor(id, 999)
set_user_maxspeed(id ,4.0)
set_user_gravity(id ,400)

how can I make multi jump

I know i am stupid to this

sorry bad english

just make this to work with multi jump hehe please help me ...
Damir is offline
v3x
Veteran Member
Join Date: Oct 2004
Location: US
Old 06-02-2007 , 13:46   Re: I cant script help me .. :)
Reply With Quote #2

This should help a little:
PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <fun> // you need this module for the set_user_* functions in this plugin
#include <cstrike> // you need this module for cs_[set/get]_user_money

#define PLUGIN "Gummi_Bears"
#define VERSION "1.0"
#define AUTHOR "Gummi_Bears_fan"

new bool:has_juice[33]

new 
GBJ_costGBJ_healthGBJ_armorGBJ_speedGBJ_gravity

public plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
register_clcmd("say /GBJ","buy_GummiBerryJuice")
    
register_event("ResetHUD","event_ResetHUD","b"// use the ResetHUD event to catch when the player spawns
    
register_event("DeathMsg","event_DeathMsg","a"); // use the DeathMsg event to take away the Juice
    
register_event("CurWeapon","event_CurWeapon","be"); // use the CurWeapon event to keep setting player's speed

    
GBJ_cost register_cvar("gbj_cost","16000"// cvar for cost
    
GBJ_health register_cvar("gbj_health","999"// cvar for health
    
GBJ_armor register_cvar("gbj_armor","999"// cvar for armor
    
GBJ_speed register_cvar("gbj_speed","450.0"// cvar for speed
    
GBJ_gravity register_cvar("gbj_health","0.5"// cvar for gravity
}

public 
client_connect(id) {
    
has_juice[id] = false // reset the bool variable back to false on connect
}

public 
buy_GummiBerryJuice(id)
{
    if(
has_juice[id])
    {
        
client_print(idprint_chat"[AMXX] You already have Gummi Bear Juice!")
        return 
PLUGIN_CONTINUE
    
}

    new 
money cs_get_user_money(id)

    if((
money get_pcvar_num(GBJ_cost)) < 0// check if the player has enough cash
    
{
        
client_print(idprint_chat"[AMXX] You don't have enough money for Gummi Bear Juice!")
        return 
PLUGIN_CONTINUE
    
}

    
has_juice[id] = true;

    
client_print(idprint_chat"[AMXX] You now have Gummi Bear Juice!")

    return 
PLUGIN_CONTINUE
}

public 
event_ResetHUD(id) { // you need to delay it
    
set_task(0.3"check_juice"id)
}

public 
check_juice(id) {
    if(
has_juice[id]) // check if the player has juice
    
{
        
set_user_health(idget_pcvar_num(GBJ_health))
        
set_user_armor(idget_pcvar_num(GBJ_armor))
        
set_user_maxspeed(idget_pcvar_float(GBJ_speed))
        
set_user_gravity(idget_pcvar_float(GBJ_gravity)) // needs to be a float (0.5 is 400 gravity)
    
}
}

public 
event_DeathMsg(id) { // remove Juice after death
    
has_juice[read_data(2)] = false
}

public 
event_CurWeapon(id) { // set player's maxspeed continuously
    
if(is_user_alive(id) && has_juice[id]) {
        
set_user_maxspeed(idget_pcvar_float(GBJ_gravity))
    }

As for the multi-jump, just download the source to it, then piece it together in your plugin and add credits.
__________________
What am I doing these days? Well, I run my own Rust server. It's heavily modded. If you'd like to join, the ip is 167.114.101.67:28116

I also created a website called Rust Tools. It will calculate and tell you the raw amounts of resources needed to craft items.

Last edited by v3x; 06-02-2007 at 13:58. Reason: updated code
v3x is offline
flyeni6
Senior Member
Join Date: Jun 2006
Location: CAli
Old 06-02-2007 , 13:48   Re: I cant script help me .. :)
Reply With Quote #3

well i posted something here http://forums.alliedmods.net/showthread.php?t=55926

but i maybe v3x's is better. :p
__________________

flyeni6 is offline
Send a message via AIM to flyeni6
Damir
Member
Join Date: Jul 2006
Old 06-03-2007 , 05:10   Re: I cant script help me .. :)
Reply With Quote #4

hey v3x this do not work the grav is so high and you do not loose your money when you buy it and the double jump do not work and the plugin doesnt work until the second round ... can you fix that please
Damir is offline
Pro Patria Finland
Senior Member
Join Date: Apr 2006
Location: BaronPub.com
Old 06-18-2007 , 13:28   Re: I cant script help me .. :)
Reply With Quote #5

Quote:
Originally Posted by Damir View Post
hey v3x this do not work the grav is so high and you do not loose your money when you buy it and the double jump do not work and the plugin doesnt work until the second round ... can you fix that please
Code:
public buy_GummiBerryJuice(id) {     if(has_juice[id])     {         client_print(id, print_chat, "[AMXX] You already have Gummi Bear Juice!")         return PLUGIN_CONTINUE     }     new money = cs_get_user_money(id)     if((money - get_pcvar_num(GBJ_cost)) < 0) // check if the player has enough cash     {         client_print(id, print_chat, "[AMXX] You don't have enough money for Gummi Bear Juice!")         return PLUGIN_CONTINUE     }     has_juice[id] = true;     client_print(id, print_chat, "[AMXX] You now have Gummi Bear Juice!")     cs_set_user_money(id, money - get_pcvar_num(GBJ_cost)) // Subtracts the price from the players money     return PLUGIN_CONTINUE }

Should work... Great idea, Gummi Bears rock.
__________________
I am not a number. I am Gordon Freeman!
Pro Patria Finland is offline
Reply


Thread Tools
Display Modes

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 10:32.


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