Heló irtam egy texdrawos személyit tökéletesen mûködik csak az a baj hogy nem tölti be az adatokat mert belép megcsinálja szeméylit megcsinálja a személyit lelép az emberke vissza lép akkor még kiirja de ha a servert restartolom akkor azt irja ki hogy nincs kitöltve
#include
#include
#define PATH \"/ROOCKmunka/Szemelyi/%s.jog\"
#define DIALOG_REGISTER 1
#define DIALOG_SUCCESS_1 3
#define COL_WHITE \"{FFFFFF}\"
#define COL_RED \"{F81414}\"
#define COL_GREEN \"{00FF22}\"
#define COL_LIGHTBLUE \"{00CED1}\"
#define RED 0xff0000AA
#define COLOR_RED 0xff0000AA
#define COLOR_GREEN 0x00ff15AA
#define szemelyi 7
#define kor 8896
#define nem 8897
#define lakh 8898
new Text:Szm1, Text:Szm2, Text:Szm3, Text:Szm4, Text:Szm5, Text:Szm6, Text:Szm61, Text:Szm62, Text:Szm63, Text:Szm64, Text:Szm65, Text:Szm66, Text:Szm67, Text:Szm7, Text:Szm8, Text:Szm81, Text:Szm82, Text:Szm9, Text:Szm10, Text:Szm101, Text:Szm102, Text:Szm103, Text:Szm104;
enum pInfo
{
Nev,
Nem,
Kor,
Lak,
Mun,
LMun,
Mire,
Autoja,
Rendszam
}
new PlayerInfo[MAX_PLAYERS][pInfo];
forward LoadUser_data(playerid,name[],value[]);
public LoadUser_data(playerid,name[],value[])
{
INI_Int(\"Kor\",PlayerInfo[playerid][Kor]);
INI_Int(\"Nem\",PlayerInfo[playerid][Nem]);
INI_Int(\"Lakhely\",PlayerInfo[playerid][Lak]);
INI_Int(\"Munka\",PlayerInfo[playerid][Mun]);
return 1;
}
public OnPlayerConnect(playerid)
{
if(fexist(UserPath(playerid)))
{
INI_ParseFile(UserPath(playerid), \"LoadUser_%s\", .bExtra = true, .extra = playerid);
}else{
ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT,\"\"COL_WHITE\"Regisztráció...\",\"\"COL_WHITE\"Ird be a jelszavad az új acountért.\",\"Register\",\"Quit\");
}
new namee[MAX_PLAYER_NAME];
GetPlayerName(playerid,namee,MAX_PLAYER_NAME);
new str[128];
format(str, sizeof str, \"%s\",namee);
Szm1 = TextDrawCreate(635.000000, 279.000000, \".\");
TextDrawBackgroundColor(Szm1, 16711935);
TextDrawLetterSize(Szm1, 0.050000, 10.000013);
TextDrawUseBox(Szm1, 1);
TextDrawBoxColor(Szm1, 255);
TextDrawTextSize(Szm1, 440.000000, -155.000000);
Szm2 = TextDrawCreate(502.000000, 284.000000, \"Szemelyi\");
TextDrawBackgroundColor(Szm2, 255);
TextDrawLetterSize(Szm2, 0.500000, 1.000000);
TextDrawColor(Szm2, -65281);
Szm3 = TextDrawCreate(460.000000, 295.000000, \"Nev:\");
TextDrawLetterSize(Szm3, 0.500000, 1.000000);
TextDrawColor(Szm3, -1);
Szm4 = TextDrawCreate(505.000000, 294.000000, str);
TextDrawLetterSize(Szm4, 0.500000, 1.000000);
TextDrawColor(Szm4, -1);
Szm5 = TextDrawCreate(460.000000, 310.000000, \"Kor:\");
TextDrawLetterSize(Szm5, 0.500000, 1.000000);
TextDrawColor(Szm5, -1);
Szm6 = TextDrawCreate(500.000000, 310.000000, \"Nincs Adat\");
TextDrawLetterSize(Szm6, 0.500000, 1.000000);
TextDrawColor(Szm6, -1);
Szm61 = TextDrawCreate(500.000000, 310.000000, \"14\");
Szm62 = TextDrawCreate(500.000000, 310.000000, \"15\");
Szm63 = TextDrawCreate(500.000000, 310.000000, \"16\");
Szm64 = TextDrawCreate(500.000000, 310.000000, \"17\");
Szm65 = TextDrawCreate(500.000000, 310.000000, \"18\");
Szm66 = TextDrawCreate(500.000000, 310.000000, \"19\");
Szm67 = TextDrawCreate(500.000000, 310.000000, \"20\");
Szm7 = TextDrawCreate(460.000000, 324.000000, \"Lakhely:\");
TextDrawLetterSize(Szm7, 0.500000, 1.000000);
TextDrawColor(Szm7, -1);
Szm8 = TextDrawCreate(459.000000, 338.000000, \"Nincs Adat\");
TextDrawLetterSize(Szm8, 0.500000, 1.000000);
TextDrawColor(Szm8, -1);
Szm81 = TextDrawCreate(459.000000, 338.000000, \"Las Barrancas\");
TextDrawLetterSize(Szm81, 0.500000, 1.000000);
TextDrawColor(Szm8, -1);
Szm82 = TextDrawCreate(459.000000, 338.000000, \"Fort Carson\");
TextDrawLetterSize(Szm82, 0.500000, 1.000000);
TextDrawColor(Szm8, -1);
Szm9 = TextDrawCreate(460.000000, 356.000000, \"Munka:\");
TextDrawLetterSize(Szm9, 0.500000, 1.000000);
TextDrawColor(Szm9, -1);
Szm10 = TextDrawCreate(523.000000, 356.000000, \"Nincs Adat\");
TextDrawLetterSize(Szm10, 0.500000, 1.000000);
TextDrawColor(Szm10, -1);
Szm101 = TextDrawCreate(523.000000, 356.000000, \"Uttisztito\");
TextDrawLetterSize(Szm101, 0.500000, 1.000000);
TextDrawColor(Szm101, -1);
Szm102 = TextDrawCreate(523.000000, 356.000000, \"Cementes\");
TextDrawLetterSize(Szm102, 0.500000, 1.000000);
TextDrawColor(Szm102, -1);
Szm103 = TextDrawCreate(523.000000, 356.000000, \"Fuvarozo\");
TextDrawLetterSize(Szm103, 0.500000, 1.000000);
TextDrawColor(Szm103, -1);
Szm104 = TextDrawCreate(523.000000, 356.000000, \"Penzszelitó\");
TextDrawLetterSize(Szm104, 0.500000, 1.000000);
TextDrawColor(Szm104, -1);
TextDrawHideForPlayer(playerid, Szm1);
TextDrawHideForPlayer(playerid, Szm2);
TextDrawHideForPlayer(playerid, Szm3);
TextDrawHideForPlayer(playerid, Szm4);
TextDrawHideForPlayer(playerid, Szm5);
TextDrawHideForPlayer(playerid, Szm6);
TextDrawHideForPlayer(playerid, Szm61);
TextDrawHideForPlayer(playerid, Szm62);
TextDrawHideForPlayer(playerid, Szm63);
TextDrawHideForPlayer(playerid, Szm64);
TextDrawHideForPlayer(playerid, Szm65);
TextDrawHideForPlayer(playerid, Szm66);
TextDrawHideForPlayer(playerid, Szm67);
TextDrawHideForPlayer(playerid, Szm7);
TextDrawHideForPlayer(playerid, Szm8);
TextDrawHideForPlayer(playerid, Szm81);
TextDrawHideForPlayer(playerid, Szm82);
TextDrawHideForPlayer(playerid, Szm9);
TextDrawHideForPlayer(playerid, Szm101);
TextDrawHideForPlayer(playerid, Szm102);
TextDrawHideForPlayer(playerid, Szm103);
TextDrawHideForPlayer(playerid, Szm104);
return 1;
}
public OnPlayerDisconnect(playerid, reason)
{
new INI:File = INI_Open(UserPath(playerid));
INI_WriteInt(File, \"Munkája\", PlayerInfo[playerid][Mun]);
INI_WriteString(File, \"LMunkája\", PlayerInfo[playerid][LMun]);
INI_WriteString(File, \"Mire\", PlayerInfo[playerid][Mire]);
INI_WriteString(File, \"Autója\", PlayerInfo[playerid][Autoja]);
INI_WriteString(File, \"Rendszám\", PlayerInfo[playerid][Rendszam]);
INI_Close(File);
return 1;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
switch( dialogid )
{
case DIALOG_REGISTER:
{
if (!response) return Kick(playerid);
if(response)
{
if(!strlen(inputtext)) return ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT, \"\"COL_WHITE\"Regisztráció...\",\"\"COL_RED\"Rossz jelszót adtál meg.\\n\"COL_WHITE\"Ird be a jelszavad az új acountért.\",\"Register\",\"Quit\");
new INI:File = INI_Open(UserPath(playerid));
INI_WriteInt(File, \"Kor\",0);
INI_WriteInt(File, \"Lakhely\",0);
INI_WriteInt(File, \"Munka\",0);
INI_WriteInt(File, \"Nem\",0);
INI_WriteString(File, \"LMunkája\", \"Nincs Kitöltve\");
INI_WriteString(File, \"Mire\", \"Nincs Kitöltve\");
INI_WriteString(File, \"Autója\", \"Nincs Kitöltve\");
INI_WriteString(File, \"Rendszám\", \"Nincs Kitöltve\");
INI_Close(File);
ShowPlayerDialog(playerid, DIALOG_SUCCESS_1, DIALOG_STYLE_MSGBOX,\"\"COL_WHITE\"Zsir!\",\"\"COL_GREEN\"Késza cucmód jáccá.(Isten is jó cucmó!)\",\"Ok\",\"\");
}
}
}
if(dialogid == szemelyi && response)
{
switch(listitem)
{
case 0:{ShowPlayerDialog(playerid, kor, DIALOG_STYLE_LIST, \"Korod?\", \"14\\n15\\n16\\n17\\n18\\n19\\n20\", \"Választ\", \"Kilép\");}
case 1:{ShowPlayerDialog(playerid, nem, DIALOG_STYLE_LIST, \"Nemed\", \"Férfi\\nNõ\", \"Választ\", \"Kilép\");}
case 2:{ShowPlayerDialog(playerid, lakh, DIALOG_STYLE_LIST, \"Lakhelyed\", \"Fort Carson\\nLas Barrancas\", \"Választ\", \"Kilép\");}
}
}
if(dialogid == kor)
{
switch(listitem)
{
case 0:{PlayerInfo[playerid][Kor]=14;new INI:File = INI_Open(UserPath(playerid));INI_WriteInt(File, \"Kor\",PlayerInfo[playerid][Kor]);INI_Close(File);}
case 1:{PlayerInfo[playerid][Kor]=15;new INI:File = INI_Open(UserPath(playerid));INI_WriteInt(File, \"Kor\",PlayerInfo[playerid][Kor]);INI_Close(File);}
case 2:{PlayerInfo[playerid][Kor]=16;new INI:File = INI_Open(UserPath(playerid));INI_WriteInt(File, \"Kor\",PlayerInfo[playerid][Kor]);INI_Close(File);}
case 3:{PlayerInfo[playerid][Kor]=17;new INI:File = INI_Open(UserPath(playerid));INI_WriteInt(File, \"Kor\",PlayerInfo[playerid][Kor]);INI_Close(File);}
case 4:{PlayerInfo[playerid][Kor]=18;new INI:File = INI_Open(UserPath(playerid));INI_WriteInt(File, \"Kor\",PlayerInfo[playerid][Kor]);INI_Close(File);}
case 5:{PlayerInfo[playerid][Kor]=19;new INI:File = INI_Open(UserPath(playerid));INI_WriteInt(File, \"Kor\",PlayerInfo[playerid][Kor]);INI_Close(File);}
case 6:{PlayerInfo[playerid][Kor]=20;new INI:File = INI_Open(UserPath(playerid));INI_WriteInt(File, \"Kor\",PlayerInfo[playerid][Kor]);INI_Close(File);}
}
}
if(dialogid == nem)
{
switch(listitem)
{
case 0:{PlayerInfo[playerid][Nem] = 1;new INI:File = INI_Open(UserPath(playerid));INI_WriteInt(File, \"Nem\",PlayerInfo[playerid][Nem]);INI_Close(File);}
case 1:{PlayerInfo[playerid][Nem] = 2;new INI:File = INI_Open(UserPath(playerid));INI_WriteInt(File, \"Nem\",PlayerInfo[playerid][Nem]);INI_Close(File);}
}
}
if(dialogid == lakh)
{
switch(listitem)
{
case 0:{PlayerInfo[playerid][Lak] = 1;new INI:File = INI_Open(UserPath(playerid));INI_WriteInt(File, \"Lakhely\",PlayerInfo[playerid][Lak]);INI_Close(File);}
case 1:{PlayerInfo[playerid][Lak] = 2;new INI:File = INI_Open(UserPath(playerid));INI_WriteInt(File, \"Lakhely\",PlayerInfo[playerid][Lak]);INI_Close(File);}
}
}
return 0;
}
new szemelyii;
public OnGameModeInit()
{
szemelyii = CreatePickup(1239, 1, 246.4413,118.2155,1003.2188);
Create3DTextLabel(\"Személyi\", COLOR_RED, 246.4413,118.2155,1003.2188, 40.0, 0, 10);
return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
if(strcmp(\"/szemelyi\", cmdtext, true) == 0)
{
TextDrawShowForPlayer(playerid, Szm1);
TextDrawShowForPlayer(playerid, Szm2);
TextDrawShowForPlayer(playerid, Szm3);
if (PlayerInfo[playerid][Kor] <= 1){
TextDrawShowForPlayer(playerid, Szm6);
}else if (PlayerInfo[playerid][Kor] == 14){
TextDrawShowForPlayer(playerid, Szm61);
TextDrawHideForPlayer(playerid, Szm6);
TextDrawHideForPlayer(playerid, Szm62);
TextDrawHideForPlayer(playerid, Szm63);
TextDrawHideForPlayer(playerid, Szm64);
TextDrawHideForPlayer(playerid, Szm65);
TextDrawHideForPlayer(playerid, Szm66);
TextDrawHideForPlayer(playerid, Szm67);
}else if (PlayerInfo[playerid][Kor] == 15){
TextDrawShowForPlayer(playerid, Szm62);
TextDrawHideForPlayer(playerid, Szm6);
TextDrawHideForPlayer(playerid, Szm61);
TextDrawHideForPlayer(playerid, Szm63);
TextDrawHideForPlayer(playerid, Szm64);
TextDrawHideForPlayer(playerid, Szm65);
TextDrawHideForPlayer(playerid, Szm66);
TextDrawHideForPlayer(playerid, Szm67);
}else if (PlayerInfo[playerid][Kor] == 16){
TextDrawShowForPlayer(playerid, Szm63);
TextDrawHideForPlayer(playerid, Szm6);
TextDrawHideForPlayer(playerid, Szm61);
TextDrawHideForPlayer(playerid, Szm62);
TextDrawHideForPlayer(playerid, Szm64);
TextDrawHideForPlayer(playerid, Szm65);
TextDrawHideForPlayer(playerid, Szm66);
TextDrawHideForPlayer(playerid, Szm67);
}else if (PlayerInfo[playerid][Kor] == 17){
TextDrawShowForPlayer(playerid, Szm64);
TextDrawHideForPlayer(playerid, Szm6);
TextDrawHideForPlayer(playerid, Szm61);
TextDrawHideForPlayer(playerid, Szm62);
TextDrawHideForPlayer(playerid, Szm63);
TextDrawHideForPlayer(playerid, Szm65);
TextDrawHideForPlayer(playerid, Szm66);
TextDrawHideForPlayer(playerid, Szm67);
}else if (PlayerInfo[playerid][Kor] == 18){
TextDrawShowForPlayer(playerid, Szm65);
TextDrawHideForPlayer(playerid, Szm6);
TextDrawHideForPlayer(playerid, Szm61);
TextDrawHideForPlayer(playerid, Szm62);
TextDrawHideForPlayer(playerid, Szm63);
TextDrawHideForPlayer(playerid, Szm64);
TextDrawHideForPlayer(playerid, Szm66);
TextDrawHideForPlayer(playerid, Szm67);
}else if (PlayerInfo[playerid][Kor] == 19){
TextDrawShowForPlayer(playerid, Szm66);
TextDrawHideForPlayer(playerid, Szm6);
TextDrawHideForPlayer(playerid, Szm61);
TextDrawHideForPlayer(playerid, Szm62);
TextDrawHideForPlayer(playerid, Szm63);
TextDrawHideForPlayer(playerid, Szm64);
TextDrawHideForPlayer(playerid, Szm65);
TextDrawHideForPlayer(playerid, Szm67);
}else if (PlayerInfo[playerid][Kor] == 20){
TextDrawShowForPlayer(playerid, Szm67);
TextDrawHideForPlayer(playerid, Szm6);
TextDrawHideForPlayer(playerid, Szm61);
TextDrawHideForPlayer(playerid, Szm62);
TextDrawHideForPlayer(playerid, Szm63);
TextDrawHideForPlayer(playerid, Szm64);
TextDrawHideForPlayer(playerid, Szm65);
TextDrawHideForPlayer(playerid, Szm66);
}
TextDrawShowForPlayer(playerid, Szm5);
TextDrawShowForPlayer(playerid, Szm4);
TextDrawShowForPlayer(playerid, Szm7);
if (PlayerInfo[playerid][Lak] == 2){
TextDrawShowForPlayer(playerid, Szm81);
TextDrawHideForPlayer(playerid, Szm82);
TextDrawHideForPlayer(playerid, Szm8);
}else if (PlayerInfo[playerid][Lak] == 1){
TextDrawShowForPlayer(playerid, Szm82);
TextDrawHideForPlayer(playerid, Szm81);
TextDrawHideForPlayer(playerid, Szm8);
}else if (PlayerInfo[playerid][Lak] == 0){
TextDrawShowForPlayer(playerid, Szm8);
TextDrawHideForPlayer(playerid, Szm81);
TextDrawHideForPlayer(playerid, Szm82);
}
TextDrawShowForPlayer(playerid, Szm9);
if (PlayerInfo[playerid][Mun] == 0){
TextDrawShowForPlayer(playerid, Szm10);
}else if (PlayerInfo[playerid][Mun] == 1){
TextDrawShowForPlayer(playerid, Szm101);
TextDrawHideForPlayer(playerid, Szm102);
TextDrawHideForPlayer(playerid, Szm103);
TextDrawHideForPlayer(playerid, Szm104);
}else if (PlayerInfo[playerid][Mun] == 2){
TextDrawShowForPlayer(playerid, Szm102);
TextDrawHideForPlayer(playerid, Szm101);
TextDrawHideForPlayer(playerid, Szm103);
TextDrawHideForPlayer(playerid, Szm104);
}else if (PlayerInfo[playerid][Mun] == 3){
TextDrawShowForPlayer(playerid, Szm103);
TextDrawHideForPlayer(playerid, Szm101);
TextDrawHideForPlayer(playerid, Szm102);
TextDrawHideForPlayer(playerid, Szm104);
}else if (PlayerInfo[playerid][Mun] == 4){
TextDrawShowForPlayer(playerid, Szm104);
TextDrawHideForPlayer(playerid, Szm101);
TextDrawHideForPlayer(playerid, Szm102);
TextDrawHideForPlayer(playerid, Szm103);
}
return 1;
}
return 0;
}
public OnPlayerPickUpPickup(playerid, pickupid)
{
if(pickupid == szemelyii)
{
ShowPlayerDialog(playerid, szemelyi, DIALOG_STYLE_LIST, \"Személyi\", \"Korod?\\nNeme?\\nLakhelye?\", \"Választ\", \"Kilép\");
SetPlayerPos(playerid, 246.4413,116.2155,1003.2188);
return 1;
}
return 0;
}
stock UserPath(playerid)
{
new string[128],playername[MAX_PLAYER_NAME];
GetPlayerName(playerid,playername,sizeof(playername));
format(string,sizeof(string),PATH,playername);
return string;
}
/*Credits to Dracoblue*/
stock udb_hash(buf[]) {
new length=strlen(buf);
new s1 = 1;
new s2 = 0;
new n;
for (n=0; n {
s1 = (s1 + buf[n]) % 65521;
s2 = (s2 + s1) % 65521;
}
return (s2 << 16) + s1;
}