Command to READ from file in scriptfiles and Display as text??
#1

Okay, so this is the first time ive had difficulties in a while, now ive got a file in my scriptfiles called toylist.cfg, now i want to make a command in game such as CMD:checktoylist, and it then open that file in the scriptfiles and display the contents of the .cfg as messages in game? is this possible and how would i go about doing that?
Reply
#2

https://sampwiki.blast.hk/wiki/Fopen
Reply
#3

Yeah ive scrolled through this but i think im just overtired and can't make much sense of it all, their's 4 lines in the text file, and i need those 4 lines displayed in their own line IG if that makes sense, or even all 4 lines displaced in a single message just spaced?
Reply
#4

pawn Код:
new File:handle = fopen("toylist.cfg", io_read);
if(handle)
{
    new line[128];
    while(fread(handle, line))
    {
        SendClientMessage(playerid, -1, line);
    }
    fclose(handle);
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)