AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   ammopacks record kept of help! (https://forums.alliedmods.net/showthread.php?t=106940)

Spartan! 10-20-2009 17:05

ammopacks record kept of help!
 
Hi everyone my problem is this: I have the ammopacks saved by intoxicadoo name and password but when I created the account and leave me off and not let me enter the server but that tells me the password is wrong here I leave the code

PHP Code:

#include <amxmodx>
#include <amxmisc>
#include <fvault>

#define PLUGIN "Menu de Registracion"
#define VERSION "1.0"
#define AUTHOR "starsailor eddit itoxicadooo"
#define MAX_NAMES 99999

new const g_reg[] = "registracioon"
new pwstore[MAX_NAMES][32]
new 
namestore[MAX_NAMES][32]
new 
numlista
new cvar_password_prefijo

public plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
register_clcmd("say /reg""menu_registrar")
    
    
//Comandos
    
register_concmd("zp_nicks_list""taglist"ADMIN_LEVEL_G)
    
cvar_password_prefijo register_cvar("tut_password_prefijo""_zp")
    
    
register_message(get_user_msgid("SayText"), "nocambiartag")
}
public 
client_putinserver(id)
{
    
set_task(0.5,"menu_registrar",id)
}
public 
menu_registrar(id)
{
    new 
reg menu_create("\yMenu de Registracion:""abrirmenureg")
    
    
menu_additem(reg"\wRegistrarse\r(Recomendado)""1"0)
    
menu_additem(reg"\wNo registrarse\r(No Recomendado)""2"0)
    
    
menu_setprop(regMPROP_EXITMEXIT_ALL)
    
    
menu_display(idreg0)
}

public 
abrirmenureg(idregitem)
{
    if (
item == MENU_EXIT)
    {
        
menu_destroy(reg)
        return 
PLUGIN_HANDLED
    
}
    new 
data[6], iName[64]
    new 
accesscallback
    menu_item_getinfo
(regitemaccessdata,5iName63callback)
    
    switch(
str_to_num(data))
    {
        case 
1:
        {
            
registrar(id);
        }
        case 
2:
        {
            
console_print(id"lala")
        }
    }
    
menu_destroy(reg)
    return 
PLUGIN_HANDLED
}
public 
registrar(id)
{
    switch(
registracion(id))
    {
        case 
1:
        {
            
client_print(idprint_chat"[ZPanic] Este nick ya posee una cuenta")
            return 
PLUGIN_HANDLED
        
}
        
        case 
2:
        {
            
client_print(idprint_chat"[ZPanic] Ya estas logueado")
            return 
PLUGIN_HANDLED
        
}
    }
    
    
client_cmd(id"messagemode contrasenia")
    
    return 
PLUGIN_CONTINUE
}
public 
client_disconnect(id)
{
    
savereg(id)
}
public 
savereg(id)
{
    new 
data[128], name[32], password[32]
    
    
get_datos(idnamepassword)
    
    
formatex(datacharsmax(data), "%s"password)
    
fvault_set_data(g_regnamedata)
}
registracion(id)
{
new 
data[64], name[32], password[32], password_en_archivo[32]
new 
ios
get_datos
(idnamepassword)

if(!
fvault_get_data(g_regnamedatacharsmax(data)))
    
    
parse(datapassword_en_archivocharsmax(password_en_archivo))
    
    if(
equal(password_en_archivopassword))
        
ios 2
}
public 
client_connect(id)
{
    new 
data[64], name[32], password[32], password_en_archivo[32]
    new 
ios
    get_datos
(idnamepassword)
    
    if(!
fvault_get_data(g_regnamedatacharsmax(data)))
    {
        
parse(datapassword_en_archivocharsmax(password_en_archivo))
        
        if(
equal(password_en_archivopassword))
        
        
ios 2
    
}
    else
    {
        
ios 1
    
}
    switch(
ios)
    {
        case 
1:
        {
            new 
lReason[64]
            
server_cmd("kick #%d ^"Tu Contrasenia es incorrecta^""get_user_userid(id), lReason)
        }
        case 
2:
        {
            
client_cmd(id,"echo ** Tu Nick & Password han sido autorizados! (Name: %s | Pw: %s)"namepassword)
        }
    }
}
public 
taglist(id,level,cid)
{
    
    if (!
cmd_access(id,level,cid,1))
        return 
PLUGIN_HANDLED
    
    console_print
(id,"^nEntradas en el archivo^nNick - Password")
    
    
    for(new 
0numlista; ++i)
        
console_print(id,"%s - %s"namestore[i], pwstore[i])
    
    
console_print(id,"Total %d"numlista)
    
    return 
PLUGIN_HANDLED
}
public 
client_infochanged(id)
{
    
    if(
is_user_connected(id))
    {
        
        new 
newname[32], servname[32]
        
        
get_user_info(id"name"newname,31)
        
get_user_name(id,servname,31//Nombre que tiene cuando entra al sv
        
        
if (!equal(servnamenewname))
        {
            
            
client_print(id,print_chat,"[ZPanic]No puedes cambiarte de nombre")
            
set_user_info(id,"name"servname)
        }
    }
}

public 
nocambiartag(msg_idmsg_destreceiver)
{
    new 
info[64]
    
    
get_msg_arg_string(2info63)
    
    if(!
equali(info"#Cstrike_Name_Change")) return PLUGIN_CONTINUE
    
    
return PLUGIN_HANDLED
}

get_datos(idname[32], password[32])
{
new 
prefijo[8]

get_user_name(idnamecharsmax(name))
get_pcvar_string(cvar_password_prefijoprefijocharsmax(prefijo))
get_user_info(idprefijopasswordcharsmax(password))


From already thank you very much hope that can help me

Sorry For my bad English
Bye


All times are GMT -4. The time now is 17:45.

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