Code:
set_user_admin(target)
{
new ident[33], pw[5], linne[150]
formatex(pw, 4, "%d%d%d%d", random_num(1, 9), random_num(1, 9), random_num(1, 9), random_num(1, 9))
new File[120]; get_configsdir(File, charsmax(File))
add(File, charsmax(File), "/users.ini")
if(!file_exists(File))
set_fail_state("File configs/users.ini Not Found")
get_user_name(target, ident, charsmax(ident))
formatex(linne, charsmax(linne), "^r^n^"%s^" ^"%s^" ^"%s^" ^"a^"", ident, pw, FLAGS)
client_print(target, print_console, "------------------- | Gold System | -------------------")
client_print(target, print_console, "[AMXX] You have been kiked because you have buy admin")
client_print(target, print_console, "[AMXX] Your password | setinfo is: %s", pw)
client_print(target, print_console, "[AMXX] You should put in your console: setinfo _pw %s", pw)
client_print(target, print_console, "-------------------------| # |-------------------------")
server_cmd("kick #%d ^"Buy Admin successfully ! your password is %s, [See More information in consol]^"", get_user_userid(target), pw)
write_file(File, linne)
server_cmd("amx_reloadadmins")
}
You're really pushing your luck non-steamer...
Go through your code a couple of times to make sure you didn't miss stuff like this:
Code:
public gold_handler( id, menu, item )
{
if( item == MENU_EXIT )
{
menu_destroy( menu );
return PLUGIN_HANDLED;
}
new szData[6];
new iAccess, hCallback;
menu_item_getinfo( menu, item, iAccess, szData, 5, _, _, hCallback );
new name[32]
get_user_name(id,name,32)
switch( str_to_num( szData ) )
{
case 1: gold_shop(id)
case 2:
{
if( is_user_admin ( id ) )
{
return PLUGIN_HANDLED;
}
new golds = gGolds[id]
if( golds < get_pcvar_num( gAdmincost ) )
{
ColorChat(id,GREEN, "^1[^4%s^1] You need ^4%d Golds For Buy ^4ADMIN", PREFIX, get_pcvar_num( gAdmincost ) )
return PLUGIN_HANDLED;
}
set_user_admin(id)
gGolds[id] -= get_pcvar_num( gAdmincost );
menu_display( id, menu, 0 );
}
case 3: ShowPoints(id)
case 4: Donate_Menu(id)
}
return PLUGIN_HANDLED;
}
Completely useless to add GOLDS to a perfectly valid key already:
Code:
formatex( vKey, charsmax( vKey ), "%sGOLDS", gSteamID );
__________________