#include <a_samp>#include <zcmd>#include <sscanf2>CMD:otlet(playerid,params[]){ new text[128]; if(sscanf(params,\"s[128]\" ,text)) return 1; new File:log = fopen(\"/Otletek.txt\", io_write); if(log) { fwrite(log, text); fclose(log); } SendClientMessage(playerid,-1,\"Az ötleted elküldve a szerver tulajdonosának!\"); return 1;}
Tök jó,hogy tucat számra kéred a scripteket a fórumtól,de ha valaki segít,akkor azt egy \"+\"-al,vagy egy \"-köszönöm\"-el értékelhetnéd.
#include <a_samp>#include <zcmd>#include <sscanf2>CMD:otlet(playerid,params[]){ new text[128], string[128], File:log = fopen(\"/Otletek.txt\", io_write); if(sscanf(params,\"s[128]\" ,text)) return SendClientMessage(playerid, -1, \"Használd: /otlet [ötleted]\"); format(string, sizeof(string), \"%s\\r\\n\", text); write(log, string); fclose(log); SendClientMessage(playerid,-1,\"Az ötleted elküldve a szerver tulajdonosának!\"); return 1;}
Bõvítettem kicsivel, hogy ha újra jelent valaki ne írja felül a már létezõt. Remélem nem gond. #include <a_samp>#include <zcmd>#include <sscanf2>CMD:otlet(playerid,params[]){ new text[128], string[128], File:log = fopen(\"/Otletek.txt\", io_write); if(sscanf(params,\"s[128]\" ,text)) return SendClientMessage(playerid, -1, \"Használd: /otlet [ötleted]\"); format(string, sizeof(string), \"%s\\r\\n\", text); write(log, string); fclose(log); SendClientMessage(playerid,-1,\"Az ötleted elküldve a szerver tulajdonosának!\"); return 1;}
CMD:otlet(playerid, params[]){if(isnull(params)) return SendClientMessage(playerid, -1, \"Használat: /otlet [ötleted]\");new File:log = fopen(\"otletek.txt\", io_append); if(log){fwrite(log, params);fwrite(log, \"\\r\\n\");fclose(log);}SendClientMessage(playerid,-1,\"Az ötleted elküldve a szerver tulajdonosának!\");return 1;}}
#include <a_samp>#include <file>#include <sscanf2>#include <zcmd>public OnFilterScriptInit(){print(\"\\n--------------------------------------\");print(\" Rupert otletszkripte\");print(\"--------------------------------------\\n\");return 1;}public OnFilterScriptExit(){return 1;}CMD:otlet(playerid, params[]){new otlet[128];if(sscanf(params, \"s[128]\", otlet)) return SendClientMessage(playerid, -1, \"Használat: /otlet [Ötleted]!\");new File: file = fopen(\"otletek.cfg\", io_append);if(file){ new str[156], Name[24], year, month, day, hour, minute, second; getdate(year, month, day); gettime(hour, minute, second); GetPlayerName(playerid, Name, 24); format(str, sizeof(str), \"[%d. %d. %d., %d:%d:%d]%s ötlete: %s\\n\", year, month, day, hour, minute, second, Name, otlet);fwrite(file, str);fclose(file);SendClientMessage(playerid, -1, \"Ötlet elküldve!\");}return 1;}
Szerintem aszért nem indul el a szeród azzal a fs-el mert a script files mappába létre kell hoznod egy otletek.cfg nevû fájlt!
----------Loaded log file: \"server_log.txt\".----------SA-MP Dedicated Server----------------------v0.3e, (C)2005-2012 SA-MP Team[15:11:19] password = \"\" (string)[15:11:19] [15:11:19] Server Plugins[15:11:19] --------------[15:11:19] Loading plugin: sscanf.so[15:11:19] [15:11:19] ===============================[15:11:19] sscanf plugin loaded. [15:11:19] (c) 2009 Alex \"Y_Less\" Cole[15:11:19] ===============================[15:11:19] Loaded.[15:11:19] Loading plugin: streamer.so[15:11:19] *** Streamer Plugin v2.5.2 by Incognito loaded ***[15:11:19] Loaded.[15:11:19] Loaded 2 plugins.[15:11:19] [15:11:19] Filterscripts[15:11:19] ---------------[15:11:19] Loading filterscript \'GarHouse.amx\'...[15:11:19] [15:11:19] ======================================= [15:11:19] | | [15:11:19] | YSI version 1.03.0011 | [15:11:19] | By Alex \"Y_Less\" Cole | [15:11:19] | | [15:11:19] | Checking the latest YSI version.. | [15:11:19] | | [15:11:19] ======================================= [15:11:19] [15:11:19] >> Attempting to load GarHouse v2.0... <<[15:11:19] Total House Interiors Loaded: 11. Duration: 2 ms[15:11:19] Total Houses Loaded: 300. Duration: 119 ms[15:11:19] >> GarHouse v2.0 By [03]Garsino Loaded <<[15:11:19] Loading filterscript \'admin.amx\'...[15:11:19] ________________________________________[15:11:19] ________________________________________[15:11:19] LAdmin Loading... [15:11:19] ________________________________________[15:11:19] -Configuration Settings Loaded[15:11:19] ________________________________________[15:11:19] LAdmin Version 4.2 [15:11:19] Loaded [15:11:19] ________________________________________[15:11:19] Date: 29/7/2012 Time: 15:11 :19 [15:11:19] ________________________________________[15:11:19] ________________________________________[15:11:19] Loading filterscript \'uzenet.amx\'...[15:11:19] Loading filterscript \'szincript.amx\'...[15:11:19] Loading filterscript \'zCars.amx\'...[15:11:19] Loading filterscript \'tuning.amx\'...[15:11:19] --------------------------------------[15:11:19] --------------------------------------[15:11:19] Loading filterscript \'flip+pl.amx\'...[15:11:19] Loading filterscript \'ortin.amx\'...[15:11:19] *|Epsilon Nitrous|*[15:11:19] Loading filterscript \'afk.amx\'...[15:11:19] Loading filterscript \'fh.amx\'...[15:11:19] Loading filterscript \'heal.amx\'...[15:11:19] Loading filterscript \'autoj.amx\'...[15:11:19] Loading filterscript \'otlet.amx\'...[15:11:19] Failed to load \'filterscripts/otlet.amx.amx\' filterscript.[15:11:19] Unable to load filterscript \'otlet.amx\'.[15:11:19] Loaded 12 filterscripts.