Delete name from file -
vection - 01.09.2010
if i have somthing like that:
pawn Код:
Gara_Vega
Hasd_Aasda
Jada_Akvmd
its a file, i want if i make command its will delete the first name.
Re: Delete name from file -
Yamoo - 01.09.2010
A little more explaining please?
This forum requires that you wait 120 seconds between posts. Please try again in 56 seconds. - Damn it's bugging me now seriously.. this is just to waste time -.- capiche?
Re: Delete name from file -
vection - 01.09.2010
I explain to you, i want to make a system that if you register its add you to list.
and admin will do somthing.
admin will do command /acceptname "Name"
then, its will open the file and delete "Name"
Re: Delete name from file -
Claude - 01.09.2010
pawn Код:
new name[MAX_PLAYER_NAME], file[100];
GetPlayerName(target, name, sizeof name);
format(file, sizeof file, "onlist_players.ini", name);
new File:fileo = fopen(file, io_read)
{
if(strfind(fileo, name, true) != 1)
{
strdel(fileo, 0, MAX_PLAYER_NAME);
}
}
Try this ^
Re: Delete name from file -
vection - 01.09.2010
You gave me a code that work with ID, and its not what i mean to.
again, /deletename [FULL_NAME]
then open some fill and delete the full name.
i change it to somthing like that:
pawn Код:
if(strcmp(cmd, "/deleteapp", true) == 0)
{
//if(PlayerInfo[playerid][pAdmin] >= 1)
//{
new tmppass[64];
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD1, "USAGE: /deleteapp [NAME]");
return 1;
}
new name[MAX_PLAYER_NAME], file[100];
format(file, sizeof file, "Logs/WaitList.ini");
new File:fileo = fopen(file, io_read);
if (fileo)
{
if(strfind(fileo, tmp, true) != 1)
{
strdel(fileo, 0, MAX_PLAYER_NAME);
}
}
}
error 035: argument type mismatch (argument 1)
error 035: argument type mismatch (argument 1)
Re: Delete name from file -
vection - 01.09.2010
ANY ONE ?!
Re: Delete name from file -
LarzI - 01.09.2010
Which lines are the errors occuring on?
Re: Delete name from file -
vection - 01.09.2010
this lines:
pawn Код:
if(strfind(fileo, tmp, true) != 1)
strdel(fileo, 0, MAX_PLAYER_NAME);
Re: Delete name from file -
LarzI - 01.09.2010
fileo is a file, not a string..
Re: Delete name from file -
vection - 01.09.2010
i dont understand you, can you show in the code what the problem?
if you dont get it, i want to make /del "NAME"
then its will open the file and delete the name who you entered.