|
Veteran Member
|
02-28-2020
, 12:31
Re: Does not load the vips are connected
|
#3
|
Quote:
Originally Posted by Bugsy
Before I look further, your g_aDataPremiums array is empty and you attempt to pull data from it
Code:
new Array:g_aDataPremiums;
public plugin_init ()
{
register_plugin(PLUGIN, VERSION, AUTHOR )
get_cvar_string("amx_password_field", amx_password_field_string, charsmax (amx_password_field_string ));
}
public client_putinserver (id ) {
set_flags (id );
}
public set_flags (id ) {
static szAuthId [31], szIp [31], szName [32], szPassword [30];
get_user_authid(id, szAuthId, charsmax (szAuthId ));
get_user_ip(id, szIp, charsmax (szIp ), 1);
get_user_name(id, szName, charsmax (szName ));
get_user_info(id, amx_password_field_string, szPassword, charsmax (szPassword ));
g_iUserFlags [id ] = 0
for(new i; i < ArraySize(g_aDataPremiums); i++) { ArrayGetArray(g_aDataPremiums, i, g_aPremium);
|
PHP Code:
public reload_vips() {
new szBuffer[256], szArg[2][8], iFile = fopen("addons/amxmodx/configs/premium.ini", "a+");
if(!iFile)
return set_fail_state("File ^"addons/amxmodx/configs/premium.ini^" not found");
if(g_aDataPremiums)
ArrayDestroy(g_aDataPremiums);
g_aDataPremiums = ArrayCreate(DATA_PREM);
while(!feof(iFile)) {
fgets(iFile, szBuffer, charsmax(szBuffer));
trim(szBuffer);
if(!szBuffer[0] || szBuffer[0] == ';')
continue;
if(parse(szBuffer,
g_aPremium[auth], charsmax(g_aPremium[auth]),
g_aPremium[password], charsmax(g_aPremium[password]),
szArg[0], charsmax(szArg[]),
szArg[1], charsmax(szArg[])
))
continue;
g_aPremium[accessflags] = read_flags(szArg[0]);
g_aPremium[flags] = read_flags(szArg[1]);
}
return 1;
}
Yes i was working on it at the time and did not know if i did it right so now i have edited and added to CODE
|
|
|
|