AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Solved dublicate respawn [ham] (https://forums.alliedmods.net/showthread.php?t=298659)

D3XT3R 06-19-2017 09:55

dublicate respawn [ham]
 
Hi ther i have a script problem with respawn i want to protect from dublicate


when player press in RESPAWN Button in menu as it script:
PHP Code:

            menu_additem(menu"Respawn - \r6000XP"__, (!is_user_alive(id) && xp >= 6000) ? -call); 

and it function:
PHP Code:

                case 4:
                {
                    if(!
is_user_alive(id))
                    {
                        
set_pev(idpev_deadflagDEAD_RESPAWNABLE);
                        
set_task(0.2"respawn"id)
                        
                        
set_user_xp(idget_user_xp(id)-6000);
                    } 

and respawn tast function:
PHP Code:

public respawn(id) { ExecuteHamB(Ham_CS_RoundRespawnid); } 

and my problem is when press in button its dublicate respawn then get respawn as fell like round get restart as you know guy so i want protect from 2 dublicat respawn as it dont took 2 times xp only respawn 2 times in 1 secound....

D3XT3R 06-19-2017 10:27

Re: dublicate respawn [ham]
 
SLOVED!

eyal282 06-25-2017 02:15

Re: dublicate respawn [ham]
 
Quote:

Originally Posted by D3XT3R (Post 2529830)
SLOVED!

Please if you solve stuff post what happened, might help others. I think removing respawnable flag would work.

D3XT3R 06-25-2017 20:06

Re: dublicate respawn [ham]
 
just removed ham becuase i using prev


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

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