AlliedModders

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

skz 04-21-2016 11:33

Transfer Menu
 
Hi guys!

I made a menu to replace the original "M" menu of counter strike 1.6, but the problem is if there's no one playing and 1 was on spectator and wants to play, he joins for example CT team with my menu but i will stay dead until someone joins the server on terrorist side or if he disconect and connect again on the server.

I tryed this was to fix it but it doesn't work because the player doesn't respawn and I don't know why, someone have another idea?

PHP Code:

for(new i33i++)  
{  
    new 
players[33], numplay
                        
    
if(cs_get_user_team(i) == CS_TEAM_CT/*this is just an example for one team, in this case for CT team*/ && is_user_alive(i))
    {
        
players[numplay++] = i
    
}
                        
    if (
numplay == 0)
    {
        
ExecuteHamB(Ham_CS_RoundRespawn,id)
        
user_silentkill(id/*this "id" is already assigned as the player who opened the menu"*/
    }



siriusmd99 04-21-2016 13:58

Re: Transfer Menu
 
Replace ExecuteHamB... with this :

PHP Code:


set_pev
(idpev_deadflagDEAD_RESPAWNABLE)
dllfunc(DLLFunc_Thinkid

Not sure 100% but you may try.
And add condition to userkill:
PHP Code:

if(is_user_alive(id))
  
user_silentkill(id


Maybe the error is caused by user_silentkill code which is executed on already dead player, i dont know , just make it safe and test.

skz 04-21-2016 14:43

Re: Transfer Menu
 
Quote:

Originally Posted by siriusmd99 (Post 2412942)
Replace ExecuteHamB... with this :

PHP Code:


set_pev
(idpev_deadflagDEAD_RESPAWNABLE)
dllfunc(DLLFunc_Thinkid


It doesn't work either

Quote:

Originally Posted by siriusmd99 (Post 2412942)
And add condition to userkill:
PHP Code:

if(is_user_alive(id))
  
user_silentkill(id


Maybe the error is caused by user_silentkill code which is executed on already dead player, i dont know , just make it safe and test.

But if the player is respawned, we don't have to verify if he is alive, right?


All times are GMT -4. The time now is 18:38.

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