Raised This Month: $ Target: $400
 0% 

Need help with task


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Mxnn
Veteran Member
Join Date: Aug 2009
Location: AT MY HOME
Old 07-15-2010 , 13:36   Re: Need help with task
Reply With Quote #2

PHP Code:

#include <fakemeta>
new boolcan_revive[33]
public 
event_death()
{
    new 
id read_data(2)
    
    
reset_player(id)
    if(
g_haskit[id])
    {
        
g_haskit[id] = false
    
}
    
    static 
Float:minsize[3]
    
pev(idpev_minsminsize)
    
    if(
minsize[2] == -18.0)
        
g_wasducking[id] = true
    
else
        
g_wasducking[id] = false
    
    set_task
(0.5"task_check_dead_flag"id)
    
set_task(15"task_b"id)
}

public 
task_check_dead_flag(id)
{
    if(!
is_user_connected(id))
        return
    
    if(
pev(idpev_deadflag) == DEAD_DEAD)
        
create_fake_corpse(id)
    else
        
set_task(0.5"task_check_dead_flag"id)
}
  
public 
task_b(id) {
    
can_revive[id] = false


public 
round_start() 
      for (new 
i=1i<=get_maxplayers(); i++)
            if (
is_user_alive(i) && is_user_connected(i))
                   
can_revive[i] = true

//Now you have to check if player want to revive someone..
//I suppose that to revive someone you have to write in say "/revive [name]"
public plugin_init() {
      
register_event("HLTV","Event_StartRound","a","1=0","2=0")
      
register_clcmd("say /revive""sayrevive"ADMIN_ALL)
}

public 
sayrevive(idlevelcid) {
          if (!
cmd_access(idlevelcid3)
                    
//He put more of 3 arguments
                     
return PLUGIN_HANDLED
          
new data[32]
          
read_argv(2data31)
          if (!
is_user_alive(id) || is_user_alive(data))
                     
//Revived client are alive or reviver are dead
                     
return PLUGIN_HANDLED
          
new rid find_player("lb"data)
          if (!
rid)
                     
//Part of name doesn't found
                     
return PLUGIN_HANDLED
          
if (!can_revive[rid]) //If can revive is false
                     //15 seconds have passed
                     
return PLUGIN_HANDLED
          ExecuteHamB
(Ham_CS_RoundRespawnrid)
          
set_task(0.1,"revivePl",0,rid,2)    

          return 
PLUGIN_CONTINUE    
}

public 
revivePl(id

    
fm_DispatchSpawn(id
    if (
get_user_team(id)==1
    { 
        
fm_give_item(id,weapons[WEAPON_KNIFE]) 
        
fm_give_item(id,weapons[WEAPON_GLOCK18]) 
        
fm_give_item_x(id,ammo_9mm,2)
    } 
    else 
    { 
        
fm_give_item(id,weapons[WEAPON_KNIFE]) 
        
fm_give_item(id,weapons[WEAPON_USP]) 
        
fm_give_item_x(id,ammo_45acp,2
    }

Test it
Mxnn is offline
 



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:07.


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