02.10.2012, 06:42
This is the OnDialogResponse
Код:
if(dialogid == DIALOG_LVPD) { if(response) return 1; switch(listitem) { case 0: { if(PlayerInfo[playerid][pDuty] == 1) { format(string, sizeof(string), "* %s menyimpan badge dan peralatan kerjanya ke Loker.",GetPlayerNameEx(playerid)); ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE); ResetPlayerWeaponsEx(playerid); OnDuty[playerid] = 0; PlayerInfo[playerid][pDuty] = 0; SetPlayerColor(playerid, TEAM_HIT_COLOR); SetPlayerArmour(playerid, 0.0); } else { format(string, sizeof(string), "* %s mengambil badge beserta peralatan kerja di Loker.",GetPlayerNameEx(playerid)); ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE); SetPlayerColor(playerid, COLOR_LVPD); SetPlayerArmour(playerid, 100.0); GivePlayerValidWeapon(playerid, 24, 99999); GivePlayerValidWeapon(playerid, 25, 99999); GivePlayerValidWeapon(playerid, 3, 99999); GivePlayerValidWeapon(playerid, 41, 99999); OnDuty[playerid] = 1; PlayerInfo[playerid][pDuty] = 1; } } case 1: { ShowPlayerDialog(playerid, DIALOG_LVPD_WEAPONS, DIALOG_STYLE_LIST, "Peralatan LVPD", "Mace\nStick\nDE\nCombat Shotgun\nMP5\nM4A1\nAK-47\nBomb Asap\nShotgun\nRifle\nSniper\nArmor\nK3\nAksesoris", "Pilih", "Batal"); } case 2: { ShowPlayerDialog(playerid, DIALOG_LVPD_CLOTHING, DIALOG_STYLE_LIST, "Pakaian", "Seragam\nPakaian untuk istirahat", "Pilih", "Batal"); } } } if(dialogid == DIALOG_LVPD_WEAPONS) { if(response) { if(Tax <= 0) return SendClientMessageEx(playerid,COLOR_WHITE,"Pemerintahan sedang memiliki tunggakan; tidak ada dana untuk peralatan."); if(PlayerInfo[playerid][pConnectTime] < 2 || PlayerInfo[playerid][pWRestricted] > 0) return SendClientMessageEx(playerid, COLOR_GRAD2, "Kamu memiliki pembatasan senjata, jadi kamu belum dapat menggunakan senjata!"); if(listitem == 0) // Mace { GivePlayerValidWeapon(playerid, 41, 60000); Tax -= 20; } else if(listitem == 1) // Nite Stick { GivePlayerValidWeapon(playerid, 3, 60000); Tax -= 20; } else if(listitem == 2) // Deagle { GivePlayerValidWeapon(playerid, 24, 60000); Tax -= 500; } else if(listitem == 3) // Spas12 * { GivePlayerValidWeapon(playerid, 27, 60000); Tax -= 10000; } else if(listitem == 4) // mp5 { GivePlayerValidWeapon(playerid, 29, 60000); Tax -= 400; } else if(listitem == 5) // m4 * { GivePlayerValidWeapon(playerid, 31, 60000); Tax -= 4000; } else if(listitem == 6) // ak-47 * { GivePlayerValidWeapon(playerid, 30, 60000); Tax -= 4000; } else if(listitem == 7) // Smoke Bomb * { GivePlayerValidWeapon(playerid, 17, 5); Tax -= 800; } else if(listitem == 8) // Shotgun { GivePlayerValidWeapon(playerid, 25, 60000); Tax -= 200; } else if(listitem == 9) // rifle { GivePlayerValidWeapon(playerid, 33, 60000); Tax -= 1000; } else if(listitem == 10) // Sniper * { GivePlayerValidWeapon(playerid, 34, 60000); Tax -= 10000; } else if(listitem == 11) // LSPD Kevlar { SetPlayerArmour(playerid, 100.0); Tax -= 2000; } else if(listitem == 12) SetPlayerHealth(playerid, 100); else ShowPlayerDialog( playerid, BUYTOYSCOP, DIALOG_STYLE_MSGBOX, "Aksesoris", "Selamat datang di Locker Aksesoris LEO!\n\n(Sama dengan aksesoris biasa, VIP membuka lebih banyak slot.)","Lanjut", "Batal" ); } } if(dialogid == DIALOG_LVPD_CLOTHING) { switch(listitem) { case 0: { ShowPlayerDialog(playerid, DIALOG_LVPD_CLOTHING_TWO, DIALOG_STYLE_LIST, "Seragam","Cadet\nPolwan\nOfficer\nKopral\nSersan\nLetnan\nPolantas\nSWAT\nKapten\nJendral", "Pakai", "Batal"); } case 1: { ShowPlayerDialog(playerid, FDUTYMENU4, DIALOG_STYLE_INPUT, "Pakaian","Pilih pakaian (dengan ID).", "Pilih", "Batal"); } } } if(dialogid == DIALOG_LVPD_CLOTHING_TWO) { switch(listitem) { case 0: { if(PlayerInfo[playerid][pRank] >= 0) { PlayerInfo[playerid][pModel] = 71; // Cadet SetPlayerSkin(playerid, 71); } else { SendClientMessageEx(playerid, COLOR_WHITE, "Minimal pangkat Cadet untuk dapat menggunakan seragam itu."); } } case 1: { if(PlayerInfo[playerid][pSex] == 2) { PlayerInfo[playerid][pModel] = 141; // Polwan SetPlayerSkin(playerid, 141); } else { SendClientMessageEx(playerid, COLOR_WHITE, "Kamu bukan seorang wanita."); } } case 2: { if(PlayerInfo[playerid][pRank] >= 1) { PlayerInfo[playerid][pModel] = 282; // Officer SetPlayerSkin(playerid, 282); } else { SendClientMessageEx(playerid, COLOR_WHITE, "Minimal pangkat Officer untuk dapat menggunakan seragam itu."); } } case 3: { if(PlayerInfo[playerid][pRank] >= 2) { PlayerInfo[playerid][pModel] = 280; // Kopral SetPlayerSkin(playerid, 280); } else { SendClientMessageEx(playerid, COLOR_WHITE, "Minimal pangkat Kopral untuk dapat menggunakan seragam itu."); } } case 4: { if(PlayerInfo[playerid][pRank] >= 3) { PlayerInfo[playerid][pModel] = 266; // Sersan SetPlayerSkin(playerid, 266); } else { SendClientMessageEx(playerid, COLOR_WHITE, "Minimal pangkat Sersan untuk dapat menggunakan seragam itu."); } } case 5: { if(PlayerInfo[playerid][pRank] >= 4) { PlayerInfo[playerid][pModel] = 281; // Letnan SetPlayerSkin(playerid, 281); } else { SendClientMessageEx(playerid, COLOR_WHITE, "Minimal pangkat Letnan untuk dapat menggunakan seragam itu."); } } case 6: { PlayerInfo[playerid][pModel] = 284; // Polantas SetPlayerSkin(playerid, 284); } case 7: { if(PlayerInfo[playerid][pDivision] == 2) { SetPlayerSkin(playerid, 285); // SWAT PlayerInfo[playerid][pModel] = 285; } else { SendClientMessageEx(playerid, COLOR_WHITE, "Hanya divisi SWAT yang dapat menggunakan seragam itu."); } } case 8: { if(PlayerInfo[playerid][pRank] >= 5) { PlayerInfo[playerid][pModel] = 265; // Kapten SetPlayerSkin(playerid, 265); } else { SendClientMessageEx(playerid, COLOR_WHITE, "Minimal pangkat Kapten untuk dapat menggunakan seragam itu."); } } case 9: { if(PlayerInfo[playerid][pRank] >= 6) { PlayerInfo[playerid][pModel] = 267; // Jendral SetPlayerSkin(playerid, 267); } else { SendClientMessageEx(playerid, COLOR_WHITE, "Hanya Jendral yang dapat menggunakan seragam itu."); } } } }