Raised This Month: $ Target: $400
 0% 

new round keeps hp


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Nutu_
AlliedModders Donor
Join Date: Mar 2016
Location: Germany
Old 08-28-2022 , 05:21   Re: new round keeps hp
Reply With Quote #1

1st, i want to add more than just hp, speed and gravity too..
2nd, do i have to use spawnpost because i dont want to show the menu everyround to a player..
__________________
a simple act of caring creates an endless ripple.
Nutu_ is offline
deprale
Senior Member
Join Date: Oct 2018
Location: Leeds
Old 08-28-2022 , 14:29   Re: new round keeps hp
Reply With Quote #2

Quote:
Originally Posted by Nutu_ View Post
1st, i want to add more than just hp, speed and gravity too..
2nd, do i have to use spawnpost because i dont want to show the menu everyround to a player..
Of course you don't have to use spawnpost, and you can just add iSetSpeed and iSetGravity in the enum, then set them in the g_Classes array after the HP, it's scalable! I used spawnpost because it was easier for my example, exactly why I didn't build a whole menu for the demo.

PHP Code:
enum _:Classes
{
    
szClassName[64],
    
iSetHealth,
    
iSetSpeed,
    
iSetGravity
}

new const 
g_Classes[ ][ Classes ] = {
    {
"BATMAN"1555450600}, // This is poor hardcoding practice, I'd suggest defining the classes speed & gravity for each one, so you can easily change them after. #define CLASS_SPEED int #define CLASS_GRAVITY int
    
{"HUMAN"200250800}, // And use them instead of these 'hardcoded' values here, will be more readable and better in long term.
    
{"ZOMBIE"1004500700},
    {
"TAKTU"99991001000}

^ This is poor hardcoding practice, I'd suggest defining the classes speed & gravity for each one, so you can easily change them after.
__________________

Last edited by deprale; 08-28-2022 at 14:34.
deprale is offline
Reply



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 15:33.


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