Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <a_samp>
- #include <YSI\y_ini>
- enum
- {
- dialog_none,
- dialog_register,
- dialog_login,
- dialog_godine,
- dialog_pol,
- dialog_drzava
- }
- #define PATH "/Nalozi/%s.ini"
- enum pData
- {
- pPassword,
- pNovac,
- pLevel,
- pGodine,
- pPol,
- pDrzava
- }
- new PlayerData[MAX_PLAYERS][pData];
- forward LoadUser_data(playerid,name[],value[]);
- public LoadUser_data(playerid,name[],value[])
- {
- INI_Int("Password",PlayerData[playerid][pPassword]);
- INI_Int("Novac",PlayerData[playerid][pNovac]);
- INI_Int("Level",PlayerData[playerid][pLevel]);
- INI_Int("Godine",PlayerData[playerid][pGodine]);
- INI_Int("Pol",PlayerData[playerid][pPol]);
- INI_Int("Drzava",PlayerData[playerid][pDrzava]);
- return 1;
- }
- //------------------------------------------------------------------------------
- stock UserPath(playerid)
- {
- new string[128],playername[MAX_PLAYER_NAME];
- GetPlayerName(playerid,playername,sizeof(playername));
- format(string,sizeof(string),PATH,playername);
- return string;
- }
- main()
- {
- }
- public OnGameModeInit()
- {
- return (true);
- }
- public OnGameModeExit()
- {
- return (true);
- }
- public OnPlayerConnect(playerid)
- {
- if(fexist(UserPath(playerid)))
- {
- INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
- new formatmsg[1024],
- PlayerName[MAX_PLAYER_NAME + 1];
- GetPlayerName(playerid, PlayerName, sizeof(PlayerName));
- format(formatmsg, 1024, "{FFFFFF}Dobrodosli na {8000FF}Alyx RolePlay {FFFFFF}online gaming zajednicu.\
- \n\n{8000FF}Vase ime: {FFFFFF}%s\
- \n{8000FF}Nalog: {FFFFFF}Imate\
- \n{8000FF}Forum: {FFFFFF}www.forum.com\
- \n{8000FF}TeamSpeak 3: {FFFFFF}ts3.server:7777\
- \n\nUnesite vas password da bi ste se prijavili na vas nalog.", PlayerName[playerid]);
- ShowPlayerDialog(playerid, dialog_login, DIALOG_STYLE_INPUT, "Alyx RolePlay", formatmsg, "Dalje", "Izlaz");
- }
- else
- {
- new formatmsg[1024],
- PlayerName[MAX_PLAYER_NAME + 1];
- GetPlayerName(playerid, PlayerName, sizeof(PlayerName));
- format(formatmsg, 1024, "{FFFFFF}Dobrodosli na {8000FF}Alyx RolePlay {FFFFFF}online gaming zajednicu.\
- \n\n{8000FF}Vase ime: {FFFFFF}%s\
- \n{8000FF}Nalog: {FFFFFF}Nemate\
- \n{8000FF}Forum: {FFFFFF}www.forum.com\
- \n{8000FF}TeamSpeak 3: {FFFFFF}ts3.server:7777\
- \n\nUnesite vas password da bi ste registrovali nalog.", PlayerName[playerid]);
- ShowPlayerDialog(playerid, dialog_register, DIALOG_STYLE_INPUT, "Alyx RolePlay", formatmsg, "Dalje", "Izlaz");
- }
- return (true);
- }
- public OnPlayerSpawn(playerid)
- {
- return (true);
- }
- public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
- {
- switch (dialogid)
- {
- case dialog_register:
- {
- if (!response) return Kick(playerid);
- if(response)
- {
- if(strlen(inputtext))
- {
- new INI:File = INI_Open(UserPath(playerid));
- INI_SetTag(File,"Data");
- INI_WriteString(File,"Password",inputtext);
- INI_WriteInt(File,"Novac",10000);
- INI_WriteInt(File,"Level",1);
- INI_WriteInt(File,"Godine",0);
- INI_WriteInt(File,"Pol",0);
- INI_WriteInt(File,"Drzava",0);
- INI_Close(File);
- ShowPlayerDialog(playerid, dialog_godine, DIALOG_STYLE_LIST, "Alyx RolePlay", "{8000FF}[-] {FFFFFF}12\
- \n{8000FF}[-] {FFFFFF}13\
- \n{8000FF}[-] {FFFFFF}14\
- \n{8000FF}[-] {FFFFFF}15\
- \n{8000FF}[-] {FFFFFF}16\
- \n{8000FF}[-] {FFFFFF}17\
- \n{8000FF}[-] {FFFFFF}18+", "Dalje", "Izlaz");
- }
- else
- {
- new formatmsg[1024],
- PlayerName[MAX_PLAYER_NAME + 1];
- GetPlayerName(playerid, PlayerName, sizeof(PlayerName));
- format(formatmsg, 1024, "{FFFFFF}Dobrodosli na {8000FF}Alyx RolePlay {FFFFFF}online gaming zajednicu.\
- \n\n{8000FF}Vase ime: {FFFFFF}%s\
- \n{8000FF}Nalog: {FFFFFF}Nemate\
- \n{8000FF}Forum: {FFFFFF}www.forum.com\
- \n{8000FF}TeamSpeak 3: {FFFFFF}ts3.server:7777\
- \n\nUnesite vas password da bi ste registrovali nalog.", PlayerName[playerid]);
- ShowPlayerDialog(playerid, dialog_register, DIALOG_STYLE_INPUT, "Alyx RolePlay", formatmsg, "Dalje", "Izlaz");
- }
- }
- }
- case dialog_godine:
- {
- switch (listitem)
- {
- case 0:
- {
- PlayerData[playerid][pGodine] = 1;
- ShowPlayerDialog(playerid, dialog_drzava, DIALOG_STYLE_LIST, "Alyx RolePlay", "{8000FF}[-] {FFFFFF}Republika Srpska\
- \n{8000FF}[-] {FFFFFF}Bosna i Hercegovina\
- \n{8000FF}[-] {FFFFFF}Srbija\
- \n{8000FF}[-] {FFFFFF}Crna Gora\
- \n{8000FF}[-] {FFFFFF}Slovenija\
- \n{8000FF}[-] {FFFFFF}Ostalo", "Dalje", "Izlaz");
- }
- case 1:
- {
- PlayerData[playerid][pGodine] = 2;
- ShowPlayerDialog(playerid, dialog_drzava, DIALOG_STYLE_LIST, "Alyx RolePlay", "{8000FF}[-] {FFFFFF}Republika Srpska\
- \n{8000FF}[-] {FFFFFF}Bosna i Hercegovina\
- \n{8000FF}[-] {FFFFFF}Srbija\
- \n{8000FF}[-] {FFFFFF}Crna Gora\
- \n{8000FF}[-] {FFFFFF}Slovenija\
- \n{8000FF}[-] {FFFFFF}Ostalo", "Dalje", "Izlaz");
- }
- case 2:
- {
- PlayerData[playerid][pGodine] = 3;
- ShowPlayerDialog(playerid, dialog_drzava, DIALOG_STYLE_LIST, "Alyx RolePlay", "{8000FF}[-] {FFFFFF}Republika Srpska\
- \n{8000FF}[-] {FFFFFF}Bosna i Hercegovina\
- \n{8000FF}[-] {FFFFFF}Srbija\
- \n{8000FF}[-] {FFFFFF}Crna Gora\
- \n{8000FF}[-] {FFFFFF}Slovenija\
- \n{8000FF}[-] {FFFFFF}Ostalo", "Dalje", "Izlaz");
- }
- case 3:
- {
- PlayerData[playerid][pGodine] = 4;
- ShowPlayerDialog(playerid, dialog_drzava, DIALOG_STYLE_LIST, "Alyx RolePlay", "{8000FF}[-] {FFFFFF}Republika Srpska\
- \n{8000FF}[-] {FFFFFF}Bosna i Hercegovina\
- \n{8000FF}[-] {FFFFFF}Srbija\
- \n{8000FF}[-] {FFFFFF}Crna Gora\
- \n{8000FF}[-] {FFFFFF}Slovenija\
- \n{8000FF}[-] {FFFFFF}Ostalo", "Dalje", "Izlaz");
- }
- case 4:
- {
- PlayerData[playerid][pGodine] = 5;
- ShowPlayerDialog(playerid, dialog_drzava, DIALOG_STYLE_LIST, "Alyx RolePlay", "{8000FF}[-] {FFFFFF}Republika Srpska\
- \n{8000FF}[-] {FFFFFF}Bosna i Hercegovina\
- \n{8000FF}[-] {FFFFFF}Srbija\
- \n{8000FF}[-] {FFFFFF}Crna Gora\
- \n{8000FF}[-] {FFFFFF}Slovenija\
- \n{8000FF}[-] {FFFFFF}Ostalo", "Dalje", "Izlaz");
- }
- case 5:
- {
- PlayerData[playerid][pGodine] = 6;
- ShowPlayerDialog(playerid, dialog_drzava, DIALOG_STYLE_LIST, "Alyx RolePlay", "{8000FF}[-] {FFFFFF}Republika Srpska\
- \n{8000FF}[-] {FFFFFF}Bosna i Hercegovina\
- \n{8000FF}[-] {FFFFFF}Srbija\
- \n{8000FF}[-] {FFFFFF}Crna Gora\
- \n{8000FF}[-] {FFFFFF}Slovenija\
- \n{8000FF}[-] {FFFFFF}Ostalo", "Dalje", "Izlaz");
- }
- case 6:
- {
- PlayerData[playerid][pGodine] = 7;
- ShowPlayerDialog(playerid, dialog_drzava, DIALOG_STYLE_LIST, "Alyx RolePlay", "{8000FF}[-] {FFFFFF}Republika Srpska\
- \n{8000FF}[-] {FFFFFF}Bosna i Hercegovina\
- \n{8000FF}[-] {FFFFFF}Srbija\
- \n{8000FF}[-] {FFFFFF}Crna Gora\
- \n{8000FF}[-] {FFFFFF}Slovenija\
- \n{8000FF}[-] {FFFFFF}Ostalo", "Dalje", "Izlaz");
- }
- }
- }
- case dialog_drzava:
- {
- switch (listitem)
- {
- case 0:
- {
- PlayerData[playerid][pDrzava] = 1;
- ShowPlayerDialog(playerid, dialog_pol, DIALOG_STYLE_LIST, "Alyx RolePlay", "{8000FF}[-] {FFFFFF}Musko\
- \n{8000FF}[-] {FFFFFF}Zensko", "Dalje", "Izlaz");
- }
- case 1:
- {
- PlayerData[playerid][pDrzava] = 2;
- ShowPlayerDialog(playerid, dialog_pol, DIALOG_STYLE_LIST, "Alyx RolePlay", "{8000FF}[-] {FFFFFF}Musko\
- \n{8000FF}[-] {FFFFFF}Zensko", "Dalje", "Izlaz");
- }
- case 2:
- {
- PlayerData[playerid][pDrzava] = 3;
- ShowPlayerDialog(playerid, dialog_pol, DIALOG_STYLE_LIST, "Alyx RolePlay", "{8000FF}[-] {FFFFFF}Musko\
- \n{8000FF}[-] {FFFFFF}Zensko", "Dalje", "Izlaz");
- }
- case 3:
- {
- PlayerData[playerid][pDrzava] = 4;
- ShowPlayerDialog(playerid, dialog_pol, DIALOG_STYLE_LIST, "Alyx RolePlay", "{8000FF}[-] {FFFFFF}Musko\
- \n{8000FF}[-] {FFFFFF}Zensko", "Dalje", "Izlaz");
- }
- case 4:
- {
- PlayerData[playerid][pDrzava] = 5;
- ShowPlayerDialog(playerid, dialog_pol, DIALOG_STYLE_LIST, "Alyx RolePlay", "{8000FF}[-] {FFFFFF}Musko\
- \n{8000FF}[-] {FFFFFF}Zensko", "Dalje", "Izlaz");
- }
- case 5:
- {
- PlayerData[playerid][pDrzava] = 6;
- ShowPlayerDialog(playerid, dialog_pol, DIALOG_STYLE_LIST, "Alyx RolePlay", "{8000FF}[-] {FFFFFF}Musko\
- \n{8000FF}[-] {FFFFFF}Zensko", "Dalje", "Izlaz");
- }
- }
- }
- case dialog_pol:
- {
- switch (listitem)
- {
- case 0:
- {
- PlayerData[playerid][pPol] = 1;
- SetSpawnInfo(playerid, 0, 26, 1481.3978, -1732.6604, 13.6672, 0, 0, 0, 0, 0, 0, 0);
- SpawnPlayer(playerid);
- }
- case 1:
- {
- PlayerData[playerid][pPol] = 2;
- SetSpawnInfo(playerid, 0, 26, 1481.3978, -1732.6604, 13.6672, 0, 0, 0, 0, 0, 0, 0);
- SpawnPlayer(playerid);
- }
- }
- }
- case dialog_login:
- {
- if (!response) return Kick(playerid);
- if (response)
- {
- if(strcmp(PlayerData[playerid][pPassword],inputtext , true ) == 0)
- {
- INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
- GivePlayerMoney(playerid, PlayerData[playerid][pNovac]);
- SetPlayerScore(playerid, PlayerData[playerid][pLevel]);
- SetSpawnInfo(playerid, 0, 26, 1481.3978, -1732.6604, 13.6672, 0, 0, 0, 0, 0, 0, 0);
- SpawnPlayer(playerid);
- }
- else
- {
- new formatmsg[1024],
- PlayerName[MAX_PLAYER_NAME + 1];
- GetPlayerName(playerid, PlayerName, sizeof(PlayerName));
- format(formatmsg, 1024, "{FFFFFF}Dobrodosli na {8000FF}Alyx RolePlay {FFFFFF}online gaming zajednicu.\
- \n\n{8000FF}Vase ime: {FFFFFF}%s\
- \n{8000FF}Nalog: {FFFFFF}Imate\
- \n{8000FF}Forum: {FFFFFF}www.forum.com\
- \n{8000FF}TeamSpeak 3: {FFFFFF}ts3.server:7777\
- \n\nUnesite vas password da bi ste se prijavili na vas nalog.", PlayerName[playerid]);
- ShowPlayerDialog(playerid, dialog_login, DIALOG_STYLE_INPUT, "Alyx RolePlay", formatmsg, "Dalje", "Izlaz");
- }
- }
- }
- //
- }
- return(true);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement