#include <fixchars>
public OnFilterScriptInit(){new string[32]=\"Üdv nálunk!\";fixchars(string); print(string); unfixchars(string); print(string); return 1;}
// ----------------------------------// Magyar karakterek megjelenítésének automatikus javítása// Használathoz csak be kell ágyazni: #include <fixchars>// Készítette GameStar 2010 (frissítve 2012 április)// Weboldal: www.gtaforum.hu// ----------------------------------#include <a_samp>#if defined fixchars_included#endinput#endif#define fixchars_includedstock fixchar(chr){switch(chr){ case \'ö\': return \'¨\'; case \'Ö\': return \'‘\'; case \'ü\': return \'¬\'; case \'Ü\': return \'•\'; case \'ó\': return \'¦\'; case \'Ó\': return \'¬\'; case \'õ\': return \'§\'; case \'Õ\': return \'\'; case \'ú\': return \'ª\'; case \'Ú\': return \'“\'; case \'é\': return \'¾\'; case \'É\': return \'‡\'; case \'á\': return \'˜\'; case \'Á\': return \'\'; case \'û\': return \'«\'; case \'Û\': return \'·\'; case \'í\': return \'¢\'; case \'Í\': return \'‹\';}return chr;}stock fixchars(string[]){new chr;while(string[chr]){ string[chr] = fixchar(string[chr]); chr++;}return 1;}stock unfixchar(chr){switch(chr){ case \'¨\': return \'ö\'; case \'‘\': return \'Ö\'; case \'¬\': return \'ü\'; case \'•\': return \'Ü\'; case \'¦\': return \'ó\'; case \'¬\': return \'Ó\'; case \'§\': return \'õ\'; case \'\': return \'Õ\'; case \'ª\': return \'ú\'; case \'“\': return \'Ú\'; case \'¾\': return \'é\'; case \'‡\': return \'É\'; case \'˜\': return \'á\'; case \'\': return \'Á\'; case \'«\': return \'û\'; case \'·\': return \'Û\'; case \'¢\': return \'í\'; case \'‹\': return \'Í\';}return chr;}stock unfixchars(string[]){new chr;while(string[chr]){ string[chr] = unfixchar(string[chr]); chr++;}return 1;}stock fixchars_GameTextForPlayer(playerid,text[],time,style){ fixchars(text);return GameTextForPlayer(playerid,text,time,style);}#define GameTextForPlayer fixchars_GameTextForPlayerstock fixchars_GameTextForAll(text[],time,style){ fixchars(text);return GameTextForAll(text,time,style);}#define GameTextForAll fixchars_GameTextForAllstock Text:fixchars_TextDrawCreate(Float:x, Float:y, text[]){ fixchars(text);return TextDrawCreate(x,y,text);}#define TextDrawCreate fixchars_TextDrawCreatestock Menu:fixchars_CreateMenu(title[], columns, Float:x, Float:y, Float:col1width, Float:col2width = 0.0){ fixchars(title);return CreateMenu(title,columns,x,y,col1width,col2width);}#define CreateMenu fixchars_CreateMenustock fixchars_SetMenuColumnHeader(Menu:menuid, column, columnheader[]){ fixchars(columnheader);return SetMenuColumnHeader(menuid, column, columnheader);}#define SetMenuColumnHeader fixchars_SetMenuColumnHeaderstock fixchars_AddMenuItem(Menu:menuid, column, menutext[]){ fixchars(menutext);return AddMenuItem(menuid, column, menutext);}#define AddMenuItem fixchars_AddMenuItemstock fixchars_TextDrawSetString(Text:text, string[]){ fixchars(string);return TextDrawSetString(text,string);}#define TextDrawSetString fixchars_TextDrawSetString// 0.3e#if defined CreatePlayerTextDrawstock fixchars_CreatePlayerTextDraw(playerid, Float:x, Float:y, text[]){fixchars(text);return CreatePlayerTextDraw(playerid, x, y, text);}#define CreatePlayerTextDraw fixchars_CreatePlayerTextDraw#endif#if defined PlayerTextDrawSetStringstock fixchars_PlayerTextDrawSetS(playerid, PlayerText:text, string[]){fixchars(string);return PlayerTextDrawSetString(playerid,text,string);}#define PlayerTextDrawSetString fixchars_PlayerTextDrawSetS#endif
Sziasztok! Az lenne a kérdésem, hogy ez jó zcmd-s parancsokhoz is, mert sok helyen láttam, hogy ezt írják, de nekem nem akar menni, :tantrum: átírni meg nagyon nagy munka lenne :S Elõre is köszönöm a válaszokat
/********************************** * * * @Author: ZeeX * * @Version: 0.3.1 * * @Released: 31/10/2009 * * * **********************************/ #if defined _zcmd_included #endinput #endif #define _zcmd_included #define MAX_FUNC_NAME (32) #define COMMAND:%1(%2) \\ forward cmd_%1(%2); \\ public cmd_%1(%2) #define CMD:%1(%2) \\ COMMAND:%1(%2) #define command(%1,%2,%3) \\ COMMAND:%1(%2, %3) #define cmd(%1,%2,%3) \\ COMMAND:%1(%2, %3) #if !defined isnull #define isnull(%1) \\ ((!(%1[0])) || (((%1[0]) == \'\\1\') && (!(%1[1])))) #endif forward OnPlayerCommandReceived(playerid, cmdtext[]); forward OnPlayerCommandPerformed(playerid, cmdtext[], success); static bool:zcmd_g_HasOPCS = false, bool:zcmd_g_HasOPCE = false; #if defined FILTERSCRIPT public OnFilterScriptInit() { zcmd_g_HasOPCS = funcidx(\"OnPlayerCommandReceived\") != -1; zcmd_g_HasOPCE = funcidx(\"OnPlayerCommandPerformed\") != -1; return CallLocalFunction(\"zcmd_OnFilterScriptInit\", \"\"); } #if defined _ALS_OnFilterScriptInit #undef OnFilterScriptInit #else #define _ALS_OnFilterScriptInit #endif #define OnFilterScriptInit zcmd_OnFilterScriptInit forward zcmd_OnFilterScriptInit(); #else /*not a filterscript*/ public OnGameModeInit() { zcmd_g_HasOPCS = funcidx(\"OnPlayerCommandReceived\") != -1; zcmd_g_HasOPCE = funcidx(\"OnPlayerCommandPerformed\") != -1; if (funcidx(\"zcmd_OnGameModeInit\") != -1) { return CallLocalFunction(\"zcmd_OnGameModeInit\", \"\"); } return 1; } #if defined _ALS_OnGameModeInit #undef OnGameModeInit #else #define _ALS_OnGameModeInit #endif #define OnGameModeInit zcmd_OnGameModeInit forward zcmd_OnGameModeInit(); #endif /*if defined FILTERSCRIPT*/ stock strfindex(string[], sub[], start = 0, &pos = 0) { new r; r = strfind(string, sub, false, start); pos = r; return r; } stock replacesubstr(string[],sub[],to[]) { new pos, sublen = strlen(sub), stringlen = strlen(string); do { pos = strfindex(string, sub); if(pos >= 0) { strdel(string, pos, pos + sublen); strins(string, to, pos, stringlen); } else return 1; } while(strfindex(string, sub, pos, pos) >= 0); return 1; } public OnPlayerCommandText(playerid, cmdtext[]) { if (zcmd_g_HasOPCS && !CallLocalFunction(\"OnPlayerCommandReceived\", \"is\", playerid, cmdtext)) { return 1; } new pos, funcname[MAX_FUNC_NAME]; while (cmdtext[++pos] > \' \') { funcname[pos-1] = tolower(cmdtext[pos]); } format(funcname, sizeof(funcname), \"cmd_%s\", funcname); replacesubstr(funcname, \"ö\", \"_chr0_\"); replacesubstr(funcname, \"Ö\", \"_chr1_\"); replacesubstr(funcname, \"ü\", \"_chr2_\"); replacesubstr(funcname, \"Ü\", \"_chr3_\"); replacesubstr(funcname, \"ó\", \"_chr4_\"); replacesubstr(funcname, \"Ó\", \"_chr5_\"); replacesubstr(funcname, \"õ\", \"_chr6_\"); replacesubstr(funcname, \"Õ\", \"_chr7_\"); replacesubstr(funcname, \"ú\", \"_chr8_\"); replacesubstr(funcname, \"Ú\", \"_chr9_\"); replacesubstr(funcname, \"é\", \"_chr10_\"); replacesubstr(funcname, \"É\", \"_chr11_\"); replacesubstr(funcname, \"á\", \"_chr12_\"); replacesubstr(funcname, \"Á\", \"_chr13_\"); replacesubstr(funcname, \"û\", \"_chr14_\"); replacesubstr(funcname, \"Û\", \"_chr15_\"); replacesubstr(funcname, \"í\", \"_chr16_\"); replacesubstr(funcname, \"Í\", \"_chr17_\"); while (cmdtext[pos] == \' \') pos++; if (!cmdtext[pos]) { if (zcmd_g_HasOPCE) { return CallLocalFunction(\"OnPlayerCommandPerformed\", \"isi\", playerid, cmdtext, CallLocalFunction(funcname, \"is\", playerid, \"\\1\")); } return CallLocalFunction(funcname, \"is\", playerid, \"\\1\"); } if (zcmd_g_HasOPCE) { return CallLocalFunction(\"OnPlayerCommandPerformed\", \"isi\", playerid, cmdtext, CallLocalFunction(funcname, \"is\", playerid, cmdtext[pos])); } return CallLocalFunction(funcname, \"is\", playerid, cmdtext[pos]); } #if defined _ALS_OnPlayerCommandText #undef OnPlayerCommandText #else #define _ALS_OnPlayerCommandText #endif #define OnPlayerCommandText zcmd_OnPlayerCommandText forward zcmd_OnPlayerCommandText(playerid, cmdtext[]);
CMD:tesztel_chr10_s(playerid) { SendClientMessage(playerid, 0xFFFFFFFF, \"A /tesztelés parancs lefutott...\"); return 1; }
/* A saját karaktert így kell megadni: _chrAZONOSÍTÓ_ Lista: ö - _chr0_ Ö - _chr1_ ü - _chr2_ Ü - _chr3_ ó - _chr4_ Ó - _chr5_ õ - _chr6_ Õ - _chr7_ ú - _chr8_ Ú - _chr9_ é - _chr10_ É - _chr11_ á - _chr12_ Á - _chr13_ û - _chr14_ Û - _chr15_ í - _chr16_ Í - _chr17_ */
De van egy include amivel lehet ékezetet írni a parancsba. /********************************** * * * @Author: ZeeX * * @Version: 0.3.1 * * @Released: 31/10/2009 * * * **********************************/ #if defined _zcmd_included #endinput #endif #define _zcmd_included #define MAX_FUNC_NAME (32) #define COMMAND:%1(%2) \\ forward cmd_%1(%2); \\ public cmd_%1(%2) #define CMD:%1(%2) \\ COMMAND:%1(%2) #define command(%1,%2,%3) \\ COMMAND:%1(%2, %3) #define cmd(%1,%2,%3) \\ COMMAND:%1(%2, %3) #if !defined isnull #define isnull(%1) \\ ((!(%1[0])) || (((%1[0]) == \'\\1\') && (!(%1[1])))) #endif forward OnPlayerCommandReceived(playerid, cmdtext[]); forward OnPlayerCommandPerformed(playerid, cmdtext[], success); static bool:zcmd_g_HasOPCS = false, bool:zcmd_g_HasOPCE = false; #if defined FILTERSCRIPT public OnFilterScriptInit() { zcmd_g_HasOPCS = funcidx(\"OnPlayerCommandReceived\") != -1; zcmd_g_HasOPCE = funcidx(\"OnPlayerCommandPerformed\") != -1; return CallLocalFunction(\"zcmd_OnFilterScriptInit\", \"\"); } #if defined _ALS_OnFilterScriptInit #undef OnFilterScriptInit #else #define _ALS_OnFilterScriptInit #endif #define OnFilterScriptInit zcmd_OnFilterScriptInit forward zcmd_OnFilterScriptInit(); #else /*not a filterscript*/ public OnGameModeInit() { zcmd_g_HasOPCS = funcidx(\"OnPlayerCommandReceived\") != -1; zcmd_g_HasOPCE = funcidx(\"OnPlayerCommandPerformed\") != -1; if (funcidx(\"zcmd_OnGameModeInit\") != -1) { return CallLocalFunction(\"zcmd_OnGameModeInit\", \"\"); } return 1; } #if defined _ALS_OnGameModeInit #undef OnGameModeInit #else #define _ALS_OnGameModeInit #endif #define OnGameModeInit zcmd_OnGameModeInit forward zcmd_OnGameModeInit(); #endif /*if defined FILTERSCRIPT*/ stock strfindex(string[], sub[], start = 0, &pos = 0) { new r; r = strfind(string, sub, false, start); pos = r; return r; } stock replacesubstr(string[],sub[],to[]) { new pos, sublen = strlen(sub), stringlen = strlen(string); do { pos = strfindex(string, sub); if(pos >= 0) { strdel(string, pos, pos + sublen); strins(string, to, pos, stringlen); } else return 1; } while(strfindex(string, sub, pos, pos) >= 0); return 1; } public OnPlayerCommandText(playerid, cmdtext[]) { if (zcmd_g_HasOPCS && !CallLocalFunction(\"OnPlayerCommandReceived\", \"is\", playerid, cmdtext)) { return 1; } new pos, funcname[MAX_FUNC_NAME]; while (cmdtext[++pos] > \' \') { funcname[pos-1] = tolower(cmdtext[pos]); } format(funcname, sizeof(funcname), \"cmd_%s\", funcname); replacesubstr(funcname, \"ö\", \"_chr0_\"); replacesubstr(funcname, \"Ö\", \"_chr1_\"); replacesubstr(funcname, \"ü\", \"_chr2_\"); replacesubstr(funcname, \"Ü\", \"_chr3_\"); replacesubstr(funcname, \"ó\", \"_chr4_\"); replacesubstr(funcname, \"Ó\", \"_chr5_\"); replacesubstr(funcname, \"õ\", \"_chr6_\"); replacesubstr(funcname, \"Õ\", \"_chr7_\"); replacesubstr(funcname, \"ú\", \"_chr8_\"); replacesubstr(funcname, \"Ú\", \"_chr9_\"); replacesubstr(funcname, \"é\", \"_chr10_\"); replacesubstr(funcname, \"É\", \"_chr11_\"); replacesubstr(funcname, \"á\", \"_chr12_\"); replacesubstr(funcname, \"Á\", \"_chr13_\"); replacesubstr(funcname, \"û\", \"_chr14_\"); replacesubstr(funcname, \"Û\", \"_chr15_\"); replacesubstr(funcname, \"í\", \"_chr16_\"); replacesubstr(funcname, \"Í\", \"_chr17_\"); while (cmdtext[pos] == \' \') pos++; if (!cmdtext[pos]) { if (zcmd_g_HasOPCE) { return CallLocalFunction(\"OnPlayerCommandPerformed\", \"isi\", playerid, cmdtext, CallLocalFunction(funcname, \"is\", playerid, \"\\1\")); } return CallLocalFunction(funcname, \"is\", playerid, \"\\1\"); } if (zcmd_g_HasOPCE) { return CallLocalFunction(\"OnPlayerCommandPerformed\", \"isi\", playerid, cmdtext, CallLocalFunction(funcname, \"is\", playerid, cmdtext[pos])); } return CallLocalFunction(funcname, \"is\", playerid, cmdtext[pos]); } #if defined _ALS_OnPlayerCommandText #undef OnPlayerCommandText #else #define _ALS_OnPlayerCommandText #endif #define OnPlayerCommandText zcmd_OnPlayerCommandText forward zcmd_OnPlayerCommandText(playerid, cmdtext[]); Ezek az ékezetek. Jelmagyarázat: \"Ú\" - betû amit helyettesít ; \"_chr9_\" - ezt kell beírnod a parancsba!Példa parancs: CMD:tesztel_chr10_s(playerid) { SendClientMessage(playerid, 0xFFFFFFFF, \"A /tesztelés parancs lefutott...\"); return 1; } /* A saját karaktert így kell megadni: _chrAZONOSÍTÓ_ Lista: ö - _chr0_ Ö - _chr1_ ü - _chr2_ Ü - _chr3_ ó - _chr4_ Ó - _chr5_ õ - _chr6_ Õ - _chr7_ ú - _chr8_ Ú - _chr9_ é - _chr10_ É - _chr11_ á - _chr12_ Á - _chr13_ û - _chr14_ Û - _chr15_ í - _chr16_ Í - _chr17_ */ (Nem én írtam)Üdv. JBauer