AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   hi again :(( (https://forums.alliedmods.net/showthread.php?t=74420)

tuty 07-18-2008 14:06

hi again :((
 
Hey guys....

I need help with this code...


PHP Code:

/* !! Viziteaza www.tutyzone.ucoz.com !!
     -> Intra pe serveru nostru -> tutyzone2.idle.ro <- = Biohazard Zombie Infection si multe alte noutati
     copyright (c)
     */

#include <amxmodx>
#include <amxmisc>
#include <engine>
#include <fun>

#define PLUGIN "battery_low"
#define VERSION "1.0"
#define AUTHOR "tuty"

new HB
new healthBat

public plugin_init() 
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
HB register_cvar("amx_healthbattery""1")
    
register_event("ResetHUD","event_spawm","be")
    
}

public 
event_spawm(id)
{
    
set_hudmessage(255255255, -1.0, -1.006.012.0)
    
show_hudmessage(id"[========]")
}
public 
client_PreThink(id)
{
    
healthBat get_user_health(id)
    if(
get_cvar_num(HB) != && !is_user_alive(id)){
    return 
PLUGIN_HANDLED
    
    
    
    set_hudmessage
(002550.0, -1.006.012.0)
    if(
healthBat 100 && healthBat 100)
    {
        
set_hudmessage(2552552550.0, -1.006.012.0)
                  
show_hudmessage(id"[========]FULL")
    if(
healthBat 90 && healthBat 100)(show_hudmessage(id"[========]"))
    if(
healthBat 80 && healthBat 90)(show_hudmessage(id"[=======]"))
    if(
healthBat 70 && healthBat 80)(show_hudmessage(id"[======]"))
    if(
healthBat 60 && healthBat 70)(show_hudmessage(id"[=====]"))
    if(
healthBat 50 && healthBat 60)(show_hudmessage(id"[====]"))
    if(
healthBat 40 && healthBat 50)(show_hudmessage(id"[===]"))
    if(
healthBat 20 && healthBat 40)(show_hudmessage(id"[==]"))
    if(
healthBat 0  && healthBat 20){
        
set_hudmessage(255000.0, -1.006.012.0)
        
show_hudmessage(id"!!!!! [=] !!!! ^nBatteryLow")
        
set_user_rendering(id,kRenderFxGlowShell,255,0,0,kRenderNormal,20)
    }


please.... i hope i will don't come again on this scripting help forum :twisted::mrgreen:

Arkshine 07-18-2008 14:17

Re: hi again :((
 
Code:
/* !! Viziteaza <a href="http://www.tutyzone.ucoz.com" target="_blank" rel="nofollow noopener">www.tutyzone.ucoz.com</a> !!      -> Intra pe serveru nostru -> tutyzone2.idle.ro <- = Biohazard Zombie Infection si multe alte noutati      copyright (c) */ #include <amxmodx> #include <amxmisc> #include <engine> #include <fun> #define PLUGIN "battery_low" #define VERSION "1.0" #define AUTHOR "tuty" new HB new healthBat public plugin_init()   {     register_plugin(PLUGIN, VERSION, AUTHOR)     HB = register_cvar("amx_healthbattery", "1")     register_event("ResetHUD","event_spawm","be") } public event_spawm(id) {     set_hudmessage(255, 255, 255, -1.0, -1.0, 0, 6.0, 12.0)     show_hudmessage(id, "[========]") } public client_PreThink(id) {     healthBat = get_user_health(id)         if(get_pcvar_num(HB) != 1 && !is_user_alive(id))         return;     set_hudmessage(0, 0, 255, 0.0, -1.0, 0, 6.0, 12.0)     if(healthBat > 100 && healthBat < 100)     {         set_hudmessage(255, 255, 255, 0.0, -1.0, 0, 6.0, 12.0)         show_hudmessage(id, "[========]FULL")     }     if(healthBat > 90 && healthBat < 100)(show_hudmessage(id, "[========]"))     if(healthBat > 80 && healthBat < 90)(show_hudmessage(id, "[=======]"))     if(healthBat > 70 && healthBat < 80)(show_hudmessage(id, "[======]"))     if(healthBat > 60 && healthBat < 70)(show_hudmessage(id, "[=====]"))     if(healthBat > 50 && healthBat < 60)(show_hudmessage(id, "[====]"))     if(healthBat > 40 && healthBat < 50)(show_hudmessage(id, "[===]"))     if(healthBat > 20 && healthBat < 40)(show_hudmessage(id, "[==]"))     if(healthBat > 0  && healthBat < 20)     {         set_hudmessage(255, 0, 0, 0.0, -1.0, 0, 6.0, 12.0)         show_hudmessage(id, "!!!!! [=] !!!! ^nBatteryLow")         set_user_rendering(id,kRenderFxGlowShell,255,0,0,kRenderNormal,20)     } }


line 34 : get_cvar_num -> get_pcvar_num / removed '{'
line 35 : return PLUGIN_HANDLED -> return
line 43 : forgot to insert '}' at the end

tuty 07-18-2008 14:59

Re: hi again :((
 
thx dude +K


All times are GMT -4. The time now is 05:30.

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