View Single Post
deprale
Senior Member
Join Date: Oct 2018
Location: Leeds
Old 08-28-2022 , 14:29   Re: new round keeps hp
Reply With Quote #6

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