Raised This Month: $ Target: $400
 0% 

Need help with cs_get_user_team


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
BloodMan
Senior Member
Join Date: Apr 2008
Location: Lithuania
Old 06-26-2010 , 10:40   Re: Need help with cs_get_user_team
Reply With Quote #1

Theres something fishy with this plugin, even CT's can use it. And it seems that everyone can use it... I would like it to be admins only. They should have ADMIN_LEVEL_H.

Code:
#include <amxmodx>
#include <hamsandwich>
#include <fakemeta>
#include <fakemeta_util>
#include <fun>
#include <cstrike>

new bool:FirstSpawn[33]
public plugin_init()
{
    RegisterHam        (Ham_Spawn, "player", "Player_Spawn", 1)
    register_forward( FM_PlayerPreThink, "forward_player_prethink" );
    register_logevent( "logevent_round_start", 2, "1=Round_Start" );

}
public Player_Spawn(id)
{
    if( !is_user_alive(id) &% cs_get_user_team(id) == CS_TEAM_T)

        {
            FirstSpawn[id] = true
            return
        }
    FirstSpawn[id] = false

    new menu = menu_create("Zombiu VIP Meniu:", "vip_menu");

    menu_additem(menu ,"Daugiau Sveikatos", "1" , ADMIN_LEVEL_H);
    menu_additem(menu ,"Greitas Begimas", "2" , ADMIN_LEVEL_H);
    menu_additem(menu ,"Gravitacija", "3" , ADMIN_LEVEL_H);



    menu_setprop(menu, MPROP_EXIT, MEXIT_ALL);

    menu_display(id, menu, 0);
}
public vip_menu(id, menu, item)
{
    if( item == MENU_EXIT )
    {
        menu_destroy(menu);
        return PLUGIN_HANDLED;
    }

    new data[6], iName[64];
    new access, callback;
    menu_item_getinfo(menu, item, access, data,5, iName, 63, callback);


    new key = str_to_num(data);

    switch(key)
    {
case 1:
        {
            fm_set_user_health( id, get_user_health( id ) + 1500 );
            client_print(id, print_chat, "Gavai daugiau Sveikatos, dabar tu stiprus!");
        }
case 2:
        {
            new Float:speed = get_user_maxspeed(id) + 85.0;
            set_user_maxspeed(id , speed);
            client_print(id, print_chat, "Begsi dabar labai greitai!");
        }
case 3:
        {
            fm_set_user_gravity( id, 0.5 );
            client_print(id, print_chat, "O dabar sokinesi kaip kengura!");
        }
    }

    menu_destroy(menu);
    return PLUGIN_HANDLED;
}
__________________
BloodMan is offline
Send a message via Skype™ to BloodMan
RedRobster
Veteran Member
Join Date: Apr 2010
Location: Your Closet
Old 06-26-2010 , 11:11   Re: Need help with cs_get_user_team
Reply With Quote #2

Note: I didn't check the entire code, I only added what he wanted and changed 2 things from fakemeta to fun (gravity and health).

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

new bool:FirstSpawn[33]

public 
plugin_init()
{
    
RegisterHam    (Ham_Spawn"player""Player_Spawn"1)
    
register_forwardFM_PlayerPreThink"forward_player_prethink" );
    
register_logevent"logevent_round_start"2"1=Round_Start" );

}
public 
Player_Spawn(id)
{
    if( !
is_user_alive(id) && cs_get_user_team(id) == CS_TEAM_T//You put &% for some reason
    
{
            
FirstSpawn[id] = true
            
return
    }
    
    if( !(
get_user_flags(id) & ADMIN_LEVEL_H) ) //Sees if they have the right admin
        
return
    
    
FirstSpawn[id] = false

    
new menu menu_create("Zombiu VIP Meniu:""vip_menu");

    
menu_additem(menu ,"Daugiau Sveikatos""1");
    
menu_additem(menu ,"Greitas Begimas""2");
    
menu_additem(menu ,"Gravitacija""3");



    
menu_setprop(menuMPROP_EXITMEXIT_ALL);

    
menu_display(idmenu0);
}

public 
vip_menu(idmenuitem)
{
    if( 
item == MENU_EXIT )
    {
        
menu_destroy(menu);
        return 
PLUGIN_HANDLED;
    }

    new 
data[6], iName[64];
    new 
accesscallback;
    
menu_item_getinfo(menuitemaccessdata,5iName63callback);


    new 
key str_to_num(data);

    switch(
key)
    {
        case 
1:
        {
            
set_user_healthidget_user_healthid ) + 1500 ); //Switched from fakemeta to fun
            
client_print(idprint_chat"Gavai daugiau Sveikatos, dabar tu stiprus!");
        }
        
        case 
2:
        {
            new 
Float:speed get_user_maxspeed(id) + 85.0;
            
set_user_maxspeed(id speed);
            
client_print(idprint_chat"Begsi dabar labai greitai!");
        }
        
        case 
3:
        { 
            
set_user_gravityid0.5 ); //Switched from fakemeta to fun
            
client_print(idprint_chat"O dabar sokinesi kaip kengura!");
        }
    }

    
