Raised This Month: $114 Target: $400
 28% 

very stupid question


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
bakir123
Senior Member
Join Date: Jan 2015
Location: Palestine, Hebron
Old 10-23-2017 , 09:20   very stupid question
Reply With Quote #1

hello guys
i will ask some questions
i'm using zombie mod. so i posted my question here, cuz in ZP mod section no one answer
anyway

so
in mod

there are cvar for human HP and nem hp and Assa hp
well ?
i replaced cvar with new const Humanhp = 150;

see here:

PHP Code:
fm_set_user_health(idg_HumanHP
PHP Code:
new const g_HumanHP =   150
so please, you think its a fine way ? or it's causing lag or crash ?

Last edited by bakir123; 10-23-2017 at 09:21.
bakir123 is offline
Send a message via Skype™ to bakir123
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 10-23-2017 , 10:47   Re: very stupid question
Reply With Quote #2

Is there a reason for doing that?...
__________________


Dear admins. If somehow you managed to read this, plz fix.
OciXCrom is offline
Send a message via Skype™ to OciXCrom
Relaxing
AlliedModders Donor
Join Date: Jun 2016
Location: White Plains
Old 10-23-2017 , 10:56   Re: very stupid question
Reply With Quote #3

Well, by doing that you no longer control human's health by cvar. To change it again you have to edit the source file.
It's fine.
__________________
Relaxing is offline
bakir123
Senior Member
Join Date: Jan 2015
Location: Palestine, Hebron
Old 10-23-2017 , 11:07   Re: very stupid question
Reply With Quote #4

Quote:
Originally Posted by OciXCrom View Post
Is there a reason for doing that?...
yes
i don't want to change by cvar
only with new

and what about this ??

PHP Code:
    // Respawn if deathmatch is enabled
    
if (get_pcvar_num(cvar_deathmatch))
    {
        new 
re_per_round get_cvar_num("zp_respawn_per_round")
        if(
respawns[victim] > re_per_round)
        {
            
ColorChat(victimGREY"%s You can't be respawned anymore in this round (maximum %d)"CHAT_PREFIX,re_per_round );            
            return;
        }
        else
        {
            
respawns[victim]++
            
ColorChat(victimGREY"%s You have %d chances to be respawned."CHAT_PREFIX,(re_per_round-respawns[victim]));    
        }

        
// Respawn on suicide?
        
if (selfkill && !get_pcvar_num(cvar_respawnonsuicide))
            return;
        
        
// Respawn if human/zombie/nemesis/survivor?
        
if ((g_zombie[victim] && !g_nemesis[victim] && !g_assassin[victim] && !get_pcvar_num(cvar_respawnzomb)) || (!g_zombie[victim] && !g_survivor[victim] && !g_sniper[victim] && !get_pcvar_num(cvar_respawnhum)) || (g_nemesis[victim] && !get_pcvar_num(cvar_respawnnem)) || (g_assassin[victim] && !get_pcvar_num(cvar_respawnassa)) || (g_survivor[victim] && !get_pcvar_num(cvar_respawnsurv)) || (g_sniper[victim] && !get_pcvar_num(cvar_respawnsni)))
            return;
        
        
// Set the respawn task
        
set_task(get_pcvar_float(cvar_spawndelay), "respawn_player_task"victim+TASK_SPAWN)
    } 
espically this :
PHP Code:
if (get_pcvar_num(cvar_deathmatch)) 
if i put cvar = 0 , no deathmatch , 1 = zombie respawn , 2 = human, 3 = random , 4 = blance

so how i can replace it with ??

can it be done with new const g_DeathMatch = 4; . for example ? or 0 for disable it ?
bakir123 is offline
Send a message via Skype™ to bakir123
Relaxing
AlliedModders Donor
Join Date: Jun 2016
Location: White Plains
Old 10-23-2017 , 11:43   Re: very stupid question
Reply With Quote #5

This checks whether the cvar is 1 or 0,
1 on true statement, 0 on false.
If you want to block the deathmatch cvar just delete the if statement, respawn_player_task func. and the cvarS.

Using const integers you can't change the value of it, since const is used & in this case it will be always deathmatch.

For multiple mods you can use if (get_pcvar_num(cvar_deathmatch) ==1 / 2 / 3 ...) depending on the amount of gameplays you want to add.
__________________

Last edited by Relaxing; 10-23-2017 at 11:47.
Relaxing is offline
bakir123
Senior Member
Join Date: Jan 2015
Location: Palestine, Hebron
Old 10-23-2017 , 11:48   Re: very stupid question
Reply With Quote #6

Quote:
Originally Posted by Relaxing View Post
This checks whether the cvar is 1 or 0,
1 on true statement, 0 on false.
If you want to block the deathmatch cvar just delete the if statement, respawn_player_task func. and the cvarS.

Using const integers you can't change the value of it, since const is used & in this case it will be always deathmatch.

For multiple mods you can use if (get_pcvar_num(cvar_deathmatch) ==1 / 2 / 3 ...) depending on the amount of gameplays you want to add.

look to this code bro

PHP Code:
        // Respawn as zombie?
        
if (get_pcvar_num(cvar_deathmatch) == || (get_pcvar_num(cvar_deathmatch) == && random_num(01)) || (get_pcvar_num(cvar_deathmatch) == && fnGetZombies() < fnGetAlive()/2))
            
g_respawn_as_zombie[ID_SPAWN] = true 
i can put it 2 or 3 or 4

well ?
but how to remove this cvar, and replace with new const ?
or how ?
bakir123 is offline
Send a message via Skype™ to bakir123
Relaxing
AlliedModders Donor
Join Date: Jun 2016
Location: White Plains
Old 10-23-2017 , 13:16   Re: very stupid question
Reply With Quote #7

Hold on a second. This is not what I said. Your condition is to complicated for no reason.
Looks like you love using new constants

if (get_pcvar_num(cvar_gameplay) == 1)
go_to_deathmatch(id);

else if (get_pcvar_num(cvar_gameplay) == 2)
go_to_human(id);

This is what I ment. Read more informations about consts. Also check tutorials on Scripting forum.
__________________
Relaxing is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 10-23-2017 , 13:16   Re: very stupid question
Reply With Quote #8

The same way you did with the health. Again, why are you doing this?
__________________


Dear admins. If somehow you managed to read this, plz fix.
OciXCrom is offline
Send a message via Skype™ to OciXCrom
bakir123
Senior Member
Join Date: Jan 2015
Location: Palestine, Hebron
Old 10-23-2017 , 13:39   Re: very stupid question
Reply With Quote #9

Quote:
Originally Posted by OciXCrom View Post
The same way you did with the health. Again, why are you doing this?
well
in my server, many admin using amx_cvar and changing much things
and i can't remove amx_cvar, because it's using so much for amx_cvar mp_timelimit

that's all

so
i want to use same way as humaHP ?

and will it work fine when i put 3 or 4 "?
bakir123 is offline
Send a message via Skype™ to bakir123
bakir123
Senior Member
Join Date: Jan 2015
Location: Palestine, Hebron
Old 10-26-2017 , 14:27   Re: very stupid question
Reply With Quote #10

i have did what you said
but not working
see code

PHP Code:
        // Respawn as zombie?
        
if (g_DeathMatch == || (g_DeathMatch == && random_num(01)) || (g_DeathMatch == && fnGetZombies() < fnGetAlive()/2))
            
g_respawn_as_zombie[ID_SPAWN] = true 
PHP Code:
const g_DeathMatch 2
not working !

players should respawn as zombie

anyone have any idea?
bakir123 is offline
Send a message via Skype™ to bakir123
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


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


Powered by vBulletin®
Copyright ©2000 - 2021, vBulletin Solutions, Inc.
Theme made by Freecode