GTA Közösség - A magyar GTA fórum

San Andreas Multiplayer (SA-MP) => SA-MP: Szerverfejlesztés => Szkript kérések => A témát indította: Bluebay - 2011. március 08. - 17:36:32

Cím: Ingame Notepad
Írta: Bluebay - 2011. március 08. - 17:36:32
Szóval
beirjuk hogy /notepad blablabla
kiirja: Elmentettük, ID-je:34
És utána
/notepad_nyit 34
Szöveg: blablabla
És úgy kéne megoldani, hogy txt fájlba mentse a notepad-ba beirtakat.
Köszönöm szépen a segitséget :)
Cím: Ingame Notepad
Írta: jana4 - 2011. március 09. - 19:19:23
Azt hiszem ilyen létezik, csak nem tudom ki csinálta.

Ma vagy holnap nekiállok, ha kész írok. :)
Cím: Ingame Notepad
Írta: ►ѕтa - 2011. március 09. - 19:32:09
IceMan írta:
 
#include < a_samp >
#define DIALOG_ID ( 100 )
public OnPlayerCommandText( playerid, cmdtext[ ] )
{
   if ( strcmp ( cmdtext, \"/feljegyez\", true ) == 0 )
   {
      if ( !fexist ( \"note.txt\" ) )
      {
         SendClientMessage ( playerid, 0xFFFF00AA, \"Nincs jegyzet fájl!\" );
      }
      else
      {
         ShowPlayerDialog ( playerid, DIALOG_ID, DIALOG_STYLE_INPUT, \"Jegyzetkönyv\", \"Kérlek adj meg egy szöveget.:\", \"Rendben\", \"Mégse\" );
      }
      return 1;
   }
   return 0;
}
public OnDialogResponse ( playerid, dialogid, response, listitem, inputtext[ ] )
{
   if ( dialogid == DIALOG_ID && response )
   {
       if ( inputtext [ 0 ] ) return ShowPlayerDialog ( playerid, DIALOG_ID, DIALOG_STYLE_INPUT, \"Jegyzetkönyv\", \"Nem írtál be szöveget!\",\"Rendben\",\"Mégse\" );
      new string[ 256 ],
         pname[ MAX_PLAYER_NAME ],
         year, month, day;
      getdate ( year, month, day );
      GetPlayerName ( playerid, pname, sizeof ( pname ) );
      new File: note = fopen ( \"note.txt\", io_append );
      format ( string, sizeof ( string ) , \"%s: %s [ Dátum: %d.%d.%d ]\\n\", year, month, day, pname, inputtext );
      fwrite ( note, string );
      fclose ( note );
      SendClientMessage ( playerid, 0xFFFF00AA, \"Új jegyzet feljegyezve!\" );
   }
   return 1;
}
Cím: Ingame Notepad
Írta: jana4 - 2011. március 09. - 19:38:52
staR, a topiknyitó nem ilyent kért.
Cím: Ingame Notepad
Írta: Bluebay - 2011. március 09. - 20:18:02
Idézetet írta: staR date=1299695529\" data-ipsquote-contentapp=\"forums\" data-ipsquote-contenttype=\"forums\" data-ipsquote-contentid=\"6682\" data-ipsquote-contentclass=\"forums_Topic
IceMan írta:
 
#include < a_samp >
#define DIALOG_ID ( 100 )
public OnPlayerCommandText( playerid, cmdtext[ ] )
{
   if ( strcmp ( cmdtext, \"/feljegyez\", true ) == 0 )
   {
      if ( !fexist ( \"note.txt\" ) )
      {
         SendClientMessage ( playerid, 0xFFFF00AA, \"Nincs jegyzet fájl!\" );
      }
      else
      {
         ShowPlayerDialog ( playerid, DIALOG_ID, DIALOG_STYLE_INPUT, \"Jegyzetkönyv\", \"Kérlek adj meg egy szöveget.:\", \"Rendben\", \"Mégse\" );
      }
      return 1;
   }
   return 0;
}
public OnDialogResponse ( playerid, dialogid, response, listitem, inputtext[ ] )
{
   if ( dialogid == DIALOG_ID && response )
   {
       if ( inputtext [ 0 ] ) return ShowPlayerDialog ( playerid, DIALOG_ID, DIALOG_STYLE_INPUT, \"Jegyzetkönyv\", \"Nem írtál be szöveget!\",\"Rendben\",\"Mégse\" );
      new string[ 256 ],
         pname[ MAX_PLAYER_NAME ],
         year, month, day;
      getdate ( year, month, day );
      GetPlayerName ( playerid, pname, sizeof ( pname ) );
      new File: note = fopen ( \"note.txt\", io_append );
      format ( string, sizeof ( string ) , \"%s: %s [ Dátum: %d.%d.%d ]\\n\", year, month, day, pname, inputtext );
      fwrite ( note, string );
      fclose ( note );
      SendClientMessage ( playerid, 0xFFFF00AA, \"Új jegyzet feljegyezve!\" );
   }
   return 1;
}

 

Hmm nemrossz de ezt nem kéri le ugye? nekem kéne vmi /megnyit és akkor kiirná a jegyzeteid
Cím: Ingame Notepad
Írta: TengeriMalac - 2011. március 15. - 08:45:56
Ahogy látom, Scream nem írta meg.


Katt
Parancsok
/notepad [text]
 

/noteopen [noteid]
 

/deletenotes
 

A feljegyzéseket a \"scriptfiles/note.txt\" fájlba menti, és restart után betölti.
A \"script\" használ
 

Munkaidõ
   Teszteléssel együtt kb 5 perc.