Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
- {
- if(dialogid == DIALOG_REGISTER)
- {
- if (!response) return Kick(playerid);
- if(response)
- {
- ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_PASSWORD,"Registracija","Dobro dosli na Server!\n\nVi nemate Account\n\nForum: Uskoro!\n\nUpisite Password da se registrirate...","Registracija","Izadji");
- new INI:File = INI_Open(UserPath(playerid));
- INI_SetTag(File,"data");
- INI_WriteInt(File,"Password",udb_hash(inputtext));
- INI_WriteInt(File,"Respecti",0);
- INI_WriteInt(File,"Level",1);
- INI_WriteInt(File,"Novac",1000);
- INI_WriteInt(File,"Admin",0);
- INI_WriteInt(File,"Ubojstava",0);
- INI_WriteInt(File,"Smrti",0);
- INI_WriteInt(File,"Perk",0);
- INI_WriteInt(File,"Donator",0);
- INI_Close(File);
- }
- }
- if(dialogid == DIALOG_LOGIN)
- {
- if ( !response ) return Kick ( playerid );
- if( response )
- {
- if(udb_hash(inputtext) == PlayerInfo[playerid][pPass])
- {
- new loginname[64];
- GetPlayerName(playerid,loginname,sizeof(loginname));
- INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
- GivePlayerMoney(playerid, PlayerInfo[playerid][pNovac]);
- SetPlayerPos(playerid, 1554.6641,-1676.0160,16.1953);
- SpawnPlayer(playerid);
- }
- else
- {
- ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD,"Kriva sifra","Dobro dosli na Server!\n\nUpisali ste krivu sifru\n\nVi imate Account\n\nForum: Uskoro!\n\nUpisite tocnan Password da se Logirate...","Login","Izadji");
- }
- }
- }
- if(dialogid == DIALOG_PISTOL)
- {
- if(response)
- {
- if(listitem == 0)
- {
- if(PlayerInfo[playerid][pLevel] == 5) return SetPlayerArmour(playerid, 100.0);
- GivePlayerWeapon(playerid, 22, 500);
- ShowPlayerDialog(playerid, DIALOG_AUTOMATICPISTOL, DIALOG_STYLE_LIST,"Automatic Pistol","Uzi\nTec '9\nSMG","Odaberi","Odustani");
- }
- if(listitem == 1)
- {
- if(PlayerInfo[playerid][pLevel] == 5) return SetPlayerArmour(playerid, 100.0);
- GivePlayerWeapon(playerid, 23, 500);
- ShowPlayerDialog(playerid, DIALOG_AUTOMATICPISTOL, DIALOG_STYLE_LIST,"Automatic Pistol","Uzi\nTec '9\nSMG","Odaberi","Odustani");
- }
- if(listitem == 2)
- {
- if(PlayerInfo[playerid][pLevel] == 5) return SetPlayerArmour(playerid, 100.0);
- if(PlayerInfo[playerid][pLevel] != 5) return SCM(playerid, COLOR_RED, "Za Dezert Eagle je potrebno imati Level 5!");
- GivePlayerWeapon(playerid, 24, 500);
- ShowPlayerDialog(playerid, DIALOG_AUTOMATICPISTOL, DIALOG_STYLE_LIST,"Automatic Pistol","Uzi\nTec '9\nSMG","Odaberi","Odustani");
- }
- }
- }
- if(dialogid == DIALOG_AUTOMATICPISTOL)
- {
- if(response)
- {
- if(listitem == 0)
- {
- if(PlayerInfo[playerid][pLevel] != 7) return SCM(playerid, COLOR_RED,"Za Uzi je potrebno imati Level 7");
- GivePlayerWeapon(playerid, 28, 1000);
- ShowPlayerDialog(playerid, DIALOG_SHOOTGUN, DIALOG_STYLE_LIST,"Shoot Gun","Shootgun\nSawnoff Shotgun\nCombat Shotgun","Odaberi","Odustani");
- }
- if(listitem == 1)
- {
- if(PlayerInfo[playerid][pLevel] != 7) return SCM(playerid, COLOR_RED,"Za Tec '9 je potrebno imati Level 7");
- GivePlayerWeapon(playerid, 32, 1000);
- ShowPlayerDialog(playerid, DIALOG_SHOOTGUN, DIALOG_STYLE_LIST,"Shoot Gun","Shootgun\nSawnoff Shotgun\nCombat Shotgun","Odaberi","Odustani");
- }
- if(listitem == 2)
- {
- if(PlayerInfo[playerid][pLevel] != 10) return SCM(playerid, COLOR_RED,"Za SMF je potrebno imati Level 10");
- GivePlayerWeapon(playerid, 29, 300);
- ShowPlayerDialog(playerid, DIALOG_SHOOTGUN, DIALOG_STYLE_LIST,"Shoot Gun","Shootgun\nSawnoff Shotgun\nCombat Shotgun","Odaberi","Odustani");
- }
- }
- }
- if(dialogid == DIALOG_SHOOTGUN)
- {
- if(response)
- {
- if(listitem == 0)
- {
- if(PlayerInfo[playerid][pLevel] != 8) return SCM(playerid, COLOR_RED,"Za Shootgun je potrebno imati Level 8");
- GivePlayerWeapon(playerid, 25, 100);
- ShowPlayerDialog(playerid, DIALOG_AUTOMATIC, DIALOG_STYLE_LIST,"Automatic","AK-47\nM4","Odaberi","Odustani");
- }
- if(listitem == 1)
- {
- if(PlayerInfo[playerid][pLevel] != 11) return SCM(playerid, COLOR_RED,"Za Sawnoff Shotgun je potrebno imati Level 11");
- GivePlayerWeapon(playerid, 26, 200);
- ShowPlayerDialog(playerid, DIALOG_AUTOMATIC, DIALOG_STYLE_LIST,"Automatic","AK-47\nM4","Odaberi","Odustani");
- }
- if(listitem == 2)
- {
- if(PlayerInfo[playerid][pLevel] != 15) return SCM(playerid, COLOR_RED,"Za Combat Shotgun je potrebno imati Level 15");
- GivePlayerWeapon(playerid, 27, 200);
- ShowPlayerDialog(playerid, DIALOG_AUTOMATIC, DIALOG_STYLE_LIST,"Automatic","AK-47\nM4","Odaberi","Odustani");
- }
- }
- }
- if(dialogid == DIALOG_AUTOMATIC)
- {
- if(response)
- {
- if(listitem == 0)
- {
- if(PlayerInfo[playerid][pLevel] != 17) return SCM(playerid, COLOR_RED,"Za AK-47 je potrebno imati Level 17");
- GivePlayerWeapon(playerid, 30, 600);
- ShowPlayerDialog(playerid, DIALOG_RIFLE, DIALOG_STYLE_LIST,"Rifle","Rifle\nSniper","Odaberi","Odustani");
- }
- if(listitem == 1)
- {
- if(PlayerInfo[playerid][pLevel] != 20) return SCM(playerid, COLOR_RED,"Za M4 je potrebno imati Level 20");
- GivePlayerWeapon(playerid, 31, 1000);
- ShowPlayerDialog(playerid, DIALOG_RIFLE, DIALOG_STYLE_LIST,"Rifle","Rifle\nSniper","Odaberi","Odustani");
- }
- }
- }
- if(dialogid == DIALOG_RIFLE)
- {
- if(response)
- {
- if(listitem == 0)
- {
- if(PlayerInfo[playerid][pLevel] != 14) return SCM(playerid, COLOR_RED, "Za Rifle je potrebno imati Level 14");
- GivePlayerWeapon(playerid, 30, 600);
- if(PlayerInfo[playerid][pPerk] == 1) return ShowPlayerDialog(playerid, DIALOG_BOMB, DIALOG_STYLE_LIST,"Bomb","Rucna bomba\nSuzavac\nMolotovni koktel","Odaberi","Odustani");
- }
- if(listitem == 1)
- {
- if(PlayerInfo[playerid][pLevel] != 18) return SCM(playerid, COLOR_RED, "Za Sniper je potrebno imati Level 18");
- GivePlayerWeapon(playerid, 30, 600);
- if(PlayerInfo[playerid][pPerk] == 1) return ShowPlayerDialog(playerid, DIALOG_BOMB, DIALOG_STYLE_LIST,"Bomb","Rucna bomba\nSuzavac\nMolotovni koktel\nC4","Odaberi","Odustani");
- }
- }
- }
- if(dialogid == DIALOG_BOMB)
- {
- if(response)
- {
- if(listitem == 0)
- {
- if(PlayerInfo[playerid][pTeam] != 1) return SCM(playerid, COLOR_RED, "Za rucne bombe moras biti Marinac!");
- GivePlayerWeapon(playerid, 16, 3);
- if(PlayerInfo[playerid][pPerk] == 2) return ShowPlayerDialog(playerid, DIALOG_RPG, DIALOG_STYLE_LIST,"RPG","Obicni RPG\nNapredni RPG","Odaberi","Odustani");
- }
- if(listitem == 1)
- {
- if(PlayerInfo[playerid][pTeam] != 2) return SCM(playerid, COLOR_RED, "Za suzavce moras biti specijalac!");
- GivePlayerWeapon(playerid, 17, 3);
- if(PlayerInfo[playerid][pPerk] == 2) return ShowPlayerDialog(playerid, DIALOG_RPG, DIALOG_STYLE_LIST,"RPG","Obicni RPG\nNapredni RPG","Odaberi","Odustani");
- }
- if(listitem == 2)
- {
- if(PlayerInfo[playerid][pTeam] != 3) return SCM(playerid, COLOR_RED, "Za molotovne koktele moras biti terorist!");
- GivePlayerWeapon(playerid, 18, 3);
- if(PlayerInfo[playerid][pPerk] == 2) return ShowPlayerDialog(playerid, DIALOG_RPG, DIALOG_STYLE_LIST,"RPG","Obicni RPG\nNapredni RPG","Odaberi","Odustani");
- }
- if(listitem == 3)
- {
- if(PlayerInfo[playerid][pPerk] != 2) return SCM(playerid, COLOR_RED, "Za C4 je potrebno imati Perk 2!");
- GivePlayerWeapon(playerid, 39, 3);
- if(PlayerInfo[playerid][pPerk] == 2) return ShowPlayerDialog(playerid, DIALOG_RPG, DIALOG_STYLE_LIST,"RPG","Obicni RPG\nNapredni RPG","Odaberi","Odustani");
- }
- }
- }
- if(dialogid == DIALOG_RPG)
- {
- if(response)
- {
- if(listitem == 0)
- {
- GivePlayerWeapon(playerid, 35, 5);
- if(PlayerInfo[playerid][pDonator] == 1) return ShowPlayerDialog(playerid, DIALOG_DONATORWEAPON, DIALOG_STYLE_LIST,"Donator Weapons","Minigun","Odaberi","Odustani");
- }
- if(listitem == 1)
- {
- if(PlayerInfo[playerid][pLevel] == 25) return SCM(playerid, COLOR_RED,"Za napredni RPG je potrebno imati Level 25!");
- GivePlayerWeapon(playerid, 36, 5);
- if(PlayerInfo[playerid][pDonator] == 1) return ShowPlayerDialog(playerid, DIALOG_DONATORWEAPON, DIALOG_STYLE_LIST,"Donator Weapons","Minigun","Odaberi","Odustani");
- }
- }
- }
- if(dialogid == DIALOG_DONATORWEAPON)
- {
- if(response)
- {
- if(listitem == 0)
- {
- if(PlayerInfo[playerid][pDonator] == 1) return GivePlayerWeapon(playerid, 38, 100);
- if(PlayerInfo[playerid][pDonator] == 2) return GivePlayerWeapon(playerid, 38, 200);
- if(PlayerInfo[playerid][pDonator] == 3) return GivePlayerWeapon(playerid, 38, 500);
- }
- }
- }
- if(dialogid == DIALOG_TEAM)
- {
- if(response)
- {
- if(listitem == 0)
- {
- PlayerInfo[playerid][pTeam] = 1;
- ShowPlayerDialog(playerid, DIALOG_PISTOL, DIALOG_STYLE_LIST,"Pistol","Glock\nGlock s prigusivacem\nDezert Eagle","Odaberi","Odustani");
- SetPlayerSkin(playerid, 287);
- }
- if(listitem == 1)
- {
- PlayerInfo[playerid][pTeam] = 2;
- ShowPlayerDialog(playerid, DIALOG_PISTOL, DIALOG_STYLE_LIST,"Pistol","Glock\nGlock s prigusivacem\nDezert Eagle","Odaberi","Odustani");
- SetPlayerSkin(playerid, 285);
- }
- if(listitem == 2)
- {
- PlayerInfo[playerid][pTeam] = 3;
- ShowPlayerDialog(playerid, DIALOG_PISTOL, DIALOG_STYLE_LIST,"Pistol","Glock\nGlock s prigusivacem\nDezert Eagle","Odaberi","Odustani");
- SetPlayerSkin(playerid, 144);
- }
- }
- }
- return false;
- }
Advertisement
Add Comment
Please, Sign In to add comment