-
Posts
7,337 -
Joined
-
Days Won
11
Everything posted by TAPL
-
Happen to me several times, even though i was just started my local server and my mta and didn't join any other server. Haven't seen this problem for a while now, not sure if it been fixed or something.
-
function speed (player) if player == localPlayer then addEventHandler ( "onClientRender", root, draw ) end end addEventHandler ("onClientVehicleEnter", root, speed) function hideSpeed (player) if player == localPlayer then removeEventHandler ( "onClientRender", root, draw ) end end addEventHandler("onClientVehicleExit", root, hideSpeed) function draw ( ) --this is where I have dxdraw stuff. end
-
You should use guiSetText instead of creating new label.
-
I test the code and everything work fine.
-
executeCommandHandler client side cannot execute server side commands.
-
You wasted your time then because it wrong and even if it was correct, if you restart the script everything will lost.
-
https://wiki.multitheftauto.com/wiki/DxDrawRectangle
-
local barrier = {} function createBarrier(thePlayer) local team = getPlayerTeam(thePlayer) if (team and getTeamName(team) == "Unique") and not isElement(barrier[thePlayer]) then local nX, nY, nZ = getElementPosition(thePlayer) local nX2, nY2 = 0, 0 local nZ2 = getPedRotation(thePlayer) barrier[thePlayer] = createObject(3578, nX, nY, nZ - 0.2, 0, 0, nZ2) setElementPosition(thePlayer, nX, nY, nZ + 1) end end addCommandHandler("b", createBarrier) function removeBarrier(thePlayer) if isElement(barrier[thePlayer]) then destroyElement(barrier[thePlayer]) barrier[thePlayer] = nil end end addCommandHandler("r", removeBarrier) addEventHandler("onPlayerQuit", root, function() if isElement(barrier[source]) then destroyElement(barrier[source]) barrier[source] = nil end end)
-
local marker1 = createMarker(2759.88, -2015.33, 12.9, "cylinder", 0.75, 0, 252, 0) local marker2 = createMarker(x, y, z, "cylinder", 0.75, 0, 252, 0) -- عدل الأحداثيات addEventHandler("onResourceStart", resourceRoot, function() for _, p in ipairs(getElementsByType("player")) do bindKey(p, "h", "down", Animation) end end) addEventHandler("onPlayerJoin", root, function() bindKey(source, "h", "down", Animation) end) function Animation(player) if isElementWithinMarker(player, marker1) or isElementWithinMarker(player, marker2) then setElementFrozen(player, true) setTimer(setElementFrozen, 5500, 1, player, false) setPedAnimation(player, "FOOD", "EAT_Burger", _, false, _, _, false) end end
-
Click on the function there is examples on the wiki.
-
Try this: addEvent( "modShop_playerLeaveModShop", true ) addEventHandler( "modShop_playerLeaveModShop", getRootElement( ), function( vehicle, itemsCost, upgrades, colors, paintjob, shopName ) local pMoney = getPlayerMoney( source ) local account = getPlayerAccount(source) if pMoney >= itemsCost and account then modTheVehicle( vehicle, upgrades, colors, paintjob, shopName ) takePlayerMoney( source, itemsCost ) triggerClientEvent( source, "modShop_moddingConfirmed", source ) local myTable = {} for i, ups in ipairs (upgrades) do table.insert ( myTable, ups ) end setAccountData (account, "cu",toJSON (myTable)) else outputChatBox( "#FF0000Inufficient founds! #00FF00Your pocket shows $"..tostring( getPlayerMoney( source ) )..".#FFFFFF Uninstall some upgrades.", source, 0,0,0,true) end end )
-
You don't need unpack, IIYAMA explained what it does. Why you even trying to unpack it, you can save upgrades table as JSON string directly.
-
Timer? what for and why you don't try do it yourself first?
-
gate = createObject(980, 1579, 713.6, 12.5, 0, 0, 90) -- Not quite sure if the rotation should be 0 else edit it nottrue = false addCommandHandler("gate", function (thePlayer) local team = getPlayerTeam (thePlayer) if ( team and getTeamName ( team ) == "The Montana Family" ) then local x, y, z = getElementPosition(thePlayer) local distance = getDistanceBetweenPoints3D (x, y, z, 1579, 713.6, 12.5) if distance < 35 then if (nottrue == true) then moveObject( gate, 2000, 1579, 713.6, 12.5 ) nottrue = false elseif (nottrue == false) then moveObject( gate, 2000, 1579, 713.6, 7 ) nottrue = true end end else outputChatBox("Access Denied!", thePlayer, 255, 100, 0) end end)
-
استبدلهم بالمتغير الي عندك
-
يعني أنت عندك كود حالياً و الشرطي يجيه نجوم و يقدر يقتل الي ما عليه نجوم طيب حط لنا كودك!!!!!
-
You're welcome.
-
Account data can save up to 128 characters, if you have more than 128, only 128 will be saved and the rest will be lost therefore your table won't work then so you better get another way to save the string such as SQL.
