#include < a_samp >#include < Dini >#define RED 0xff0000AA // {ff0000}#define GREEN 0x51ff00AA // {51ff00}#define LILA 0xff00f7AA // {ff00f7} main(){print(\" Server by Lockett v0.0\");}new S[128], //RegisztrációPW[128],File[128],WPW[MAX_PLAYERS],Nev[MAX_PLAYER_NAME];forward ClearPlayerChat(playerid);public OnGameModeInit(){SetGameModeText(\"v0.0\");CreatePlayerClass();return 1;}public OnGameModeExit(){return 1;}public OnPlayerRequestClass(playerid, classid){format(File, sizeof(File), \"User/%s.ini\", Name(playerid));if(!fexist(File)){ClearPlayerChat(playerid);SetPlayerCameraPos(playerid, 1965.5404, 1342.8684, 17.9852);SetPlayerCameraLookAt(playerid, 1964.5417, 1342.8723, 17.7002);format(S, sizeof(S), \"Üdvözöllek a szerveren, a(z) %s név még nincs regisztrálva\\nÍrj be egy tetszõleges jelszót!\", Name(playerid));ShowPlayerDialog(playerid, 1, DIALOG_STYLE_INPUT, \"Regisztráció\", S, \"Rendben\", \"Mégse\");}else{ClearPlayerChat(playerid);SetPlayerCameraPos(playerid, 1965.5404, 1342.8684, 17.9852);SetPlayerCameraLookAt(playerid, 1964.5417, 1342.8723, 17.7002);format(S, sizeof(S), \"Üdvözöllek a szerveren, a(z) %s név már regisztrálva van!\\nÍrd be a jelszót!\", Name(playerid));ShowPlayerDialog(playerid, 2, DIALOG_STYLE_PASSWORD, \"Bejelentkezés\", S, \"Rendben\", \"Mégse\");}return 1;}public OnPlayerSpawn(playerid){return 1;}public OnPlayerDeath(playerid, killerid, reason){return 1;}public OnPlayerConnect(playerid){return 1;}public OnPlayerDisconnect(playerid){Save(playerid);return 1;}public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]){if(dialogid == 1){format(S, sizeof(S), \"Üdvözöllek a szerveren, a(z) %s név még nincs regisztrálva\\nÍrj be egy tetszõleges jelszót!\", Name(playerid));if(!response) Kick(playerid);if(strlen(inputtext) == 0) ShowPlayerDialog(playerid, 1, DIALOG_STYLE_INPUT, \"Regisztráció\", S, \"Rendben\", \"Mégsem\");format(File, sizeof(File), \"User/%s.ini\", Name(playerid));if(!fexist(File)){dini_Create(File);dini_Set(File, \"Password\", inputtext);ShowPlayerDialog(playerid, 2, DIALOG_STYLE_PASSWORD, \"Bejelentkezés\", \"Írd be a jelszavad.\", \"Rendben\", \"Mégsem\"); } }if(dialogid == 2) { format(File, sizeof(File), \"User/%s.ini\", Name(playerid));if(!response) Kick(playerid);format(PW, 64, \"%s\", dini_Get(File, \"Password\"));if(!strcmp(inputtext, PW, false)){SendClientMessage(playerid, GREEN, \"Sikeres belépés! Válasz skint!\");SendClientMessage(playerid, GREEN, \"Majd nyomj a {ff00f7}SPAWN{ff0000} gombra!\"), Load(playerid);}else{WPW[playerid] ++;SendClientMessage(playerid, RED, \"Rossz jelszó!\");if(WPW[playerid] == 3) return SendClientMessage(playerid, RED, \"Harmadszorra is elrontottad a jelszót, ki lettél rúgva!\"), Kick(playerid);ShowPlayerDialog(playerid, 2, DIALOG_STYLE_PASSWORD, \"Bejelentkezés\", \"Írd a helyes jelszót!\", \"Rendben\", \"Mégsem\");}}return 1;}public ClearPlayerChat(playerid){for(new m = 0; m < 100; m++) SendClientMessage(playerid,RED,\" \");return 1;}stock Save(playerid){format(File, sizeof(File), \"User/%s.ini\", Name(playerid));if(fexist(File)){dini_IntSet(File, \"Money\", GetPlayerMoney(playerid));dini_IntSet(File, \"Score\", GetPlayerScore(playerid));}}stock Load(playerid){format(File, sizeof(File), \"User/%s.ini\", Name(playerid));if(fexist(File)){GivePlayerMoney(playerid, dini_Int(File, \"Money\"));SetPlayerScore(playerid, dini_Int(File, \"Score\"));}}stock Name(playerid){GetPlayerName(playerid, Nev, sizeof(Nev));return Nev;}stock CreatePlayerClass(){for( new Skin; Skin < 300; Skin ++ ){ApplyAnimation(Skin, \"DAM_JUMP\", \"DAM_Dive_Loop\", 4.1, 1, 0, 0, 0, 0, 1);AddPlayerClass(Skin, 1954.6697,1343.4034,15.3746,270.7300, 0, 0, 0, 0, 0, 0 );}return 1;}
format(File, sizeof(File), \"User/%s.ini\", Name(playerid));
format(File, sizeof(File), \"/User/%s.ini\", Name(playerid));