Szerző Téma: Ingame Notepad  (Megtekintve 1024 alkalommal)

Ingame Notepad
« Dátum: 2011. március 08. - 17:36:32 »
0 Show voters
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 :)

Nem elérhető jana4

  • 5929
  • Ex Staff
    • Profil megtekintése
Ingame Notepad
« Válasz #1 Dátum: 2011. március 09. - 19:19:23 »
0 Show voters
Azt hiszem ilyen létezik, csak nem tudom ki csinálta.

Ma vagy holnap nekiállok, ha kész írok. :)

Nem elérhető ►ѕтa

  • 2016
  • Newbie
    • Profil megtekintése
Ingame Notepad
« Válasz #2 Dátum: 2011. március 09. - 19:32:09 »
0 Show voters
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;
}

Nem elérhető jana4

  • 5929
  • Ex Staff
    • Profil megtekintése
Ingame Notepad
« Válasz #3 Dátum: 2011. március 09. - 19:38:52 »
0 Show voters
staR, a topiknyitó nem ilyent kért.

Ingame Notepad
« Válasz #4 Dátum: 2011. március 09. - 20:18:02 »
0 Show voters
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

Ingame Notepad
« Válasz #5 Dátum: 2011. március 15. - 08:45:56 »
0 Show voters
Ahogy látom, Scream nem írta meg.


Katt
Parancsok
/notepad [text]
 
  • írás

/noteopen [noteid]
 
  • olvasás

/deletenotes
 
  • RCON Adminnak, az összes feljegyzés törlése.

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

  • zcmd

  • sscanf


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

 

SimplePortal 2.3.7 © 2008-2024, SimplePortal