AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Nothing happens! (https://forums.alliedmods.net/showthread.php?t=86769)

Nur56 03-02-2009 10:05

Nothing happens!
 
PHP Code:

/*
This plugin was made by CoLa^ also known as Nur5,Nur56 and T-Bag, this plugin was made with help from Reality Paintball
for the Flash Light effect, I thank the maker of R Paintball for it.

CVars:

amx_home 1/0  Triggers the plugin, effect is on next round, Defaults 1

I would also like to thank the maker of ColorChat include.

Have Fun!!
*/


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

#define PLUGIN "HomeFree"
#define VERSION "1.0"
#define AUTHOR "CoLa"


public plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
register_cvar("amx_home","1")
    
register_logevent("RoundStart",2,"0=World triggered""1=Round_Start")
}



public 
RoundStart(id) {
    
    new 
CsTeams:teams cs_get_user_team(id)
    if(
get_cvar_num("amx_home") > 0) {
        
HomeFree(id)
        
        
strip_user_weapons(0)
        switch(
teams) {
            case 
1:
            {
                
                
give_item(id,"weapon_knife")
                
ColorChat(id,BLUE,"[HomeFree]^x03YOU CAN SPRINT BY RIGHT CLICKING KNIFE!")
                
ColorChat(id,RED,"[HomeFree]^x03YOU CAN SLOW FALL IN THE AIR BY PRESSING AND HOLDING E!!!")
            }
            
            case 
2:
            {
                
ColorChat(id,BLUE,"^x03Kill all the T's in 5 minutes, they have advantages so beware!")
                
give_item(id,"weapon_knife")
                
give_item(id,"weapon_hegrenade")
            }
        }
        
        
ColorChat(0,RED,"[HomeFree!!!]^x04Get ^x03Ready ^x01To ^x03PLAAAAAAAAAAAAAAAAY!")
        
    }
    
    if(
get_cvar_num("amx_home") <= 0) {
        return 
PLUGIN_HANDLED
    
}
    
    return 
PLUGIN_CONTINUE
}


public 
HomeFree(id) {
    
    new 
weapon get_user_weapon(id)
    new 
CsTeams:teams cs_get_user_team(id)
    switch(
teams) {
        case 
1: {
            if(
weapon == CSW_KNIFE) {
                while(
get_user_button(id) & IN_ATTACK2) {
                    
message_begin(MSG_ONE,get_user_msgid("FlashBat"),{0,0,0},id)
                    
write_byte(100)
                    
message_end()
                    
set_user_maxspeed(id,-5)
                }
                
            }
            
set_user_health(id,200)
            while(
get_user_button(id) & IN_USE) {
                
set_user_gravity(id,-2.66666667)
            }
            
        }
        
        case 
2: {
            
            
set_user_health(id,120)
            
        }
        
    }
    
    return 
PLUGIN_CONTINUE



no matter how hard i try NOTHING happens, I even tried replacing round start with a say /go command, still nothing :o

Please help.

padilha007 03-02-2009 10:14

Re: Nothing happens!
 
PHP Code:

/*
This plugin was made by CoLa^ also known as Nur5,Nur56 and T-Bag, this plugin was made with help from Reality Paintball
for the Flash Light effect, I thank the maker of R Paintball for it.

CVars:

amx_home 1/0  Triggers the plugin, effect is on next round, Defaults 1

I would also like to thank the maker of //ColorChat include.

Have Fun!!
*/


#include <amxmodx>
#include <cstrike>
#include <fun>
#include <colorchat>
#include <engine>

#define PLUGIN "HomeFree"
#define VERSION "1.0"
#define AUTHOR "CoLa"


public plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
register_cvar("amx_home","1")
    
register_logevent("RoundStart",2,"0=World triggered""1=Round_Start")
}

public 
RoundStart() {

    for(new 
id=0;id <= get_maxplayers();id++)
    {
        if(
is_user_connected(id) && is_user_alive(id))
        {
            new 
CsTeams:teams cs_get_user_team(id)
            if(
get_cvar_num("amx_home") == 1) {
                
HomeFree(id)
                
                
strip_user_weapons(0)
                switch(
teams) {
                    case 
1:
                    {
                        
                        
give_item(id,"weapon_knife")
                        
ColorChat(id,BLUE,"[HomeFree]^x03YOU CAN SPRINT BY RIGHT CLICKING KNIFE!")
                        
ColorChat(id,RED,"[HomeFree]^x03YOU CAN SLOW FALL IN THE AIR BY PRESSING AND HOLDING E!!!")
                    }
                    
                    case 
2:
                    {
                        
ColorChat(id,BLUE,"^x03Kill all the T's in 5 minutes, they have advantages so beware!")
                        
give_item(id,"weapon_knife")
                        
give_item(id,"weapon_hegrenade")
                    }
                }
                
                
ColorChat(0,RED,"[HomeFree!!!]^x04Get ^x03Ready ^x01To ^x03PLAAAAAAAAAAAAAAAAY!")
            }
        }
    }
}

public 
HomeFree(id) {
    
    new 
weapon get_user_weapon(id)
    new 
CsTeams:teams cs_get_user_team(id)
    switch(
teams) {
        case 
1: {
            if(
weapon == CSW_KNIFE) {
                while(
get_user_button(id) & IN_ATTACK2) {
                    
message_begin(MSG_ONE,get_user_msgid("FlashBat"),{0,0,0},id)
                    
write_byte(100)
                    
message_end()
                    
set_user_maxspeed(id, -5.0)
                }
                
            }
            
set_user_health(id,200)
            while(
get_user_button(id) & IN_USE) {
                
set_user_gravity(id,-2.66666667)
            }
            
        }
        
        case 
2: {
            
            
set_user_health(id,120)
            
        }
        
    }
    
    return 
PLUGIN_CONTINUE



Nur56 03-02-2009 11:19

Re: Nothing happens!
 
Still won't work god damit!

PHP Code:


L 03
/02/2009 18:17:09: [FUNPlayer out of range (0)
L 03/02/2009 18:17:09: [AMXXRun time error 10 (plugin "HomeFree.amxx") (native "strip_user_weapons") - debug not enabled!
L 03/02/2009 18:17:09: [AMXXTo enable debug modeadd "debug" after the plugin name in plugins.ini (without quotes). 


This is currently the error i get in server console :(, maybe it's because im playing alone?

SnoW 03-02-2009 13:08

Re: Nothing happens!
 
That can't work, though I have no idea how it should work.
Code:

strip_user_weapons(0)

BOYSplayCS 03-02-2009 18:17

Re: Nothing happens!
 
For future reference, make your thread titles more descriptive and relative to the problem. In this case, it is relative, but you know what I mean.

padilha007 03-02-2009 19:11

Re: Nothing happens!
 
strip_user_weapons(0)

to:

strip_user_weapons(id)

Nur56 03-03-2009 08:03

Re: Nothing happens!
 
IT WORKS! i love you padil, +karma.


All times are GMT -4. The time now is 16:51.

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