Scritpt Entende que й uma array?
#2

Isto deve resolver o seu problema:

pawn Код:
public CheckConnectionWithTool(tentativas)
{
    for(new i=0; i<tentativas; i++)
    {
        new string[256]; // Create the string to store the read text in
        new File: file = fopen("sampsc/socket.com", io_read); // Open the file
        if (file)
        {
            // Le o Comando
            fread(file, string); // Fread from the file and store what's read in 'string'
            fclose(file); // Close the file
            new command[256];
            format(command, sizeof(command),"%s",string);
            if(strcmp(command,"CHECKSTATUS",true)==0) //Strcmp para comparar strings
            {
                // Envia o Status da COM
                new strfile[256];
                format(strfile, sizeof(strfile),"SDKOK_RESP001");
                new File: file2 = fopen("sampsc/socket.resp", io_write); // Open the file
                if (file2)
                {
                    fremove("sampsc/socket.resp");
                }
                fwrite(file2, strfile);
                fclose(file2);
            }
        }
        return 1;
    }
    return 0;
}

Espero ter ajudado
Reply


Messages In This Thread
Scritpt Entende que й uma array? - by mafelis - 20.12.2010, 12:31
Re: Scritpt Entende que й uma array? - by rjjj - 20.12.2010, 13:04
Re: Scritpt Entende que й uma array? - by mafelis - 20.12.2010, 13:50

Forum Jump:


Users browsing this thread: 1 Guest(s)