hozz létre a scriptfiles mapábba egy munkak mappát és majd oda menti el
[pawn]#include <a_samp>
#include <zcmd>
#include <dini>
new nev[MAX_PLAYER_NAME];
new file[100];
#pragma unused ret_memcpy
enum pData
{
munka1,
munka2,
munka3,
munka4,
munka5,
munka6,
munka7,
munka8,
munka9,
munka10
};
new PlayerInfo[MAX_PLAYERS][pData];
public OnPlayerDisconnect(playerid)
{
GetPlayerName(playerid, nev, sizeof(nev));
format(file, sizeof(file), \"munkak/%s.ini\",nev);
if(dini_Exists(file)) {
dini_IntSet(file, \"munka1\", PlayerInfo[playerid][munka1]);
dini_IntSet(file, \"munka2\", PlayerInfo[playerid][munka2]);
dini_IntSet(file, \"munka3\", PlayerInfo[playerid][munka3]);
dini_IntSet(file, \"munka4\", PlayerInfo[playerid][munka4]);
dini_IntSet(file, \"munka5\", PlayerInfo[playerid][munka5]);
dini_IntSet(file, \"munka6\", PlayerInfo[playerid][munka6]);
dini_IntSet(file, \"munka7\", PlayerInfo[playerid][munka7]);
dini_IntSet(file, \"munka8\", PlayerInfo[playerid][munka8]);
dini_IntSet(file, \"munka9\", PlayerInfo[playerid][munka9]);
dini_IntSet(file, \"munka10\", PlayerInfo[playerid][munka10]);
}
}
public OnPlayerConnect(playerid)
{
GetPlayerName(playerid, nev, sizeof(nev));
format(file, sizeof(file), \"munkak/%s.ini\",nev);
if(!dini_Exists(file)){
dini_Create(file);
dini_IntSet(file, \"munka1\", 0);
dini_IntSet(file, \"munka2\", 0);
dini_IntSet(file, \"munka3\", 0);
dini_IntSet(file, \"munka4\", 0);
dini_IntSet(file, \"munka5\", 0);
dini_IntSet(file, \"munka6\", 0);
dini_IntSet(file, \"munka7\", 0);
dini_IntSet(file, \"munka8\", 0);
dini_IntSet(file, \"munka9\", 0);
dini_IntSet(file, \"munka10\", 0);
}
else
{
PlayerInfo[playerid][munka1] = dini_Int(file, \"munka1\");
PlayerInfo[playerid][munka2] = dini_Int(file, \"munka2\");
PlayerInfo[playerid][munka3] = dini_Int(file, \"munka3\");
PlayerInfo[playerid][munka4] = dini_Int(file, \"munka4\");
PlayerInfo[playerid][munka5] = dini_Int(file, \"munka5\");
PlayerInfo[playerid][munka6] = dini_Int(file, \"munka6\");
PlayerInfo[playerid][munka7] = dini_Int(file, \"munka7\");
PlayerInfo[playerid][munka8] = dini_Int(file, \"munka8\");
PlayerInfo[playerid][munka9] = dini_Int(file, \"munka9\");
PlayerInfo[playerid][munka10] = dini_Int(file, \"munka10\");
}
return 1;
}
CMD:munka1(playerid){PlayerInfo[playerid][munka1] = 1;SendClientMessage(playerid, 0x1373C1FF, \"ok\");return 1;}
CMD:munkam(playerid){
if(PlayerInfo[playerid][munka1] == 1){SendClientMessage(playerid, 0x1373C1FF, \"munkád az 1.\");}
if(PlayerInfo[playerid][munka2] == 1){SendClientMessage(playerid, 0x1373C1FF, \"munkád az 2.\");}
if(PlayerInfo[playerid][munka3] == 1){SendClientMessage(playerid, 0x1373C1FF, \"munkád az 3.\");}
if(PlayerInfo[playerid][munka4] == 1){SendClientMessage(playerid, 0x1373C1FF, \"munkád az 4.\");}
if(PlayerInfo[playerid][munka5] == 1){SendClientMessage(playerid, 0x1373C1FF, \"munkád az 5.\");}
if(PlayerInfo[playerid][munka6] == 1){SendClientMessage(playerid, 0x1373C1FF, \"munkád az 6.\");}
if(PlayerInfo[playerid][munka7] == 1){SendClientMessage(playerid, 0x1373C1FF, \"munkád az 7.\");}
if(PlayerInfo[playerid][munka8] == 1){SendClientMessage(playerid, 0x1373C1FF, \"munkád az 8.\");}
if(PlayerInfo[playerid][munka9] == 1){SendClientMessage(playerid, 0x1373C1FF, \"munkád az 9.\");}
if(PlayerInfo[playerid][munka10] == 1){SendClientMessage(playerid, 0x1373C1FF, \"munkád az 10.\");}
return 1;
}[/pawn]