Zaloguj się by uzyskać pełen dostęp. Nie masz jeszcze konta? Założ je już teraz w kilka sekund.

Wysłany: 2013-10-14, 23:39


awfesa







Wiek: 29
Na forum: 4705 dni
Posty: 563

Piwa: 223

Respekt: 280
Respekt: 280Respekt: 280Respekt: 280

Witam mam takie pytanie.

Mam oto taka komende na stawianie obiekta
Kod:

COMMAND:pneon(playerid,params[])
{
new Float:x, Float:y, Float:z;
GetPlayerPos(playerid, x, y, z);
neon = CreateObject(18648, x, y, z - 0.5, 0.0, 0.0, 0.0);
SendClientMessage(playerid, 0xFFFFFFAA, "Stworzy?e? neon.");
return 1;
}


i chcia?bym aby te postawione przedmioty zapisywa?y si? do pliku.


Za pomoc :piwo:

Podpis

Cokolwiek robicie w swoim życiu, nie będzie to legendarne,
jeżeli wasi przyjaciele nie będą mogli tego zobaczyć.
Postaw piwo autorowi tego posta
 

 
Wysłany: 2013-10-15, 07:38


IgrexolonO







Wiek: 34
Na forum: 6809 dni
Posty: 1386

Piwa: 1062

Respekt: 651,8
Respekt: 651,8Respekt: 651,8

http://wiki.sa-mp.com/wiki/Fwrite

Kod:

CMD:pneon(playerid,p[])
{
new Float:x, Float:y, Float:z, _floatedString[25];
GetPlayerPos(playerid, x, y, z);
neon = CreateObject(18648, x, y, z - 0.5, 0.0, 0.0, 0.0);
format(_floatedString, sizeof(_floatedString), "%.2f %.2f %.2f");
new File:ftw=fopen("neony", io_append);
if(ftw)
{
fwrite(ftw, _floatedString);
fclose(ftw);
}
SendClientMessage(playerid, 0xFFFFFFAA, "Stworzy?e? neon.");
return true;
}


Postaw piwo autorowi tego posta
 

 
Wysłany: 2013-11-11, 00:41


awfesa







Wiek: 29
Na forum: 4705 dni
Posty: 563

Piwa: 223

Respekt: 280
Respekt: 280Respekt: 280Respekt: 280

Tworzy mi tylko w pliku napis "Server started."

oto ten kod z komend?

Pawn

#include <a_samp>
#include <zcmd>
new neon;


public OnFilterScriptInit()
{
    new File:log fopen("/ServerLog.txt"io_write); // Open the file
    if(log)
    {
        fwrite(log"Server started.\r\n"); // Write to the file (\r\n is for a new line)
        fclose(log); // Close the file
    }
    return 1;
}



CMD:pneon(playerid,p[])
{
new Float:xFloat:yFloat:z_floatedString[25];
GetPlayerPos(playeridxyz);
neon CreateObject(18648xy0.50.00.00.0);
format(_floatedStringsizeof(_floatedString), "%.2f %.2f %.2f");
new File:ftw=fopen("neony"io_append);
if(ftw)
{
fwrite(ftw_floatedString);
fclose(ftw);
}
SendClientMessage(playerid0xFFFFFFAA"Stworzy?e? neon.");
return true;
}


Podpis

Cokolwiek robicie w swoim życiu, nie będzie to legendarne,
jeżeli wasi przyjaciele nie będą mogli tego zobaczyć.
Postaw piwo autorowi tego posta
 

 
Wysłany: 2013-11-11, 00:55


Sillence







Wiek: 26
Na forum: 5157 dni
Posty: 1514
Nick w MP: Sillence

Piwa: 1517

Respekt: 416,3
Respekt: 416,3

awfesa, Stw?rz nowy dokument o nazwie: neony.txt w scriptfiles :)
Kod:

#include <a_samp>
#include <zcmd>
new neon;


public OnFilterScriptInit()
{
new File:log = fopen("/ServerLog.txt", io_write); // Open the file
if(log)
{
fwrite(log, "Server started.\r\n"); // Write to the file (\r\n is for a new line)
fclose(log); // Close the file
}
return 1;
}



CMD:pneon(playerid,p[])
{
new Float:x, Float:y, Float:z, _floatedString[25];
GetPlayerPos(playerid, x, y, z);
neon = CreateObject(18648, x, y, z - 0.5, 0.0, 0.0, 0.0);
format(_floatedString, sizeof(_floatedString), "%.2f %.2f %.2f");
new File:ftw=fopen("neony.txt", io_append);
if(ftw)
{
fwrite(ftw, _floatedString);
fclose(ftw);
}
SendClientMessage(playerid, 0xFFFFFFAA, "Stworzy?e? neon.");
return true;
}


Postaw piwo autorowi tego posta
 

 
Tagi: zapis :: pliku
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






Skocz do:  
Wyświetl posty z ostatnich:   
GTAONLINE.PL » JĘZYKI PROGRAMOWANIA » PAWN » [INNE] Zapis do pliku Ten temat jest zablokowany bez możliwości zmiany postów lub pisania odpowiedzi

Nie możesz pisać nowych tematów
Nie możesz odpowiadać w tematach
Nie możesz zmieniać swoich postów
Nie możesz usuwać swoich postów
Nie możesz głosować w ankietach
Dodaj temat do Ulubionych
Wersja do druku