Wysłany: 2013-10-14, 23:39
awfesa
Wiek: 29 Na forum: 4705 dni Posty: 563
Piwa : 223
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
Podpis
Cokolwiek robicie w swoim życiu, nie będzie to legendarne,
jeżeli wasi przyjaciele nie będą mogli tego zobaczyć.
Wysłany: 2013-10-15, 07:38
IgrexolonO
Wiek: 34 Na forum: 6809 dni Posty: 1386
Piwa : 1062
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;
}
Wysłany: 2013-11-11, 00:41
awfesa
Wiek: 29 Na forum: 4705 dni Posty: 563
Piwa : 223
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 : 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 ;
}
Podpis
Cokolwiek robicie w swoim życiu, nie będzie to legendarne,
jeżeli wasi przyjaciele nie będą mogli tego zobaczyć.
Wysłany: 2013-11-11, 00:55
Sillence
Wiek: 26 Na forum: 5157 dni Posty: 1514
Nick w MP: Sillence
Piwa : 1517
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;
}
Tagi: zapis :: pliku
Anonymous
Na forum: 245 dni
Posty: 1
Anonymous Koniecznie zajrzyj na: