Raised This Month: $ Target: $400
 0% 

optimize nVault save/load?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Blizzard_87
Veteran Member
Join Date: Oct 2012
Old 05-22-2013 , 17:45   Re: optimize nVault save/load?
Reply With Quote #1

Quote:
Originally Posted by ConnorMcLeod View Post
Then you can do something like this :

PHP Code:
//Constants
new const g_mItemsmSaveDatas ][ GunItems ] =
{
    
// Pistols
    
{
        { 
"USP""weapon_usp"CSW_USP100 }, // = 0
        
"Glock""weapon_glock18"CSW_GLOCK18120 }, // = 1
        
"Deagle""weapon_deagle"CSW_DEAGLE35 }, // = 2
        
"228 Compact""weapon_p228"CSW_P22852 }, // =3
        
"Dual Elites""weapon_elite"CSW_ELITE120 }, // = 4
        
"Five-Seven""weapon_fiveseven"CSW_FIVESEVEN100 // = 5
    
},
    
// ShotGuns
    
{
        
}
// new const g_szPistols[ MAX_PISTOL ][ GunItems ] = {
    // { "USP", "weapon_usp", CSW_USP, 100 }, // = 0
    // { "Glock", "weapon_glock18", CSW_GLOCK18, 120 }, // = 1
    // { "Deagle", "weapon_deagle", CSW_DEAGLE, 35 }, // = 2
    // { "228 Compact", "weapon_p228", CSW_P228, 52 }, // =3
    // { "Dual Elites", "weapon_elite", CSW_ELITE, 120 }, // = 4
    // { "Five-Seven", "weapon_fiveseven", CSW_FIVESEVEN, 100 } // = 5
// }; 
ah i see then i can use something like this in rest of code...

Code:
g_mItems[ m_iPistols ][ GunName ][ item ]
? havent tried yet only mobile.

EDIT:

Code:
// Enum enum _:GunItems {     GunName[ 32 ], GunWeapon[ 32 ], csw, ammo }; enum _:SayCmds {     Say[ 32 ], Func[ 32 ] }; enum _:mSaveDatas {     m_iPistols[6],     m_iShotGuns[2],     m_iSmgs[5],     m_iRiffles[10],     m_iMachineGun,     m_iEquipments[8] } // Variables new g_mPlayerStore[ 33 ][ mSaveDatas + 1 ]; //Constants new const g_mItems[ mSaveDatas ][ GunItems ] = {     // Pistols     {         { "USP", "weapon_usp", CSW_USP, 100 }, // = 0         { "Glock", "weapon_glock18", CSW_GLOCK18, 120 }, // = 1         { "Deagle", "weapon_deagle", CSW_DEAGLE, 35 }, // = 2         { "228 Compact", "weapon_p228", CSW_P228, 52 }, // =3         { "Dual Elites", "weapon_elite", CSW_ELITE, 120 }, // = 4         { "Five-Seven", "weapon_fiveseven", CSW_FIVESEVEN, 100 } // = 5     },     // ShotGuns     {         { "Pump Shotgun", "weapon_m3", CSW_M3, 32 }, // = 0         { "Auto Shotgun", "weapon_xm1014", CSW_XM1014, 32 } // = 1     },     // SMGs     {         { "MP5", "weapon_mp5navy", CSW_MP5NAVY, 120 }, // = 0         { "TMP", "weapon_tmp", CSW_TMP, 120 }, // = 1         { "P90", "weapon_p90", CSW_P90, 100 }, // = 2         { "Mac10", "weapon_mac10", CSW_MAC10, 100 }, // = 3         { "UMP", "weapon_ump45", CSW_UMP45, 100 } // = 4     },     // Rifles     {         { "Clarion", "weapon_famas", CSW_FAMAS, 90 }, // = 0         { "Krieg SG552", "weapon_sg552", CSW_SG552, 90 }, // = 1         { "AK47", "weapon_ak47", CSW_AK47, 90 }, // = 2         { "M4A1", "weapon_m4a1", CSW_M4A1, 90 }, // = 3         { "Bullpup", "weapon_aug", CSW_AUG, 90 }, // = 4         { "Scout", "weapon_scout", CSW_SCOUT, 90 }, // = 5         { "AWP", "weapon_awp", CSW_AWP, 90 }, // = 6         { "CT AutoSniper", "weapon_g3sg1", CSW_G3SG1, 90 }, // = 7         { "T AutoSniper", "weapon_sg550", CSW_SG550, 90 }, // = 8         { "Galil", "weapon_galil", CSW_GALIL, 90 } // = 9     },     // MachineGun ( Para )     {         { "M249 ( Para )", "weapon_m249", CSW_M249, 200 } // = 0     },     // Equipment     {         { "Kevlar", "item_kevlar" }, // 0         { "Kevlar + Helmet", "item_assaultsuit" }, // = 1         { "Flashbang Grenade", "weapon_flashbang", CSW_FLASHBANG, 2 }, // = 2         { "HE Grenade", "weapon_hegrenade", CSW_HEGRENADE, 1 }, // = 3         { "Smoke Grenade", "weapon_smokegrenade", CSW_SMOKEGRENADE, 1 }, // = 4         { "Defusal Kit", "item_thighpack" }, // = 5         { "Nighvision Goggles" }, // = 6         { "Shield", "weapon_shield" } // = 7        }};

and im getting these errors

Code:
Welcome to the AMX Mod X 1.8.1-300 Compiler.
Copyright (c) 1997-2013 ITB CompuPhase, AMX Mod X Team

Error: Invalid symbol name "" on line 96
Error: Start of function body without function header on line 101
Error: Start of function body without function header on line 109
Error: Start of function body without function header on line 122
Error: Start of function body without function header on line 126
Error: Invalid function or declaration on line 136
__________________

Last edited by Blizzard_87; 05-22-2013 at 18:14.
Blizzard_87 is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 05-22-2013 , 18:14   Re: optimize nVault save/load?
Reply With Quote #2

g_mItems[ m_iPistols ][ item ][ GunName ]
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
Blizzard_87
Veteran Member
Join Date: Oct 2012
Old 05-22-2013 , 21:46   Re: optimize nVault save/load?
Reply With Quote #3

Quote:
Originally Posted by ConnorMcLeod View Post
g_mItems[ m_iPistols ][ item ][ GunName ]
ok thanks now these errors are showing up.

Code:
Welcome to the AMX Mod X 1.8.1-300 Compiler.
Copyright (c) 1997-2013 ITB CompuPhase, AMX Mod X Team

Warning: Length of initialler exceeds size of the enum field on line 90
Warning: Length of initialler exceeds size of the enum field on line 91
Error: Must be a constant expression; assumed zero on line 92
Error: Invalid symbol name "" on line 96
Error: Start of function body without function header on line 101
Error: Start of function body without function header on line 109
Error: Start of function body without function header on line 122
Error: Start of function body without function header on line 126
Error: Invalid function or declaration on line 136
Error: Expected token: "]", but found "-identifier-" on line 345
Error: Invalid expression, assumed zero on line 345
Error: Invalid expression, assumed zero on line 345
Error: Too many error messages on one line on line 345

Compilation aborted.
11 Errors.
Could not locate output file C:\Program Files (x86)\Steam\steamapps\common\Half-Life\cstrike\addons\amxmodx\plugins\CS-Store1.0.0.amx (compile failed).
http://pastebin.com/KHnLmrq6
above link so you can see lines for errors.
__________________
Blizzard_87 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 16:17.


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