Quote:
Originally Posted by Nutu_
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", 1555, 450, 600}, // 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", 200, 250, 800}, // And use them instead of these 'hardcoded' values here, will be more readable and better in long term.
{"ZOMBIE", 1004, 500, 700},
{"TAKTU", 9999, 100, 1000}
}
^ This is poor hardcoding practice, I'd suggest defining the classes speed & gravity for each one, so you can easily change them after.
__________________