AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   question about Players (https://forums.alliedmods.net/showthread.php?t=225696)

MrKiller2010 09-08-2013 05:04

question about Players
 
I have a plugin which counts and all players, once there is one T left it should run a command.

It works perfect with a server with bots only.

I tried it with real players. It run the commands when there is 5 Ts left.
I doesn't count the players right.

My question:
Why does it works perfect with bots and not with real players?

JusTGo 09-08-2013 05:16

Re: question about Players
 
how we can help and you not giving us some information post the code or maby you are not cheking if player alive/valid/connected..

MrKiller2010 09-08-2013 05:27

Re: question about Players
 
Quote:

Originally Posted by JusTGo (Post 2030464)
how we can help and you not giving us some information post the code or maby you are not cheking if player alive/valid/connected..

How can i check if the player is alive/valid/connected


PHP Code:

public Ham_PlayerKillediVictimiAttackershouldgibid 
{    
    new 
players[32], num
    get_players
(playersnum"ae""TERRORIST")

    if (
num == 1)
    
StopGame();


Should it be:

PHP Code:

public Ham_PlayerKillediVictimiAttackershouldgibid 
{
    if( !
is_user_aliveid ) )
        return 
HAM_IGNORED;

    new 
players[32], num
    get_players
(playersnum"ae""TERRORIST")

    if (
num == 1)
    
StopGame();



mottzi 09-08-2013 06:03

Re: question about Players
 
Show plugin_init()

MrKiller2010 09-08-2013 06:31

Re: question about Players
 
Quote:

Originally Posted by JusTGo (Post 2030464)
how we can help and you not giving us some information post the code or maby you are not cheking if player alive/valid/connected..

Quote:

Originally Posted by mottzi (Post 2030482)
Show plugin_init()

PHP Code:

public plugin_init()
{
    
register_plugin("JB GM"VERSION"MrKiller2010");
    
register_clcmd"say /gm""GameMenu" );
    
register_clcmd"say /music""musicmenu" );
    
register_clcmd"say /open""OpenCell" );
    
    
register_logevent"LogEvent_RoundEnd",     2"1=Round_End"     );
    
    
    
RegisterHamHam_Touch"grenade""Ham_Touch_Grenade_Pre");
    
RegisterHamHam_Killed"player""Ham_PlayerKilled", .Post=);
    
RegisterHamHam_Touch"armoury_entity""Ham_WeaponTouch_Pre");
    
RegisterHamHam_Touch"weaponbox""Ham_WeaponTouch_Pre");
    
RegisterHamHam_Touch"worldspawn""Ham_WallTouch_Pre");
    
RegisterHamHam_Touch"func_wall""Ham_WallTouch_Pre");
    
RegisterHamHam_Touch"func_breakable""Ham_WallTouch_Pre");
    
RegisterHamHam_Weapon_PrimaryAttack"weapon_deagle""Ham_ElitePrimaryAttack")
    
    
register_event"23""EventSpray""a""1=112" )
    
register_event("CurWeapon""event_CurWeapon""be""1=1")
    
register_forward(FM_AddToFullPack"Forward_AddToFullPack_Post");
    
register_forward(FM_PlayerPreThink"Forward_PreThink");
    
register_forward(FM_PlayerPreThink"fw_playerprethink"1);
    
register_forward(FM_SetModel"fwdSetModel")
    
register_forward(FM_EmitSound "EmitSound")
    
register_forward(FM_PlaybackEvent"fwPlaybackEvent")
    
    
    
g_pOpenCells    register_cvar"jb_opencells""1" );
    
    
setup_buttons();



akcaliberg 09-08-2013 12:42

Re: question about Players
 
Quote:

Originally Posted by MrKiller2010 (Post 2030468)
How can i check if the player is alive/valid/connected


PHP Code:

public Ham_PlayerKillediVictimiAttackershouldgibid 
{    
    new 
players[32], num
    get_players
(playersnum"ae""TERRORIST")

    if (
num == 1)
    
StopGame();


Should it be:

PHP Code:

public Ham_PlayerKillediVictimiAttackershouldgibid 
{
    if( !
is_user_aliveid ) )
        return 
HAM_IGNORED;

    new 
players[32], num
    get_players
(playersnum"ae""TERRORIST")

    if (
num == 1)
    
StopGame();



I don't think Ham_Killed has 4 parameters. Remove the last parameter "id". Probably it's not the problem though.
Plus, ident StopGame(); with one tab


All times are GMT -4. The time now is 19:14.

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