Raised This Month: $ Target: $400
 0% 

[Problem] Save a constant


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
wiDD.
Member
Join Date: Jul 2013
Location: Argentina
Old 09-20-2013 , 09:02   [Problem] Save a constant
Reply With Quote #1

How can I save this constant:

PHP Code:
new const NECESITADOS[5] = { 1015306080 
In this system (NFvault):

PHP Code:
#include <amxmodx>
#include <nfvault> // Include que usaremos

new VaultFile[128], szData[180], szKey[30]

new 
g_Exp[33], g_AmmoPacks[33]

// Se inicia el Plugin...
public plugin_init()
{
    
register_plugin("Guardado Nfvault""1.0""DJHD!")

    
nfv_file("Datos"VaultFilecharsmax(VaultFile))
}

GuardarDatos(id)
{
    new 
gName[32]
    
get_user_name(idgNamecharsmax(gName))

    
formatex(szKeycharsmax(szKey), "db_datos")
    
    
formatex(szDatacharsmax(szData), "%d %d"g_Exp[id], g_AmmoPacks[id])
    
    
nfv_set_data(VaultFileszKeygNameszData)
}

CargarDatos(id)
{    
    new 
gName[32], g_Load_Exp[25], g_Load_AmmoPacks[25]
    
get_user_name(idgNamecharsmax(gName))
    
    
formatex(szKeycharsmax(szKey), "db_datos")

     if(!
nfv_get_data(VaultFileszKeygNameszDatasizeof(szData) - 1))
        return;

    
parse(szDatag_Load_Expcharsmax(g_Load_Exp), g_Load_AmmoPackscharsmax(g_Load_AmmoPacks))

    
g_Exp[id] = str_to_num(g_Load_Exp)
    
g_AmmoPacks[id] = str_to_num(g_Load_AmmoPacks)

wiDD. is offline
Black Rose
Veteran Member
Join Date: Feb 2011
Location: Stockholm, Sweden
Old 09-20-2013 , 13:16   Re: [Problem] Save a constant
Reply With Quote #2

formatex(szData, charsmax(szData), "%d %d %d %d %d %d %d", g_Exp[id], g_AmmoPacks[id], NECESITADOS[0], NECESITADOS[1], NECESITADOS[2], NECESITADOS[3], NECESITADOS[4])

But since it's a constant it seems pretty unnecessary...
__________________
Black Rose is offline
colossus
Member
Join Date: Sep 2013
Old 09-23-2013 , 11:00   Re: [Problem] Save a constant
Reply With Quote #3

Don't save constant is not necessary
colossus 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 18:53.


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