[Ajuda] Aplicar comando a player offline
#4

Tente isto:
PS: Vip_Nivel й a linha da conta que defini o vip do player.
pawn Код:
stock DarVip(const nome[24], valor){
    strcat(nome, ".inc");
   
    if(!fexist(nome)){
        return 0; // arquivo nгo existe
    }
   
    s_Set(nome, "Vip_Nivel", valor);
}


stock s_Set(filename[], line[], value[]){

        if(!fexist(filename) || strfind(filename, ".") == 0 ){
            return false;
        }

        #if !defined MAX_STRING
            #define MAX_STRING      (128)
        #endif

        static
            File:Arquivo,
                Linha[MAX_STRING],
            Buf[MAX_STRING]
        ;

        Linha[0]     = '\0';
        Buf[0]       = '\0';

        Arquivo = fopen(filename, io_read);


        for( ; fread(Arquivo, Linha); ){
            if(strfind(Linha, line) != -1){
                format(Linha, MAX_STRING, "%s=%s\r\n", line, value);
            }


            strcat(Buf, Linha);
        }

        fclose(Arquivo);
        fremove(filename);

        Arquivo = fopen(filename, io_write);


        Linha[0] = '\0';
        if(strfind(Buf, line) == -1){
            format(Linha, MAX_STRING, "%s=%s\r\n", line, value);
            strcat(Buf, Linha);
        }
        fwrite(Arquivo, Buf);
        fclose(Arquivo);

        return true;
}
Reply


Messages In This Thread
Aplicar comando a player offline - by Senhor_Azul - 07.11.2012, 17:17
Re: Aplicar comando a player offline - by [JD]BlackFire - 07.11.2012, 17:19
Re: Aplicar comando a player offline - by Senhor_Azul - 07.11.2012, 17:34
Re: Aplicar comando a player offline - by zSuYaNw - 07.11.2012, 17:36
Re: Aplicar comando a player offline - by Senhor_Azul - 07.11.2012, 17:51
Re: Aplicar comando a player offline - by @Riichard - 07.11.2012, 18:56

Forum Jump:


Users browsing this thread: 2 Guest(s)