Raised This Month: $51 Target: $400
 12% 

[HELP] nVault this?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
blAck.
Member
Join Date: Jun 2018
Old 08-27-2018 , 08:51   [HELP] nVault this?
Reply With Quote #1

Can somebody add nVault here so that players don't lose class on map change or else?

Code:
... new g_iBitHasClass; new g_iBitClassRunner, g_iBitClassDoctor; public plugin_init() {     register_plugin("JoinClass", "1.0", "blAck");         RegisterHam(Ham_Spawn, "player", "PlayerSpawn", 1);         register_clcmd("say /myclass", "myclass") } public PlayerSpawn(id) {     if(IsSetBit(g_iBitClassRunner, id)) {         new iHP = get_user_health(id);         set_user_health(id, iHP + 25);         // I'm still working on this plugin so...     }         if(IsSetBit(g_iBitClassDoctor, id)) {         new iHP = get_user_health(id);         set_user_health(id, iHP + 75);     } } public client_putinserver(id) {     if(IsNotSetBit(g_iBitHasClass, id)) {         set_task(10.0, "joinclass", id)     } } public joinclass(id) {     new JoinClass = menu_create("Select your class^n\dYou can select this only once", "joinclass_handler");         menu_additem(JoinClass, "Runner", "", 0); // case 0     menu_additem(JoinClass, "Doctor", "", 0); // case 1         menu_setprop(JoinClass, MPROP_EXIT, MEXIT_ALL);     menu_display(id, JoinClass, 0);         return PLUGIN_HANDLED; } public joinclass_handler(id, JoinClass, item) {     switch(item)     {         case 0:         {             SetBit(g_iBitClassRunner, id);             SetBit(g_iBitHasClass, id);         }         case 1:         {             SetBit(g_iBitClassDoctor, id);             SetBit(g_iBitHasClass, id)         }         case MENU_EXIT:         {             return PLUGIN_HANDLED;         }     }     menu_destroy(JoinClass);     return PLUGIN_HANDLED; } public myclass(id) {     if(IsSetBit(g_iBitClassRunner, id)) {         CC_SendMessage(id, "!tYour class: !gRunner");     }         if(IsSetBit(g_iBitClassDoctor, id)) {         CC_SendMessage(id, "!tYour class: !gDoctor");     }         if(IsNotSetBit(g_iBitHasClass, id)) {         CC_SendMessage(id, "!tYou have no class selected.");     }     return PLUGIN_HANDLED }

Thanks!

Last edited by blAck.; 08-27-2018 at 08:51.
blAck. is offline
Natsheh
Veteran Member
Join Date: Sep 2012
Old 08-27-2018 , 12:16   Re: [HELP] nVault this?
Reply With Quote #2

Use an array for classes instead of bitsum operating.

Using Bitsum will give you the ability to include multiply classes for each player.
__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !

Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
blAck.
Member
Join Date: Jun 2018
Old 08-27-2018 , 13:45   Re: [HELP] nVault this?
Reply With Quote #3

Quote:
Originally Posted by Natsheh View Post
Use an array for classes instead of bitsum operating.

Using Bitsum will give you the ability to include multiply classes for each player.
Yes but I can use nVault with Bitsum, right?
blAck. is offline
Natsheh
Veteran Member
Join Date: Sep 2012
Old 08-27-2018 , 14:08   Re: [HELP] nVault this?
Reply With Quote #4

Quote:
Originally Posted by blAck. View Post
Yes but I can use nVault with Bitsum, right?
Ofcourse but in your situation you dont need bitsum.

PHP Code:
enum CLASSES
{
         
NONE,  RUNNERDOCTOR
}

new 
CLASSES:user_class[33
__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !


Last edited by Natsheh; 08-27-2018 at 14:11.
Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
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 03:42.


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