Delete name from file
#1

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.
Reply
#2

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?
Reply
#3

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"
Reply
#4

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 ^
Reply
#5

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)
Reply
#6

ANY ONE ?!
Reply
#7

Which lines are the errors occuring on?
Reply
#8

this lines:
pawn Код:
if(strfind(fileo, tmp, true) != 1)
 strdel(fileo, 0, MAX_PLAYER_NAME);
Reply
#9

fileo is a file, not a string..
Reply
#10

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.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)