Raised This Month: $ Target: $400
 0% 

new round keeps hp


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
deprale
Senior Member
Join Date: Oct 2018
Location: Leeds
Old 08-27-2022 , 23:16   Re: new round keeps hp
Reply With Quote #1

PHP Code:
#include <amxmodx>
#include <fun>
#include <hamsandwich>

new gChosenClass[MAX_PLAYERS+1]


enum _:Classes
{
    
szClassName[64],
    
iSetHealth
}

new const 
g_Classes[ ][ Classes ] = {
    {
"BATMAN"1555},
    {
"HUMAN"200},
    {
"ZOMBIE"1004},
    {
"TAKTU"9999}
}

public 
plugin_init(){
    
register_plugin("test""0.0.1""none");
    
RegisterHam(Ham_Spawn"player""fwHamPlayerSpawnPost"1
}

public 
fwHamPlayerSpawnPost(id){
    if (!
is_user_connected(id))
        return 
PLUGIN_HANDLED


    gChosenClass
[id] = // TEMPORARY (You should build your own menu for selection, this is solely for demonstrative purposes)

    
switch(gChosenClass[id]){
        case 
0grant(id0)
        case 
1grant(id1)
        case 
2grant(id2)
        case 
3grant(id3)
    }

    return 
PLUGIN_HANDLED;
}

stock grant(idint){
    
set_user_health(idg_Classesint ][ iSetHealth ])
    
client_print(idprint_center"Your class is %s"g_Classes[int][szClassName])

I didn't build a menu since I don't have the time to build one for this demo.
__________________

Last edited by deprale; 08-27-2022 at 23:16. Reason: forgot the code tags
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