menu_destroy(menu);
    return 
PLUGIN_HANDLED;

RedRobster is offline
drekes
Veteran Member
Join Date: Jul 2009
Location: Vault 11
Old 06-26-2010 , 11:14   Re: Need help with cs_get_user_team
Reply With Quote #3

Is that your entire code? Cause if it is you're registering prethink and not using it. And i don't think you use fakemeta_util
__________________

Quote:
Originally Posted by nikhilgupta345 View Post
You're retarded.
drekes is offline
Send a message via MSN to drekes
RedRobster
Veteran Member
Join Date: Apr 2010
Location: Your Closet
Old 06-26-2010 , 11:17   Re: Need help with cs_get_user_team
Reply With Quote #4

He's not using The round start logevent either, so I don't think this is his entire code.
RedRobster is offline
edgaras85
Senior Member
Join Date: Mar 2010
Location: Lithuania
Old 06-27-2010 , 05:12   Re: Need help with cs_get_user_team
Reply With Quote #5

Quote:
Originally Posted by RedRobster View Post
He's not using The round start logevent either, so I don't think this is his entire code.
No i think its entire code, but he dont know what they doing because he copied from other codes....
edgaras85 is offline
BloodMan
Senior Member
Join Date: Apr 2008
Location: Lithuania
Old 06-27-2010 , 02:44   Re: Need help with cs_get_user_team
Reply With Quote #6

this is the entire code.
__________________

Last edited by BloodMan; 06-27-2010 at 02:46.
BloodMan is offline
Send a message via Skype™ to BloodMan
RedRobster
Veteran Member
Join Date: Apr 2010
Location: Your Closet
Old 06-27-2010 , 06:35   Re: Need help with cs_get_user_team
Reply With Quote #7

If that is your entire code...then here:
PHP Code:
#include <amxmodx>
#include <hamsandwich>
#include <fun>
#include <cstrike>

new bool:FirstSpawn[33]

public 
plugin_init()
{
    
RegisterHam    (Ham_Spawn"player""Player_Spawn"1)
}
public 
Player_Spawn(id)
{
    if( !
is_user_alive(id) && cs_get_user_team(id) == CS_TEAM_T//You put &% for some reason
    
{
            
FirstSpawn[id] = true
            
return
    }
    
    if( !(
get_user_flags(id) & ADMIN_LEVEL_H) ) //Sees if they have the right admin
        
return
    
    
FirstSpawn[id] = false

    
new menu menu_create("Zombiu VIP Meniu:""vip_menu");

    
menu_additem(menu ,"Daugiau Sveikatos""1");
    
menu_additem(menu ,"Greitas Begimas""2");
    
menu_additem(menu ,"Gravitacija""3");



    
menu_setprop(menuMPROP_EXITMEXIT_ALL);

    
menu_display(idmenu0);
}

public 
vip_menu(idmenuitem)
{
    if( 
item == MENU_EXIT )
    {
        
menu_destroy(menu);
        return 
PLUGIN_HANDLED;
    }

    new 
data[6], iName[64];
    new 
accesscallback;
    
menu_item_getinfo(menuitemaccessdata,5iName63callback);


    new 
key str_to_num(data);

    switch(
key)
    {
        case 
1:
        {
            
set_user_healthidget_user_healthid ) + 1500 ); //Switched from fakemeta to fun
            
client_print(idprint_chat"Gavai daugiau Sveikatos, dabar tu stiprus!");
        }
        
        case 
2:
        {
            new 
Float:speed get_user_maxspeed(id) + 85.0;
            
set_user_maxspeed(id speed);
            
client_print(idprint_chat"Begsi dabar labai greitai!");
        }
        
        case 
3:
        { 
            
set_user_gravityid0.5 ); //Switched from fakemeta to fun
            
client_print(idprint_chat"O dabar sokinesi kaip kengura!");
        }
    }

    
menu_destroy(menu);
    return 
PLUGIN_HANDLED;

RedRobster is offline
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 14:45.


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