Raised This Month: $ Target: $400
 0% 

Little problem.


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Napoleon_be
Veteran Member
Join Date: Jul 2011
Location: Belgium
Old 05-03-2012 , 12:54   Little problem.
Reply With Quote #1

PHP Code:
#include <amxmodx>
#include <fakemeta>
#include <colorchat>
#include <fun>
#include <hamsandwich>

#define VERSION "1.0.0"

new pPlugin
new pPrefix

new szPrefix[32]
new 
iNoscope[33]
new 
iNormal[33]
new 
iHighGravity[33]

public 
plugin_init() {
    
register_plugin("ScoutzKnivez Fun Rounds"VERSION"NapoleoN#")
    
register_forward(FM_CmdStart"CmdStart")
    
    
RegisterHam(Ham_Spawn"player""FwPlayerSpawn")
    
    
pPlugin register_cvar("sk_enable""1")
    
pPrefix register_cvar("sk_prefix""SK")
    
    
get_pcvar_string(pPrefixszPrefixcharsmax(szPrefix))
}

public 
FwPlayerSpawn(id) {
    
iNoscope[id] = 0
    iNormal
[id] = 0
    iHighGravity
[id] = 0
    
    set_user_gravity
(id)
    if(
is_user_alive(id) && get_pcvar_num(pPlugin)) {
        switch(
random_num(13)) {
            case 
1Cmd_NoScope(id)
            case 
2Cmd_Normal(id)
            case 
3Cmd_HigherGravity(id)
        }
    }
}

public 
Cmd_NoScope(id) {
    if(
is_user_alive(id)) {
        
set_task(0.1"CmdStart"id)
        
iNoscope[id] = 1
        ColorChat
(idGREEN"[%s]^1 The current round is:^4 No Scope only!"szPrefix)
    }
}        

public 
CmdStart(idHandle) {
    if(
iNoscope[id] == && is_user_alive(id)) {
        static 
button
        button 
get_uc(HandleUC_Buttons)
    
        if (
button IN_ATTACK2) {
            
button &= ~IN_ATTACK2
        
}
    
        
set_uc(HandleUC_Buttonsbutton)
    }
}

public 
Cmd_Normal(id) {
    if(
is_user_alive(id)) {
        
ColorChat(idGREEN"[%s]^1 The current round is:^4 Normal round!"szPrefix)
        
iNormal[id] = 1
    
}
}
        
public 
Cmd_HigherGravity(id) {
    if(
is_user_alive(id)) {
        
iHighGravity[id] = 1
        set_user_gravity
(id0.2)
        
ColorChat(idGREEN"[%s]^1 The current round is:^4 Higher Gravity!"szPrefix)
    }

I've made a simple code, but on Cmd_HigherGravity, the gravity doesn't set the asked value, also on the ham_spawn event, i want to set the IN_ATTACK2 back to normal and stop blocking it, how to do that?
__________________

Last edited by Napoleon_be; 05-03-2012 at 12:59.
Napoleon_be is offline
Send a message via Skype™ to Napoleon_be
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 05-03-2012 , 12:56   Re: Little problem.
Reply With Quote #2

Change your spawn hook to post.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
Napoleon_be
Veteran Member
Join Date: Jul 2011
Location: Belgium
Old 05-03-2012 , 13:02   Re: Little problem.
Reply With Quote #3

Works perfectly, thanks
__________________
Napoleon_be is offline
Send a message via Skype™ to Napoleon_be
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 00:21.


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