0 Üye ve 1 Ziyaretçi konuyu incelemekte.
addEventHandler("onClientMarkerHit",panel,function(giren) if giren == localPlayer then guiSetVisible(pencere,true) showCursor(true) triggerServerEvent("onPlayerRequestArmor", localPlayer, armor)endend)elseif source == buton1 then triggerServerEvent("onPlayerRequestArmor", resourceRoot, ) outputChatBox("Armor VERİLDİ",0,255,0,true) guiSetVisible(pencere,false) showCursor(false)
addEvent("onPlayerRequestArmor",true)addEventHandler("onPlayerRequestArmor",root,function()setPedArmor(source,100)outputChatBox("Armor verildi", source, 255, 0, 0, true)end )
Eğer oyuncunun direk markere girince Zırh (armor) vermesini istiyorsan aşağıdaki kodu kullan konu açarken biraz daha açıklayıcı olursanız sevinirim server-side içine ekle.KodaddEvent("onPlayerRequestArmor",true)addEventHandler("onPlayerRequestArmor",root,function()setPedArmor(source,100)outputChatBox("Armor verildi", source, 255, 0, 0, true)end )
marker = createMarker(-1017, -1007, 132.21 -1.1,"cylinder",1.1,0,255,0,255) ------- Panel Ayarları -------- local screenW, screenH = guiGetScreenSize() guiWindowSetSizable(panel, false) panel = guiCreateWindow((screenW - 322) / 2, (screenH - 202) / 2, 422, 202, "Cephane Sistemi", false) guiSetVisible(panel,false) ------- Butonlar -------- m4buton = guiCreateButton(116, 36, 67, 48, "M4", false, panel) mp5buton = guiCreateButton(115, 116, 68, 50, "MP5", false, panel) ak47buton = guiCreateButton(228, 38, 66, 46, "AK47", false, panel) canvezirh = guiCreateButton(330, 38, 66, 46, "Can - Zırh", false, panel) fulle = guiCreateButton(330, 117, 66, 46, "Hepsini Al", false, panel) deaglebuton = guiCreateButton(228, 117, 66, 49, "Deagle", false, panel) --resim1 = guiCreateStaticImage( -20, 40, 150, 120, "resim/asker.png", false, panel ) -- Marker Olayı --addEventHandler("onClientMarkerHit",marker,function(giren) if getElementType(giren) == "player" and giren == localPlayer then local takim = getPlayerTeam(giren) if takim then local takimisim = getTeamName(takim) if takimisim == "Jandarma Özel Harekat" then guiSetVisible(panel, true) showCursor(true)endendendend) -- Tıklama Functları --addEventHandler("onClientGUIClick",root,function() if source == kapatbuton then guiSetVisible(panel,false) showCursor(false)endend) ------ M4 BUTON ------ addEventHandler("onClientGUIClick",root,function()if source == m4buton thentriggerServerEvent("CephaneSistemi:M4al",localPlayer)endend)----- MP5 BUTON --------addEventHandler("onClientGUIClick",root,function()if source == mp5buton thentriggerServerEvent("CephaneSistemi:MP5al",localPlayer)endend)----- AK47 BUTON --------addEventHandler("onClientGUIClick",root,function()if source == ak47buton thentriggerServerEvent("CephaneSistemi:ak47al",localPlayer)endend)----- DEAGLE BUTON --------addEventHandler("onClientGUIClick",root,function()if source == deaglebuton thentriggerServerEvent("CephaneSistemi:deagle",localPlayer)endend)----- Can - Zirh --------addEventHandler("onClientGUIClick",root,function()if source == canvezirh thentriggerServerEvent("CephaneSistemi:CanZirh",localPlayer)endend)----- Hepsini Fulle --------addEventHandler("onClientGUIClick",root,function()if source == fulle thentriggerServerEvent("CephaneSistemi:Fulle",localPlayer)endend)
------ M4 -------mermi = 200id = 31 addEvent("CephaneSistemi:M4al",true)addEventHandler("CephaneSistemi:M4al",root,function()giveWeapon(source,id,mermi)outputChatBox("#000000[#CC0000Kızıl #FFFFFFSancak#000000] M4 Aldın!",source,0,255,0,true)end )------ MP5 -------mermi1 = 200id1 = 29 addEvent("CephaneSistemi:MP5al",true)addEventHandler("CephaneSistemi:MP5al",root,function()giveWeapon(source,id1,mermi1)outputChatBox("#000000[#CC0000Kızıl #FFFFFFSancak#000000] MP5 Aldın!",source,0,255,0,true)end )------- AK-47 -------mermi2 = 200id2 = 30 addEvent("CephaneSistemi:ak47al",true)addEventHandler("CephaneSistemi:ak47al",root,function()giveWeapon(source,id2,mermi2)outputChatBox("#000000[#CC0000Kızıl #FFFFFFSancak#000000] AK-47 Aldın!",source,0,255,0,true)end )------- DEAGLE -------mermi3 = 200id3 = 24 addEvent("CephaneSistemi:deagle",true)addEventHandler("CephaneSistemi:deagle",root,function()giveWeapon(source,id3,mermi3)outputChatBox("#000000[#CC0000Kızıl #FFFFFFSancak#000000] Deagle Aldın!",source,0,255,0,true)end )------- Can ve Zirh -------addEvent("CephaneSistemi:CanZirh",true)addEventHandler("CephaneSistemi:CanZirh",root,function()setElementHealth(source,200)setPedArmor(source,100)outputChatBox("#000000[#CC0000Kızıl #FFFFFFSancak#000000] Can Ve Zirh Aldın!",source,0,255,0,true)end )------- Fulle -------addEvent("CephaneSistemi:Fulle",true)addEventHandler("CephaneSistemi:Fulle",root,function()setElementHealth(source,200)setPedArmor(source,100)giveWeapon(source,24,150)giveWeapon(source,29,200)giveWeapon(source,31,450)outputChatBox("#000000[#CC0000Kızıl #FFFFFFSancak#000000] Hepsinden Aldın!",source,0,255,0,true)end )