Raised This Month: $51 Target: $400
 12% 

[ES] Remover algo de un .ini [Solucionado]


  
 
 
Thread Tools Display Modes
Author Message
shinoda
Spanish Moderator
Join Date: Nov 2009
Location: ag_crossfire
Old 06-03-2010 , 22:10   [ES] Remover algo de un .ini [Solucionado]
#1

Como hago para eliminar en este caso el SteamID de un .ini =/ ?
PHP Code:
public cmdRemoveid(idlevelcid) {
    if(!
cmd_access(idlevelcid2)) return 1
    
    
new argv[32]
    
read_argv(1argvsizeof(argv)-1)
    
    new 
player cmd_target(idargv3)
    
    new 
ID[28]
    
get_user_authid(playerIDsizeof(ID)-1)

    new 
lines file_size(Direccion,1)
    new 
file[1024], len
    
    
for(new i=0i<=linesi++) {
        
read_file(Direccionfile1023len)
        if(
equali(IDfile)) {
            
// Borrar la ID
        
}
    }
    return 
1

__________________
Oh hell no this shit is awesome !!!
shinoda is offline
Send a message via MSN to shinoda Send a message via Skype™ to shinoda
IneedHelp
Veteran Member
Join Date: Mar 2007
Location: Argentina
Old 06-03-2010 , 22:43   Re: [ES] Remover algo de un .ini
#2

write_file ( const file[], const text[], [ line ] )

-> [ line ] -> numero de linea a sobreescribir (le mandas "")
__________________
IneedHelp is offline
Alucard^
AMXX Moderator: Others
Join Date: Sep 2007
Location: Street
Old 06-03-2010 , 23:07   Re: [ES] Remover algo de un .ini
#3

Y si queres borrar solo una parte de tal linea del archivo, simplemente debes usar parse() para obtener los distintos argumentos (no se como llamarlos) y ahi simplemente haces un format sacando la parte q no queres y le das a write_file().
__________________
Approved Plugins - Steam Profile

Public non-terminated projects:
All Admins Menu, HLTV parameters, Subnick,
Second Password (cool style), InfoZone,
Binary C4 plant/defuse, and more...

Private projects:
NoSpec (+menu), NV Surf Management,
PM Adanved System, KZ longjump2, and more...
Alucard^ is offline
Send a message via Skype™ to Alucard^
shinoda
Spanish Moderator
Join Date: Nov 2009
Location: ag_crossfire
Old 06-03-2010 , 23:14   Re: [ES] Remover algo de un .ini
#4

Gracias Innedhelp

Quote:
Originally Posted by Alucard^ View Post
Y si queres borrar solo una parte de tal linea del archivo, simplemente debes usar parse() para obtener los distintos argumentos (no se como llamarlos) y ahi simplemente haces un format sacando la parte q no queres y le das a write_file().
eso podria usarlo para nombres??
no como usarlo u.u

osea como tendria que usarlo para eliminar tal palabra de un name

static sName[32]
get_user_name(id, sName, sizeof(sName)-1)

if(contain(sName, "gay") != -1) {
parse ..................
}
__________________
Oh hell no this shit is awesome !!!

Last edited by shinoda; 06-03-2010 at 23:19.
shinoda is offline
Send a message via MSN to shinoda Send a message via Skype™ to shinoda
Alucard^
AMXX Moderator: Others
Join Date: Sep 2007
Location: Street
Old 06-03-2010 , 23:20   Re: [ES] Remover algo de un .ini
#5

No, parse es para separar las distintas "frases" por asi decirlo de un string.... por ejemplo:

En un archivo .ini tenes algo asi:

"dato1" "dato2" "dato3" "dato 4 y dato 5"

Entonces dsp haces asi:

parse(output[], dat1[], len, dat2[], len, dat3[], len, dat45[], len)

Entonces dsp tenes en distintas variables las distintas "frases" dentro de todo ese string (es decir la linea del .ini).

Pero para lo que vos decis, realmente no se si es posible remover parte del nick de un player, o por lo menos no se me ocurre una forma...
__________________
Approved Plugins - Steam Profile

Public non-terminated projects:
All Admins Menu, HLTV parameters, Subnick,
Second Password (cool style), InfoZone,
Binary C4 plant/defuse, and more...

Private projects:
NoSpec (+menu), NV Surf Management,
PM Adanved System, KZ longjump2, and more...
Alucard^ is offline
Send a message via Skype™ to Alucard^
01101101
BANNED
Join Date: Nov 2009
Location: 9`su 09`n0n7e`r0f76a
Old 06-03-2010 , 23:38   Re: [ES] Remover algo de un .ini
#6

Quote:
Originally Posted by shinoda View Post
Gracias Innedhelp


eso podria usarlo para nombres??
no como usarlo u.u

osea como tendria que usarlo para eliminar tal palabra de un name

static sName[32]
get_user_name(id, sName, sizeof(sName)-1)

if(contain(sName, "gay") != -1) {
parse ..................
}
Supongo que algo asi, no lo probe y tengo sueño asi que probalo y si tiene algun error decime y lo arreglo xD

PHP Code:
remove_strint_from_string(string[], part[])
{
    new 
where containi(stringpart)
    new 
output[64], len
    len 
+= add(output63stringwhere-1)
    
add(output63-len-strlen(part), string)



Soy un imbecil, tengo sueño.

PHP Code:
replace_all(namesizeof name-1"gay"""

Last edited by 01101101; 06-03-2010 at 23:40.
01101101 is offline
Alucard^
AMXX Moderator: Others
Join Date: Sep 2007
Location: Street
Old 06-04-2010 , 00:01   Re: [ES] Remover algo de un .ini
#7

aps, la otra vez iba a decir algo sobre eso pero, no taba seguro... porque me acuerdo que una vez testie algo de eso y no funco bien, en fin...
__________________
Approved Plugins - Steam Profile

Public non-terminated projects:
All Admins Menu, HLTV parameters, Subnick,
Second Password (cool style), InfoZone,
Binary C4 plant/defuse, and more...

Private projects:
NoSpec (+menu), NV Surf Management,
PM Adanved System, KZ longjump2, and more...
Alucard^ is offline
Send a message via Skype™ to Alucard^
shinoda
Spanish Moderator
Join Date: Nov 2009
Location: ag_crossfire
Old 06-04-2010 , 09:34   Re: [ES] Remover algo de un .ini
#8

A mi si me funciono bien, solucionado.
__________________
Oh hell no this shit is awesome !!!
shinoda is offline
Send a message via MSN to shinoda Send a message via Skype™ to shinoda
 



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 02:58.


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