[Ajuda] WriteLog
#1

Tava procurando na internet gamemode base pra mim aprender mбs pois estou fazendo um gamemode do 0 ai achei uma й quando fui compilar deu esse erro
PHP код:
C:\Users\Lan\Desktop\GameMode de facзгo 2\gamemodes\LV.pwn(1001) : error 017undefined symbol "WriteLog"
C:\Users\Lan\Desktop\GameMode de facзгo 2\gamemodes\LV.pwn(1006) : error 017undefined symbol "WriteLog"
C:\Users\Lan\Desktop\GameMode de facзгo 2\gamemodes\LV.pwn(1027) : error 017undefined symbol "WriteLog"
C:\Users\Lan\Desktop\GameMode de facзгo 2\gamemodes\LV.pwn(1046) : error 017undefined symbol "WriteLog"
C:\Users\Lan\Desktop\GameMode de facзгo 2\gamemodes\LV.pwn(1052) : error 017undefined symbol "WriteLog"
C:\Users\Lan\Desktop\GameMode de facзгo 2\gamemodes\LV.pwn(1167) : error 017undefined symbol "WriteLog"
C:\Users\Lan\Desktop\GameMode de facзгo 2\gamemodes\LV.pwn(1422) : error 017undefined symbol "WriteLog"
C:\Users\Lan\Desktop\GameMode de facзгo 2\gamemodes\LV.pwn(1578) : error 017undefined symbol "WriteLog"
C:\Users\Lan\Desktop\GameMode de facзгo 2\gamemodes\LV.pwn(1594) : error 017undefined symbol "WriteLog"
C:\Users\Lan\Desktop\GameMode de facзгo 2\gamemodes\LV.pwn(1611) : error 017undefined symbol "WriteLog"
C:\Users\Lan\Desktop\GameMode de facзгo 2\gamemodes\LV.pwn(1828) : error 017undefined symbol "WriteLog"
C:\Users\Lan\Desktop\GameMode de facзгo 2\gamemodes\LV.pwn(1843) : error 017undefined symbol "WriteLog"
C:\Users\Lan\Desktop\GameMode de facзгo 2\gamemodes\LV.pwn(1865) : error 017undefined symbol "WriteLog"
C:\Users\Lan\Desktop\GameMode de facзгo 2\gamemodes\LV.pwn(1881) : error 017undefined symbol "WriteLog"
C:\Users\Lan\Desktop\GameMode de facзгo 2\gamemodes\LV.pwn(1909) : error 017undefined symbol "WriteLog"
C:\Users\Lan\Desktop\GameMode de facзгo 2\gamemodes\LV.pwn(1961) : error 017undefined symbol "WriteLog"
C:\Users\Lan\Desktop\GameMode de facзгo 2\gamemodes\LV.pwn(1996) : error 017undefined symbol "WriteLog"
C:\Users\Lan\Desktop\GameMode de facзгo 2\gamemodes\LV.pwn(2014) : error 017undefined symbol "WriteLog"
C:\Users\Lan\Desktop\GameMode de facзгo 2\gamemodes\LV.pwn(2041) : error 017undefined symbol "WriteLog"
C:\Users\Lan\Desktop\GameMode de facзгo 2\gamemodes\LV.pwn(2042) : error 017undefined symbol "WriteLog"
C:\Users\Lan\Desktop\GameMode de facзгo 2\gamemodes\LV.pwn(2058) : error 017undefined symbol "WriteLog"
C:\Users\Lan\Desktop\GameMode de facзгo 2\gamemodes\LV.pwn(2080) : error 017undefined symbol "WriteLog"
C:\Users\Lan\Desktop\GameMode de facзгo 2\gamemodes\LV.pwn(2148) : error 017undefined symbol "WriteLog"
C:\Users\Lan\Desktop\GameMode de facзгo 2\gamemodes\LV.pwn(2205) : error 017undefined symbol "WriteLog"
C:\Users\Lan\Desktop\GameMode de facзгo 2\gamemodes\LV.pwn(2299) : error 017undefined symbol "WriteLog"
C:\Users\Lan\Desktop\GameMode de facзгo 2\gamemodes\LV.pwn(2338) : error 017undefined symbol "WriteLog"
Compilation aborted.Pawn compiler 3.2.3664              Copyright (c1997-2006ITB CompuPhase
26 Errors

ai fui ver oq era WriteLog WriteLog й tipo pra substituir SendClientMessageToAll nй? alguйm pode me ensinar como tira esse WriteLog
Reply
#2

coloca isso na gm

PHP код:
stock WriteLog(file[], input[])
{
    new 
fileText[126];
    
format(fileText126"%s.txt"file);
    new 
File:handle fopen(fileTextio_append);
    if(
handle)
    {
        new 
HMS,
            
inputText[126];
        
gettime(HMS);
        
format(inputText126"[%02d:%02d:%02d] %s\r\n"HMSinput);
        
fwrite(handleinputText);
        
fclose(handle);
    }
    else
    {
        new 
printText[126];
        
format(printText126"Could not append to file %s"file);
        print(
"Error at stock WriteLog(file[], input[])");
        print(
printText);
    }
}
stock WritePlayerLog(playeridinput[])
{
    new 
fileText[126],
        
name[MAX_PLAYER_NAME];
    
GetPlayerName(playeridnamesizeof(name));
    
format(fileText126"log/%s.txt"name);
    new 
File:handle fopen(fileTextio_append);
    if(
handle)
    {
        new 
HMS,
            
inputText[126];
        
gettime(HMS);
        
format(inputText126"[%02d:%02d:%02d] %s\r\n"HMSinput);
        
fwrite(handleinputText);
        
fclose(handle);
    }
    else
    {
        new 
printText[126];
        
format(printText126"Could not append to file %s"name);
        print(
"Error at stock WritePlayerLog(file[], input[])");
        print(
printText);
    }

Se nгo funcionar tenta usar essa include.

https://sampforum.blast.hk/showthread.php?tid=293534
Reply
#3

Quote:
Originally Posted by Marllun
Посмотреть сообщение
coloca isso na gm

PHP код:
stock WriteLog(file[], input[])
{
    new 
fileText[126];
    
format(fileText126"%s.txt"file);
    new 
File:handle fopen(fileTextio_append);
    if(
handle)
    {
        new 
HMS,
            
inputText[126];
        
gettime(HMS);
        
format(inputText126"[%02d:%02d:%02d] %s\r\n"HMSinput);
        
fwrite(handleinputText);
        
fclose(handle);
    }
    else
    {
        new 
printText[126];
        
format(printText126"Could not append to file %s"file);
        print(
"Error at stock WriteLog(file[], input[])");
        print(
printText);
    }
}
stock WritePlayerLog(playeridinput[])
{
    new 
fileText[126],
        
name[MAX_PLAYER_NAME];
    
GetPlayerName(playeridnamesizeof(name));
    
format(fileText126"log/%s.txt"name);
    new 
File:handle fopen(fileTextio_append);
    if(
handle)
    {
        new 
HMS,
            
inputText[126];
        
gettime(HMS);
        
format(inputText126"[%02d:%02d:%02d] %s\r\n"HMSinput);
        
fwrite(handleinputText);
        
fclose(handle);
    }
    else
    {
        new 
printText[126];
        
format(printText126"Could not append to file %s"name);
        print(
"Error at stock WritePlayerLog(file[], input[])");
        print(
printText);
    }

Se nгo funcionar tenta usar essa include.

https://sampforum.blast.hk/showthread.php?tid=293534
Tipo eu nгo quero usar WriteLog como faзo? so colocar Sendclientmessagetoall aonde tб WriteLog?
Reply
#4

Olha, o nome "WriteLog" nгo й SendClientMessageToAll. Manda uma linha dos erros.
Reply
#5

Quote:
Originally Posted by Marllun
Посмотреть сообщение
Olha, o nome "WriteLog" nгo й SendClientMessageToAll. Manda uma linha dos erros.
linha do erro
PHP код:
WriteLog(LOG_HOUSESlogString); 
code completo
PHP код:
forward SpawnInHome(playerid);
public 
SpawnInHome(playerid)
{
    new
        
house,
        
tenantHouseID,
        
tenantFile[200],
        
houseFile[200],
        
houseFile2[200],
        
ownerFile[200],
        
logString[700];
    
format(ownerFilesizeof ownerFile"Casas/Donos/%s.ini"Nome(playerid));
    
format(tenantFilesizeof tenantFile"Casas/Locadores/%s.ini"Nome(playerid));
    
house DOF2_GetInt(ownerFile"houseID");
    
tenantHouseID DOF2_GetInt(tenantFile"houseID");
    
format(houseFilesizeof houseFile"Casas/Casas/Casa %d.ini"house);
    
format(houseFile2sizeof houseFile2"Casas/Casas/Casa %d.ini"tenantHouseID);
    if(
DOF2_FileExists(ownerFile))
    {
        new 
value DOF2_GetInt(ownerFile"ValorAreceber");
        
SetPlayerVirtualWorld(playeridCasaInfo[house][houseVirtualWorld]);
        
SetPlayerPos(playeridCasaInfo[house][houseIntX], CasaInfo[house][houseIntY], CasaInfo[house][houseIntZ]);
        
SetPlayerFacingAngle(playeridCasaInfo[house][houseIntFA]);
        
SetPlayerInterior(playeridCasaInfo[house][houseInterior]);
        
format(logStringsizeof logString"O jogador %s[%d], foi spawnado na casa %d."Nome(playerid), playeridhouse);
        
WriteLog(LOG_HOUSESlogString);
        if(
value != 0)
        {
            
format(logStringsizeof logString"O jogador %s[%d], foi spawnado na casa %d, e coletou o aluguel de $%d."Nome(playerid), playeridhouseCasaInfo[house][houseIncoming]);
            
WriteLog(LOG_HOUSESlogString);
            
GivePlayerCash(playeridCasaInfo[house][houseIncoming]);
            
CasaInfo[house][houseIncoming] = 0;
            
DOF2_SetInt(ownerFile"ValorAreceber"CasaInfo[house][houseIncoming]);
            return 
1;
        }
        return 
1;
    }
    else if(
DOF2_FileExists(tenantFile))
    {
        new
            
value DOF2_GetInt(tenantFile"ValorApagar");
        
SetPlayerVirtualWorld(playeridCasaInfo[tenantHouseID][houseVirtualWorld]);
        
SetPlayerPos(playeridCasaInfo[tenantHouseID][houseIntX], CasaInfo[tenantHouseID][houseIntY], CasaInfo[tenantHouseID][houseIntZ]);
        
SetPlayerFacingAngle(playeridCasaInfo[tenantHouseID][houseIntFA]);
        
SetPlayerInterior(playeridCasaInfo[tenantHouseID][houseInterior]);
        
format(logStringsizeof logString"O jogador %s[%d], foi spawnado na casa %d."Nome(playerid), playeridtenantHouseID);
        
WriteLog(LOG_HOUSESlogString);
        if(
value != 0)
        {
            if(
GetPlayerCash(playerid) < value)
            {
                new
                    
FloatXFloatYFloatZ;
                
GetPlayerPos(playeridXYZ);
                
PlayerPlaySound(playerid1085XYZ);
                
Msg(playeridVERMELHO"ERRO: Vocк nгo tem dinheiro o suficiente para pagar o aluguel e foi despejado.");
                
format(CasaInfo[tenantHouseID][houseTenant], 255"Ninguem");
                
DOF2_SetString(houseFile2"Locador""Ninguem""Aluguel");
                
DOF2_RemoveFile(tenantFile);
                
Update3DText(tenantHouseID);
                
format(logStringsizeof logString"O jogador %s[%d], nгo tinha dinheiro o suficiente para pagar o aluguel da casa %d e foi despejado."Nome(playerid), playeridtenantHouseID);
                
WriteLog(LOG_HOUSESlogString);
                return 
1;
            }
            
format(logStringsizeof logString"O jogador %s[%d], foi spawnado na casa %d e pagou $%d de aluguel."Nome(playerid), playeridtenantHouseIDvalue);
            
WriteLog(LOG_HOUSESlogString);
            
GivePlayerCash(playerid, -value);
            
CasaInfo[tenantHouseID][houseOutcoming] = 0;
            
DOF2_SetInt(tenantFile"ValorApagar"CasaInfo[tenantHouseID][houseOutcoming]);
            return 
1;
        }
        return 
1;
    }
    return 
1;

Reply
#6

Usa esse cуdigo ou remove todas as linhas que estгo dando erro.

PHP код:
stock WriteLog(file[], input[]) 

    new 
fileText[126]; 
    
format(fileText126"%s.txt"file); 
    new 
File:handle fopen(fileTextio_append); 
    if(
handle
    { 
        new 
HMS
            
inputText[126]; 
        
gettime(HMS); 
        
format(inputText126"[%02d:%02d:%02d] %s\r\n"HMSinput); 
        
fwrite(handleinputText); 
        
fclose(handle); 
    } 
    else 
    { 
        new 
printText[126]; 
        
format(printText126"Could not append to file %s"file); 
        print(
"Error at stock WriteLog(file[], input[])"); 
        print(
printText); 
    } 

stock WritePlayerLog(playeridinput[]) 

    new 
fileText[126], 
        
name[MAX_PLAYER_NAME]; 
    
GetPlayerName(playeridnamesizeof(name)); 
    
format(fileText126"log/%s.txt"name); 
    new 
File:handle fopen(fileTextio_append); 
    if(
handle
    { 
        new 
HMS
            
inputText[126]; 
        
gettime(HMS); 
        
format(inputText126"[%02d:%02d:%02d] %s\r\n"HMSinput); 
        
fwrite(handleinputText); 
        
fclose(handle); 
    } 
    else 
    { 
        new 
printText[126]; 
        
format(printText126"Could not append to file %s"name); 
        print(
"Error at stock WritePlayerLog(file[], input[])"); 
        print(
printText); 
    } 

Reply
#7

Isso sгo logs.
Vocк pode excluir ou entгo substituir os logs por printf.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)