AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Add objective in map (https://forums.alliedmods.net/showthread.php?t=229416)

Jhob94 11-07-2013 09:03

Add objective in map
 
Is it possible to add new objective in map?
I want that in de_ maps, the objective is plant the bomb but i also want vip in T team and if vip dies, T lose the round. If is possible, how i can do that?

alan_el_more 11-07-2013 09:32

Re: Add objective in map
 
PHP Code:

// g_VipT will store terrorist vip index
new g_VipT

public plugin_init()
{
    
register_event("HLTV""EventRoundStart""a""1=0""2=0")
}

public 
EventRoundStart()
{
    
g_VipT GetRandomPlayer("ae""TERRORIST")
}

GetRandomPlayer(const Flags[]="", const Team[]="")
{
    new 
Players[32], Pnum
    get_players
(PlayersPnumFlagsTeam)
    
    return (
Pnum 0) ? Players[random(Pnum)] : 0


Search "Terminate round"

hornet 11-07-2013 17:07

Re: Add objective in map
 
Quote:

Originally Posted by alan_el_more (Post 2057917)
PHP Code:

// g_VipT will store terrorist vip index 


Nah, it won't. Players haven't spawned at HLTV event.

@Jhob You could play around with the CGameRules memory offsets.
My bad read your request incorrectly. Simple select a random alive terrorist and when he is killed you can use Round Terminator to kill the round.


All times are GMT -4. The time now is 23:20.

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