-
Posts
7,337 -
Joined
-
Days Won
11
Everything posted by TAPL
-
Move this line to top, so it wont create the gui unless the marker hit was lspdMarker. if source == lspdMarker then function onMarkerEnter() if source == lspdMarker then oh and make sure who hit the marker was localPlayer function onMarkerEnter(hitPlayer) if hitPlayer == localPlayer and source == lspdMarker then OR create the gui out side the event.
-
What you did here is creating the gui inside the event onClientMarkerHit before you even check what marker was hit, you kidding? huh.
-
table is your friend.
-
Post all your onClientMarkerHit codes you doing something wrong here.
-
I don't understand your problem, show more code such the events..
-
guiCreateEdit -- المربع الي تكتب فيه guiCreateButton -- الزر الي تضغطه Event: 'onClientGUIClick' -- الأفنت لما تصغط الزر guiGetText -- تجيب الكلام الي بالمربع الي في اللوحة الأولى guiSetText -- و تحطه في اللوحة الثانية guiCreateButton -- الزر الي تضغطه Event: 'onClientGUIClick' -- الأفنت لما تصغط الزر guiSetText -- تشيل الكلام من اللوحة الثانية و تحطه فاضي
-
[RpG-Ar] حرب العصآبآت و حرب الشوارع تم الافتتاح !
TAPL replied to SaRy,#DanGer's topic in Arabic / العربية
يغلق -
[RpG-Ar] حرب العصآبآت و حرب الشوارع تم الافتتاح !
TAPL replied to SaRy,#DanGer's topic in Arabic / العربية
اما عاد بس القروب سيستيم؟ تقدر تقول حوالي 80% من سيرفركم برمجتي -
triggerServerEvent("giveMeGuard", localPlayer) change to: triggerServerEvent("giveMeGuard", localPlayer, localPlayer)
-
[RpG-Ar] حرب العصآبآت و حرب الشوارع تم الافتتاح !
TAPL replied to SaRy,#DanGer's topic in Arabic / العربية
ما عندكم ما عند جدتي كل المودات او على الأقل اغلبها حق جراند العرب و حقي -
sWidth, sHeight = guiGetScreenSize() function onTestExp() dxDrawText("#FFFFCC +"..tostring(experience), (539/1024)*sWidth, (545/768)*sHeight, (289/1024)*sWidth, (250/768)*sHeight, tocolor (255, 255, 255, 255), (0.7/1366)*sWidth,(0.7/768)*sHeight,"bankgothic","left","top",false,false,false,true) end addEvent("onTestExp", true) addEventHandler( "onTestExp", root, function(expe) if not isTimer(expTimer) then expTimer = setTimer(function() removeEventHandler("onClientRender", root, onTestExp) end, 2000, 1) experience = expe addEventHandler("onClientRender", root, onTestExp) else experience = (experience + expe) resetTimer(expTimer) end end)
-
https://forum.multitheftauto.com/viewtopic.php?f=91&t=67275
-
[SOLVED] bindKey does not seem to work with my GUI.
TAPL replied to TheGamingMann's topic in Scripting
You're welcome. -
[SOLVED] bindKey does not seem to work with my GUI.
TAPL replied to TheGamingMann's topic in Scripting
function createRegister() local screenW, screenH = guiGetScreenSize() wdwAccount = guiCreateWindow((screenW - 378) / 2, (screenH - 109) / 2, 378, 109, "Register/Login", false) guiWindowSetSizable(wdwAccount, false) lblPassword = guiCreateLabel(10, 37, 102, 15, "Enter a Password", false, wdwAccount) guiSetFont(lblPassword, "default-bold-small") edtInfo = guiCreateEdit(127, 33, 240, 24, "", false, wdwAccount) addEventHandler("onClientGUIAccepted", edtInfo, function() local password = guiGetText(edtInfo) triggerServerEvent("accLogReg", localPlayer, password) end ) guiEditSetMasked(edtInfo, true) btnSubmit = guiCreateButton(112, 67, 153, 30, "Submit", false, wdwAccount) --addEventHandler("onClientGUIClick", btnSubmit, accRequest, false) end -
[SOLVED] bindKey does not seem to work with my GUI.
TAPL replied to TheGamingMann's topic in Scripting
You don't need bindKey, you need this event: https://wiki.multitheftauto.com/wiki/OnClientGUIAccepted -
Example: This the client side: addEventHandle("onClientGUIClick", root, function() if source == YourButtonHere then triggerServerEvent("AnyNameToTheEvent", localPlayer, "Hello!", "ZzZzZz") end end) And this the server side: addEvent("AnyNameToTheEvent", true) addEventHandler("AnyNameToTheEvent", root, function(arg1, arg2) outputChatBox(getPlayerName(source).." has clicked the button and say "..arg1.." and say "..arg2) end) Try it.
-
Client Side: local x, y = guiGetScreenSize() SkinMusic = "data/music/SkinSelectMusic.mp3" SkinAnims = {"dnce_M_b","DAN_Left_A","DAN_Down_A","DAN_Loop_A"} StartSkin = 0 NewSkin = false --client addEvent("TriggerClient",true) function SelectSkin () setElementInterior ( getLocalPlayer(), 0, 0,0,0 ) setCameraMatrix( 2745.8266601563,-2231.1694335938,62.25520324707, 3999.9999499991,-2607.4000244141,16.1) skin = createPed ( StartSkin, 2749.7502441406,-2232.7170410156,61.727611541748,60 ) setPedAnimation( skin, "DANCING", SkinAnims[math.random(1,4)]) fadeCamera( true, 10) setTime(0,0) SkinSelectMusic = playSound(SkinMusic,true) bindKey("arrow_r","down",NextSkin) bindKey("arrow_l","down",LastSkin) bindKey(".","down",SpawnPlayer) addEventHandler("onClientRender",getRootElement(),AnnounceSkinJob) guiSetVisible(lnextskin,true) guiSetVisible(rnextskin,true) guiSetVisible(spawnskin,true) showCursor(true) showChat(false) showPlayerHudComponent ( "radar", false ) end addEventHandler("TriggerClient",root,SelectSkin) function SpawnPlayer() local r,g,b = math.random(0,255),math.random(0,255),math.random(0,255) triggerServerEvent ( "onClientWantsToSpawn", getLocalPlayer(), getLocalPlayer(),StartSkin,r,g,b ) unbindKey("arrow_r","down",NextSkin) unbindKey("arrow_l","down",LastSkin) unbindKey("lshift","down",SpawnPlayer) setTime(12,0) stopSound(SkinSelectMusic) removeEventHandler("onClientRender",getRootElement(),AnnounceSkinJob) showCursor(false) showChat(true) showPlayerHudComponent ( "radar", true ) guiSetVisible(lnextskin,false) guiSetVisible(rnextskin,false) guiSetVisible(spawnskin,false) setElementData(getLocalPlayer(),"red",r) setElementData(getLocalPlayer(),"green",g) setElementData(getLocalPlayer(),"blue",b) end function NextSkin() if StartSkin == 312 then StartSkin = -1 elseif StartSkin == 2 then StartSkin = 8 end StartSkin = StartSkin + 1 setElementModel(skin,StartSkin) setPedAnimation( skin, "DANCING", SkinAnims[math.random(1,4)]) SkinJobTextColor() end function LastSkin() if StartSkin == 0 then StartSkin = 313 elseif StartSkin == 9 then StartSkin = 3 end StartSkin = StartSkin - 1 setElementModel(skin,StartSkin) setPedAnimation( skin, "DANCING", SkinAnims[math.random(1,4)]) SkinJobTextColor() end lnextskin = guiCreateButton(x-x/1.30,y/1.22,x/5,y/20,"<<<",false) guiSetProperty(lnextskin,"PushedTextColour","FFFFFF00") guiSetFont(lnextskin,"sa-header") rnextskin = guiCreateButton(x-x/2.90,y/1.22,x/5,y/20,">>>",false) guiSetProperty(rnextskin,"PushedTextColour","FFFFFF00") guiSetFont(rnextskin,"sa-header") spawnskin = guiCreateButton(x-x/1.80,y/1.22,x/5,y/20,"Play",false) guiSetProperty(spawnskin,"PushedTextColour","FFFFFF00") guiSetFont(spawnskin,"sa-header") guiSetVisible(lnextskin,false) guiSetVisible(rnextskin,false) guiSetVisible(spawnskin,false) addEventHandler( "onClientGUIClick", getRootElement(), function() if source == lnextskin then LastSkin() elseif source == rnextskin then NextSkin() elseif source == spawnskin then SpawnPlayer() end end) ------PEDS function FreezeBots() local Bots = getElementsByType("ped") for k,v in ipairs(Bots) do setElementFrozen(v,true) end end function loadMansion () outputChatBox("[bem-Vindo Ao Server]", getRootElement(), 255, 0, 0,true ) end addEventHandler("onClientResourceStart", getResourceRootElement(), loadMansion)
-
lool The rotation is before skin argument, we can put 90 or whatever. spawnPlayer(diedPlayer,spawnLocations[chosenSpawnLocation][1],spawnLocations[chosenSpawnLocation][2],spawnLocations[chosenSpawnLocation][3],90,playerSkin[diedPlayer][1])
-
Use trigger: triggerClientEvent -- from server to client. triggerServerEvent -- from client to server.
-
لا ما نقدر تقول لك لان التعديل كبير و لاننا ما ندري وين بالتحديد لازم تروح تفتح مود الريس و تجلس تدور بأكواده و لا تتوقع ان احد راح يسوي الشغل عنك تسوي مود ريس من الصفر يمكن اصرف
