SetPlayerSkin(playerid,JatekosInfo[playerid][pSkin]);
SendClientMessage(playerid,KEK,\"Sikeresen Bejelentkeztél!\");
SpawnPlayer(playerid);
#include <a_samp>#include <dini>#include <dudb>#define regisztracio 0#define bejelentkezes 1#define HIBA 0xFF0000FFnew nev[MAX_PLAYER_NAME];new Belepve[MAX_PLAYERS];enum JatekosAdatok{Penz,Skin,Float:X,Float:Y,Float:Z,}new JatekosInfo[MAX_PLAYERS][JatekosAdatok]; main(){print(\"\\n----------------------------------\");print(\" Blank Gamemode by your name here\");print(\"----------------------------------\\n\");} public OnGameModeInit(){// Don\'t use these lines if it\'s a filterscriptSetGameModeText(\"Blank Script\");AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);return 1;}public OnGameModeExit(){return 1;}public OnPlayerRequestClass(playerid, classid){SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);return 1;}public OnPlayerConnect(playerid){new file[256];GetPlayerName(playerid,nev,sizeof(nev));format(file,sizeof(file),\"/Karakterek/%s.ini\",nev);new string[256];if(!fexist(file)){format(string, sizeof string, \"Üdv %s! \\nKérjük regisztrálj! \\n\\nAdd meg a kívánt jelszavadat!\", nev);ShowPlayerDialog(playerid, regisztracio, DIALOG_STYLE_INPUT, \"Regisztráció\", string, \"Regisztráció\", \"Kilépés\");}if(fexist(file)){format(string, sizeof string, \"Üdv %s! \\nKérjük jelentkezz be! \\n\\nÍrd be a jelszavadat!\", nev);ShowPlayerDialog(playerid, bejelentkezes, DIALOG_STYLE_INPUT, \"Bejelentkezés\", string, \"Bejelentkezés\", \"Kilépés\");}return 1;}public OnPlayerDisconnect(playerid, reason){new file[256];new Float:x,Float:y,Float:z;GetPlayerPos(playerid,x,y,z); JatekosInfo[playerid][X] = x; JatekosInfo[playerid][Y] = y; JatekosInfo[playerid][Z] = z;GetPlayerName(playerid,nev,sizeof(nev));format(file,sizeof(file),\"/Karakterek/%s.ini\",nev);if(fexist(file) && Belepve[playerid]== 1){ dini_IntSet(file,\"Penz\",GetPlayerMoney(playerid)); dini_IntSet(file,\"Skin\",GetPlayerSkin(playerid)); dini_FloatSet(file,\"X\",JatekosInfo[playerid][X]); dini_FloatSet(file,\"Y\",JatekosInfo[playerid][Y]); dini_FloatSet(file,\"Z\",JatekosInfo[playerid][Z]);}Belepve[playerid]=0;JatekosInfo[playerid][Penz]= 0;JatekosInfo[playerid][skin]= 0;printf(\"%s kilépett.\",nev);return 1;}public OnPlayerSpawn(playerid){return 1;}public OnPlayerDeath(playerid, killerid, reason){return 1;}public OnVehicleSpawn(vehicleid){return 1;}public OnVehicleDeath(vehicleid, killerid){return 1;}public OnPlayerText(playerid, text[]){return 1;}public OnPlayerCommandText(playerid, cmdtext[]){if (strcmp(\"/mycommand\", cmdtext, true, 10) == 0){// Do something herereturn 1;}return 0;}public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger){return 1;}public OnPlayerExitVehicle(playerid, vehicleid){return 1;}public OnPlayerStateChange(playerid, newstate, oldstate){return 1;}public OnPlayerEnterCheckpoint(playerid){return 1;}public OnPlayerLeaveCheckpoint(playerid){return 1;}public OnPlayerEnterRaceCheckpoint(playerid){return 1;}public OnPlayerLeaveRaceCheckpoint(playerid){return 1;}public OnRconCommand(cmd[]){return 1;}public OnPlayerRequestSpawn(playerid){return 1;}public OnObjectMoved(objectid){return 1;}public OnPlayerObjectMoved(playerid, objectid){return 1;}public OnPlayerPickUpPickup(playerid, pickupid){return 1;}public OnVehicleMod(playerid, vehicleid, componentid){return 1;}public OnVehiclePaintjob(playerid, vehicleid, paintjobid){return 1;}public OnVehicleRespray(playerid, vehicleid, color1, color2){return 1;}public OnPlayerSelectedMenuRow(playerid, row){return 1;}public OnPlayerExitedMenu(playerid){return 1;}public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid){return 1;}public OnPlayerKeyStateChange(playerid, newkeys, oldkeys){return 1;}public OnRconLoginAttempt(ip[], password[], success){return 1;}public OnPlayerUpdate(playerid){return 1;}public OnPlayerStreamIn(playerid, forplayerid){return 1;}public OnPlayerStreamOut(playerid, forplayerid){return 1;}public OnVehicleStreamIn(vehicleid, forplayerid){return 1;}public OnVehicleStreamOut(vehicleid, forplayerid){return 1;}public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]){if (dialogid == regisztracio){if(response){ new file[256]; new string[256]; GetPlayerName(playerid, nev, sizeof(nev)); if(strlen(inputtext) == 0) { format(string, sizeof string, \"Üdv %s! \\nKérjük regisztrálj! \\n\\nAdd meg a kívánt jelszavadat!\", nev); ShowPlayerDialog(playerid, regisztracio, DIALOG_STYLE_INPUT, \"Regisztráció\", string, \"Regisztráció\", \"Kilépés\"); return 0; } format(file,sizeof(file),\"/Karakterek/%s.ini\",nev); if(!fexist(file)) { dini_Create(file); dini_IntSet(file, \"Antibug\",0); dini_IntSet(file, \"Jelszo\",udb_hash(inputtext)); dini_IntSet(file,\"Penz\",0); format(string, sizeof string, \"Üdv %s! \\nRegisztrálva vagy! \\n\\nÍrd be a jelszavadat!\", nev); ShowPlayerDialog(playerid, bejelentkezes, DIALOG_STYLE_INPUT, \"Bejelentkezés\", string, \"Belépés\", \"Kilépés\"); PlayerPlaySound(playerid,1057,0.0,0.0,0.0); printf(\"%s regisztrált a szerverre!\",nev); } else { format(string, sizeof string, \"Üdv %s! \\nRegisztrálva vagy! \\n\\nÍrd be a jelszavadat!\", nev); ShowPlayerDialog(playerid, bejelentkezes, DIALOG_STYLE_INPUT, \"Bejelentkezés\", string, \"Belépés\", \"Kilépés\"); }}}if(dialogid == bejelentkezes){if(response){ new file[256]; new string[256]; GetPlayerName(playerid, nev, sizeof(nev)); if(strlen(inputtext) == 0) { format(string, sizeof string, \"Bejelentkezés \\n\\nÜdv %s! \\nRegisztrálva vagy! \\n\\nÍrd be a jelszavadat!\", nev); ShowPlayerDialog(playerid, bejelentkezes, DIALOG_STYLE_INPUT, \"Bejelentkezés\", string, \"Belépés\", \"Kilépés\"); return 0; } format(file,sizeof(file),\"/Karakterek/%s.ini\",nev); if(fexist(file)) { new jelszo = dini_Int(file, \"Jelszo\"); if(udb_hash(inputtext) == jelszo) { Belepve[playerid] = 1; ResetPlayerMoney(playerid); JatekosInfo[playerid][Penz] = dini_Int(file,\"Penz\"); JatekosInfo[playerid][skin] = dini_Int(file,\"Skin\"); JatekosInfo[playerid][X] = dini_Int(file, \"X\"); JatekosInfo[playerid][Y] = dini_Int(file, \"Y\"); JatekosInfo[playerid][Z] = dini_Int(file, \"Z\"); GivePlayerMoney(playerid,JatekosInfo[playerid][Penz]); SetPlayerSkin(playerid,JatekosInfo[playerid][skin]); SetSpawnInfo(playerid,JatekosInfo[playerid][Penz],JatekosInfo[playerid][skin],JatekosInfo[playerid][X],JatekosInfo[playerid][Y],JatekosInfo[playerid][Z],0,0,0,0,0,0,0); SpawnPlayer(playerid); } else { SendClientMessage(playerid, HIBA, \"Rossz jelszó!\"); printf(\"%s bejelentkezése sikertelen volt.\", nev); Kick(playerid); } }}else{ Kick(playerid);}}return 1;}public OnPlayerClickPlayer(playerid, clickedplayerid, source){return 1;}
SetPlayerSkin(playerid,JatekosInfo[playerid][skin]);
Nem nagyon foglalkozok dinivel, de szerintem az a hibája hogy spawnolás elött adod a játékosnak a pénzt bejelentkezés után.Helyesen így csináld:Töröld a \'Sikeresen bejelentkeztél\' felöl ezt: GivePlayerMoney(playerid,JatekosInfo[playerid][pPenz]); és helyére rakd be ezt: SetPVarInt(playerid, \"NowLoogedIn\", 1); És az OnPlayerSpawn alá rakd ezt: if(GetPVarInt(playerid, \"NowLoogedIn\")) {SetPVarInt(playerid, \"NowLoogedIn\", 0);GivePlayerMoney(playerid,JatekosInfo[playerid][pPenz]);}
GivePlayerMoney(playerid,JatekosInfo[playerid][pPenz]);
SetPVarInt(playerid, \"NowLoogedIn\", 1);
if(GetPVarInt(playerid, \"NowLoogedIn\")) {SetPVarInt(playerid, \"NowLoogedIn\", 0);GivePlayerMoney(playerid,JatekosInfo[playerid][pPenz]);}