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 , 04:28   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;
}
__________________

Last edited by BloodMan; 06-26-2010 at 10:41.
BloodMan is offline
Send a message via Skype™ to BloodMan
drekes
Veteran Member
Join Date: Jul 2009
Location: Vault 11
Old 06-26-2010 , 05:10   Re: Need help with cs_get_user_team
Reply With Quote #2

Code:
public Player_Spawn(id)
{
    if( !is_user_alive(id) && cs_get_user_team(id) == CS_TEAM_T)

        {
            FirstSpawn[id] = true
            return
        }
        //......
And you could try to indent it better.
__________________

Quote:
Originally Posted by nikhilgupta345 View Post
You're retarded.
drekes is offline
Send a message via MSN to drekes
BloodMan
Senior Member
Join Date: Apr 2008
Location: Lithuania
Old 06-26-2010 , 05:29   Re: Need help with cs_get_user_team
Reply With Quote #3

Thanks.
__________________
BloodMan is offline
Send a message via Skype™ to BloodMan
GXLZPGX
Veteran Member
Join Date: Sep 2009
Old 06-26-2010 , 05:34   Re: Need help with cs_get_user_team
Reply With Quote #4

Quote:
Originally Posted by BloodMan View Post
Thanks.
You do know that

PHP Code:
!is_user_alive(id
Is for dead players right?
__________________
Currently accepting payment US DOLLARS ONLY for custom plugins, contact me through PM.
GXLZPGX is offline
drekes
Veteran Member
Join Date: Jul 2009
Location: Vault 11
Old 06-26-2010 , 05:41   Re: Need help with cs_get_user_team
Reply With Quote #5

Quote:
Originally Posted by GXLZPGX View Post
You do know that

PHP Code:
!is_user_alive(id
Is for dead players right?
Didn't notice that
__________________

Quote:
Originally Posted by nikhilgupta345 View Post
You're retarded.
drekes is offline
Send a message via MSN to drekes
GXLZPGX
Veteran Member
Join Date: Sep 2009
Old 06-26-2010 , 05:52   Re: Need help with cs_get_user_team
Reply With Quote #6

Quote:
Originally Posted by drekes View Post
Didn't notice that
Lol I was talking to BloodMan -.-
__________________
Currently accepting payment US DOLLARS ONLY for custom plugins, contact me through PM.
GXLZPGX is offline
drekes
Veteran Member
Join Date: Jul 2009
Location: Vault 11
Old 06-26-2010 , 05:58   Re: Need help with cs_get_user_team
Reply With Quote #7

well, since he is returning when a player is dead. I assume he knows it.
Code:
if( !is_user_alive(id) )

        {
            FirstSpawn[id] = true
            return
        }
__________________

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 , 08:07   Re: Need help with cs_get_user_team
Reply With Quote #8

It seems that that is what he wants though. He's opening it up on player spawn, and if for some reason, the player is dead, he doesn't want the menu to be shown to them.
RedRobster is offline
Devil259
Veteran Member
Join Date: Dec 2009
Location: France (59)
Old 06-26-2010 , 08:27   Re: Need help with cs_get_user_team
Reply With Quote #9

Quote:
Originally Posted by BloodMan View Post
How to make so that this menu would only work for terrorist team?


Code:
#include <amxmodx>
#include <hamsandwich>
#include <fakemeta>
#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) )
 
        {
            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) + 90.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;
}
You included two times fakemeta..
__________________
You can do anything you set your mind to, man.

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

Quote:
Originally Posted by Devil259 View Post
You included two times fakemeta..
And 2 times amxmodx and 2 times hamsandwich
__________________

Quote:
Originally Posted by nikhilgupta345 View Post
You're retarded.
drekes is offline
Send a message via MSN to drekes
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 14:45.


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