AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Help Code (https://forums.alliedmods.net/showthread.php?t=193979)

wTf. 08-24-2012 09:55

Help Code
 
PHP Code:

public yenitur()
{
    new 
oyuncusayisi get_playersnum(0);
    if (
oyuncusayisi get_pcvar_num(g_enazoyuncusayisi)) return
    
    new 
Players[32], iCountrasgele
    get_players
(Players,iCount,"e","TERRORIST")
    if(
iCount 0)
    {
        
rasgele Playersrandom_num(0iCount) ]
        
client_cmd(rasgele,"cadiol")
        new 
terrname[64]
        
get_user_name(rasgeleterrname63)
        
set_hudmessage(2552552550.030.6006.05.0,_,_,21)
        
show_hudmessage(0"Bu Elin TE Cadisi :^n%s",terrname)
    }



Here not work. Where is the problem?

EDIT:

PHP Code:

public cadiol(id)
{
    if(
sadecebicak[id] == 0){
        
        
        
reset_value_player(id)
        
        if(
is_user_bot(id))
        {
            
set_task(random_float(5.0,15.0), "bot_use_skill"id+TASK_BOT_USE_SKILL)
            return
        }
        
sadecebicak[id]     = 1
        strip_user_weapons
(id)
        
give_item(id"weapon_knife")
        
engclient_cmdid"weapon_knife" );
        
set_pev(idpev_health,5000.0)
        
set_pev(idpev_viewmodel2,  "models/zombie_plague/v_knife_witch_zombi.mdl"
        
set_pev(idpev_weaponmodel2"")
        if (
get_user_team(id) == ) {
            
cs_set_user_model(id"cadimodelite")
        }
        else {
            
cs_set_user_model(id"cadimodelict")
        }
        
zp_colored_print(id"^x04[CSM]^x01 Cadi Oldun.^x04 Yarasa Firlatma^x01 Özelligin Var.^x04 %.1f ^x01saniyede bir ^x04G ^x01tusuna basarak firlatabilirsin."bat_timewait)
        
    }
    
    if(
sadecebicak[id] == 1){
        
zp_colored_print(id"^x04[CSM]^x01 Sen Zaten Cadisin!")
    }



claudiuhks 08-24-2012 10:06

Re: Help Code
 
What are you trying to do?
Slowhacking is not allowed.

wTf. 08-24-2012 10:15

Re: Help Code
 
Shows the name of the player.
But, after selecting the random name sometimes server name writes.

and the player randomly selected can't work it client_cmd.

claudiuhks 08-24-2012 10:46

Re: Help Code
 
PHP Code:

new iPlayersCountInServer get_playersnum); // Players which are connected will be counted
new iPlayersCountInServer get_playersnum); // Same with first + counting connecting players too

new iPlayers32 ] = { 0, ... }, iCount 0;
get_playersiPlayersiCount );

if( 
iCount ) {
  new 
iRandom random_num0iCount );
  new 
iPlayer iPlayersiRandom ];

  new 
cName32 ];
  
get_user_nameiPlayercName31 );



wTf. 08-24-2012 11:02

Re: Help Code
 
EDIT:

code work. But
Quote:

Originally Posted by wTf. (Post 1781353)
the player randomly selected can't work it client_cmd.


Liverwiz 08-24-2012 12:15

Re: Help Code
 
what does the command "cadiol" do? You may be sending it improperly....


All times are GMT -4. The time now is 05:45.

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