Raised This Month: $ Target: $400
 0% 

Check if player droped scout/weapon name


Post New Thread Reply   
 
Thread Tools Display Modes
bazhenov93
Veteran Member
Join Date: Oct 2010
Old 04-17-2012 , 13:14   Re: Check if player droped scout/weapon name
Reply With Quote #11

That should look like this?;

PHP Code:
public timer_task()
{
    if ( 
get_pcvar_num(kz_show_timer) > )
    {
        new 
Alive[32], Dead[32], alivePlayersdeadPlayers;
        
get_players(AlivealivePlayers"ach")
        
get_players(DeaddeadPlayers"bch")
        for(new 
i=0;i<alivePlayers;i++)
        {
            if( 
timer_started[Alive[i]])
            {
                new 
Float:kreedztime get_gametime() - (IsPaused[Alive[i]] ? get_gametime() - g_pausetime[Alive[i]] : timer_time[Alive[i]])

                if( 
ShowTime[Alive[i]] == )
                {
                    new 
colors[12], r[4], g[4], b[4];
                    new 
imin floatround(kreedztime 60.0,floatround_floor)
                    new 
isec floatround(kreedztime imin 60.0,floatround_floor)
                    
get_pcvar_string(kz_hud_colorcolors11)
                    
parse(colorsr3g3b4)
                    
shown_scout_message[i] = false;    // for scout
                    
set_hudmessage(str_to_num(r), str_to_num(g), str_to_num(b), 0.400.1000.01.00.00.01)    
                    
show_hudmessage(Alive[i], "Time: %02d:%02d  | CPs: %d | TPs: %d %s ",iminisec,checknumbers[Alive[i]], gochecknumbers[Alive[i]], IsPaused[Alive[i]] ? "| *Paused*" ""
                }
                else
                if( 
ShowTime[Alive[i]] == )
                {
                    
kz_showtime_roundtime(Alive[i], floatround(kreedztime))
                }
            }
                
        }
        for(new 
i=0;i<deadPlayers;i++)
        {
            new 
specmode pev(Dead[i], pev_iuser1)
            if(
specmode == || specmode == 4)
            {
                new 
target pev(Dead[i], pev_iuser2)
                if(
target != Dead[i])
                    if(
is_user_alive(target) && timer_started[target])
                    {
                        new 
name[32], colors[12], r[4], g[4], b[4];
                        
get_user_name (targetname31)

                        new 
Float:kreedztime get_gametime() - (IsPaused[target] ? get_gametime() - g_pausetime[target] : timer_time[target])
                        new 
imin floatround(kreedztime 60.0,floatround_floor)
                        new 
isec floatround(kreedztime imin 60.0,floatround_floor)

                        
get_pcvar_string(kz_hud_colorcolors11)
                        
parse(colorsr3g3b4)

                        
set_hudmessage(str_to_num(r), str_to_num(g), str_to_num(b), -1.00.4600.01.00.00.01)
                        
show_hudmessage(Dead[i], "Time: %02d:%02d  | CPs: %d | TPs: %d %s ",iminisecchecknumbers[target], gochecknumbers[target], IsPaused[target] ? "| *Paused*" "")     
                    }
            }
        }
    }

PHP Code:
public cmdScout(id)
{
    if(! 
is_user_alive(id) && is_user_connected(id))
    {
        
ColorChat(idBLUE,"You must be alive to use this function")
        return 
PLUGIN_HANDLED
    
}
    
    if(
user_has_weapon(idCSW_SCOUT))
    {
        
ColorChat(idBLUE"You already have a Scout")
        return 
PLUGIN_HANDLED
    
}
    
    if (
timer_started[id]) {
        if(!
shown_scout_message[id]) {
        
cs_set_weapon_ammo(give_item(id"weapon_scout"), 0)
        
ColorChat(idBLUE"Using that weapon you are not able to get into Pro15/Top15 list. Weapons Top enabled for you")
        
shown_scout_message[id] = true;
        return 
PLUGIN_HANDLED
    
}
    
    if((
get_user_flags(id) & VIP ))
    {
        
cs_set_weapon_ammo(give_item(id"weapon_scout"), 90)
    }
    else
    {
        
cs_set_weapon_ammo(give_item(id"weapon_scout"), 0)
    }
    return 
PLUGIN_HANDLED


Last edited by bazhenov93; 04-17-2012 at 13:14.
bazhenov93 is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 04-17-2012 , 13:27   Re: Check if player droped scout/weapon name
Reply With Quote #12

Quote:
Originally Posted by bazhenov93 View Post
That should look like this?
No. timer_task() is not when player pressed the start button. You need to set it in that event, probably a Ham_Use forward.

And the second part should be like this:
Code:
    if (timer_started[id]) {         cs_set_weapon_ammo(give_item(id, "weapon_scout"), 0)         if(!shown_scout_message[id]) {             ColorChat(id, BLUE, "Using that weapon you are not able to get into Pro15/Top15 list. Weapons Top enabled for you")             shown_scout_message[id] = true;         }         return PLUGIN_HANDLED     }
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
bazhenov93
Veteran Member
Join Date: Oct 2010
Old 04-17-2012 , 13:32   Re: Check if player droped scout/weapon name
Reply With Quote #13

Quote:
Originally Posted by Exolent[jNr] View Post
No. timer_task() is not when player pressed the start button. You need to set it in that event, probably a Ham_Use forward.

And the second part should be like this:
Code:
if (timer_started[id]) { cs_set_weapon_ammo(give_item(id, "weapon_scout"), 0) if(!shown_scout_message[id]) { ColorChat(id, BLUE, "Using that weapon you are not able to get into Pro15/Top15 list. Weapons Top enabled for you") shown_scout_message[id] = true; } return PLUGIN_HANDLED }
ty
is working
bazhenov93 is offline
bazhenov93
Veteran Member
Join Date: Oct 2010
Old 04-18-2012 , 13:13   Re: Check if player droped scout/weapon name
Reply With Quote #14

What im doing wrong?

PHP Code:
new bool:finished_the_map[33]; 
PHP Code:

public give_hook(id)
{
    if (!(  
get_user_flagsid ) & KZ_LEVEL ))
    return 
PLUGIN_HANDLED

    
new szarg1[32], szarg2[8], bool:mode
    read_argv
(1,szarg1,32)
    
read_argv(2,szarg2,32)
    if(
equal(szarg2,"on"))
        
mode true
        
    
if(equal(szarg1,"@ALL"))
    {
        for(new 
i=1;i<=MaxPlayers;i++)
        {
            if(
is_user_connected(i) && is_user_alive(i))
            {
                
canusehook[i] = mode
                
if(mode)
                {
                    new 
szAdmin[33]
                    
get_user_name(idszAdmin32)
                    
ColorChat(idGREY"^4ADMIN^1: ^4%s ^3gave Hook for All players"szAdmin)
                    
set_dhudmessage(371642490.520.3806.09.0)
                    
show_dhudmessage(id"        HOOK^nUsage: bind anykey +hook to use it")
                }
                else
                {
                new 
szAdmin[33]
                
get_user_name(idszAdmin32)
                
hook_off(0)
                
ColorChat(idGREY"^4ADMIN^1: ^4%s ^3removed Hook from All players"szAdmin)
                }
            }
        }
    }
    else
    {
        new 
pid find_player("bl",szarg1);
        if(
pid 0)
        {
            
canusehook[pid] = mode
            
if(mode)
            {
                new 
szAdmin[33]
                
get_user_name(idszAdmin32)
                
ColorChat(idGREY"^4ADMIN^1: ^4%s ^3gave you Hook"szAdmin)
                
set_dhudmessage(371642490.520.3806.09.0)
                
show_dhudmessage(id"        HOOK^nUsage: bind anykey +hook to use it")
            }
            else
            {
                new 
szAdmin[33]
                
get_user_name(idszAdmin32)
                
ColorChat(idGREY"^4ADMIN^1: ^4%s ^3removed Hook from you"szAdmin)
            }

        }
    }
    return 
PLUGIN_HANDLED
}
// =================================================================================================

public hook_on(id)
{
    if( !
canusehook[id] && !(  get_user_flagsid ) & KZ_LEVEL ) || !is_user_alive(id) )
    {
        
ColorChat(idGREY"You must finish the map without checkpoints before get a Hook")
        return 
PLUGIN_HANDLED
}

    if (
IsPaused[id])
    {
        
kz_hud_message(id"You can't use hook while paused")
        return 
PLUGIN_HANDLED
    
}
    
    if (
checknumbers[id] > ) {
    
ColorChat(idGREY"You used checkpoints, hook not enabled")
    
ishooked[id] = false
    
return PLUGIN_HANDLED
    
}
    
    
detect_cheat(id,"Hook")
    
get_user_origin(id,hookorigin[id],3)
    
ishooked[id] = true
    antihookcheat
[id] = get_gametime()
    
    if (
get_pcvar_num(kz_hook_sound) == 1)
    
emit_sound(id,CHAN_STATIC,"weapons/xbow_hit2.wav",1.0,ATTN_NORM,0,PITCH_NORM)

    
set_task(0.1,"hook_task",id,"",0,"ab")
    
hook_task(id)
    
    return 
PLUGIN_HANDLED
}

// =================================================================================================

public hook_off(id)
{
    
remove_hook(id)
    
    return 
PLUGIN_HANDLED
}

// =================================================================================================

public hook_task(id)
{
    if(!
is_user_connected(id) || !is_user_alive(id))
        
remove_hook(id)
    
    
remove_beam(id)
    
draw_hook(id)
    
    new 
origin[3], Float:velocity[3]
    
get_user_origin(id,origin)
    new 
distance get_distance(hookorigin[id],origin)
    
velocity[0] = (hookorigin[id][0] - origin[0]) * (2.0 get_pcvar_num(kz_hook_speed) / distance)
    
velocity[1] = (hookorigin[id][1] - origin[1]) * (2.0 get_pcvar_num(kz_hook_speed) / distance)
    
velocity[2] = (hookorigin[id][2] - origin[2]) * (2.0 get_pcvar_num(kz_hook_speed) / distance)
        
    
set_pev(id,pev_velocity,velocity)
}

// =================================================================================================

public draw_hook(id)
{
    
message_begin(MSG_BROADCAST,SVC_TEMPENTITY)
    
write_byte(1)                // TE_BEAMENTPOINT
    
write_short(id)                // entid
    
write_coord(hookorigin[id][0])        // origin
    
write_coord(hookorigin[id][1])        // origin
    
write_coord(hookorigin[id][2])        // origin
    
write_short(Sbeam)            // sprite index
    
write_byte(0)                // start frame
    
write_byte(0)                // framerate
    
write_byte(random_num(1,100))        // life
    
write_byte(random_num(1,20))        // width
    
write_byte(random_num(1,0))        // noise                    
    
write_byte(random_num(1,255))        // r
    
write_byte(random_num(1,255))        // g
    
write_byte(random_num(1,255))        // b
    
write_byte(random_num(1,500))        // brightness
    
write_byte(random_num(1,200))        // speed
    
message_end()
}

public 
remove_hook(id)
{
    if(
task_exists(id))
        
remove_task(id)
    
remove_beam(id)
    
ishooked[id] = false
}

public 
remove_beam(id)
{
    
message_begin(MSG_BROADCAST,SVC_TEMPENTITY)
    
write_byte(99// TE_KILLBEAM
    
write_short(id)
    
message_end()

PHP Code:
 public start_climb(id)
{
    
    
    
    switch (
get_pcvar_num(kz_chatorhud))
        {
        case 
1ColorChat(idGREEN"Timer started")
        case 
2kz_hud_message(id"Timer started")
        
    }

    if (
get_pcvar_num(kz_reload_weapons) == 1)
    {
        
strip_user_weapons(id)
        
give_item(id,"weapon_knife")
        
give_item(id,"weapon_usp"
    }

    if (
ShowTime[id] == 2)
        
kz_showtime_roundtime(id0)
    
set_pev(idpev_gravity1.0);
    
set_pev(idpev_movetypeMOVETYPE_WALK)
    
set_user_godmode(id0)
    
reset_checkpoints(id)
    
IsPaused[id] = false
    timer_started
[id] = true
    timer_time
[id] = get_gametime()
    if(!
finished_the_map[id] ) {
    
finished_the_map[id] = false;
    }

PHP Code:
public rewards(id) {

    if (
checknumbers[id] > )
    if(!
finished_the_map[id] ) {
    
set_dhudmessage(371642490.520.3806.09.0)
    
show_dhudmessage(id"        REWARDS^nHook: bind anykey +hook to use it^nNoClip: type /nc to use it")
    
finished_the_map[id] = true;
    
    }
    return 
PLUGIN_HANDLED


Last edited by bazhenov93; 04-18-2012 at 13:17.
bazhenov93 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 07:43.


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