AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   solved~close (https://forums.alliedmods.net/showthread.php?t=54035)

lucky109 04-15-2007 16:47

solved~close
 
solved~close

Styles 04-15-2007 16:58

Re: Random ID on Every New Round ~
 
sorry for a shitty response at a basketball game ( clippers ). what I would do is.
get_players then do a random(1, players).


Quote:

Originally Posted by lucky109 (Post 465425)
Ok,im trying to pick 1 player randomly each round , and giveitem AWP to him. and the AWP 3 ammo only . but this doesnt seem to work. Thanks


Code:

#include <amxmodx>
#include <fun>
#include <cstrike>

public plugin_init() {
 register_event("ResetHUD","test","b")
 return PLUGIN_HANDLED
}

public test() {
set_task(5.0,"random_player")
}

public random_player() {
new iPlayers[32], iNum
get_players( iPlayers, iNum )
new id, i
for( i = 0; i < iNum; i++ )
{
    id = iPlayers[i]
    give_item(id, "weapon_awp")
}



Dark Kingdom 04-15-2007 17:06

Re: Random ID on Every New Round ~
 
This is untested but compiles

PHP Code:

#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <fun>    

public plugin_init()
{
    
register_event("ResetHUD","test","b")
}

public 
test(id)
{
    
set_task(5.0,"random_player")
    return 
PLUGIN_HANDLED
}

public 
random_player(id)
{
    new 
iPlayers[32], iNum
    get_players
iPlayersiNum )
    new 
idi
    
for( 0iNumi++ )
        
    
id iPlayers[i]
    
give_item(id"CSW_AWP")



Arkshine 04-15-2007 18:34

Re: solved~close
 
1 Attachment(s)
Try this.

You have to compile on your pc because fakemeta_utils is necessary.

You can change ammo in the .sma file : #define AMMO_AWP 3


All times are GMT -4. The time now is 06:36.

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