Jump to content

Z4Zy

Members
  • Posts

    215
  • Joined

  • Last visited

  • Days Won

    3

Everything posted by Z4Zy

  1. Z4Zy

    just script.

    For a example, you can try below code. Client Side :- local screenW,screenH = guiGetScreenSize() local progress = 0 addEventHandler("onClientRender",root, function () progress = progress + 0.99 local moveto1, moveto2 = interpolateBetween (screenW * 0.1475, screenH * 0.4648, 0, screenW * 0.5049, screenH * 0.4648, 0, progress, "SineCurve") dxDrawText(" This is a moving text ", moveto1, moveto2, screenW * 0.5264, screenH * 0.5417, tocolor(35, 204, 219, 255), 2.5, "default-bold", "center", "center", false, false, true, true, true) end )
  2. did you checkout IFP_demo before ? because you can get an idea about how to synchronize a custom anim from it.
  3. Z4Zy

    Animations stuff

    If you want to synchronize custom animations, check IFP_demo
  4. Z4Zy

    Animations stuff

    Did the parkour.ifp file located in the file called parkourFiles inside the resource ?
  5. You can include 1st optional argument called 'sendTo' of "triggerClientEvent" in this occasion. Server Side :- function bazKardanBox (thePlayer, command) local account = getPlayerAccount(thePlayer) local box = getAccountData(account, "pBox") local jayeze = math.random(50000,300000) if ( box and box > 0 ) then triggerClientEvent(thePlayer, "sedabox", resourceRoot) givePlayerMoney(thePlayer, jayeze) setAccountData( account,"pBox", box-1) outputChatBox("#FF00FF[Pro-Box]: #ffffff"..getPlayerName(thePlayer).." Az Box Mablagh #FF00FF$"..jayeze.." #ffffffBe Dast Avord!", root, 255, 255, 255, true) else if box == 0 then outputChatBox( "#ff0000[Error]: #ffffffShoma Box Nadarid!", thePlayer, 255, 0, 0,true ) else setAccountData( account,"pBox", 0) outputChatBox( "#ff0000[Error]: #ffffffShoma Box Nadarid!", thePlayer, 255, 0, 0,true ) end end end addCommandHandler("openbox", bazKardanBox)
  6. no problem. But, when a player command /openbox for first time, he wouldn't notify than he hadn't enough number of boxes.
  7. Below one is the better one. Since it checking if account data exist before any processes. function bazKardanBox (thePlayer, command) local account = getPlayerAccount(thePlayer) local box = getAccountData(account, "tedad") local jayeze = math.random(100000,600000) if ( box and box > 0 ) then -- the variable 'box' is actually a numeric value givePlayerMoney(thePlayer, jayeze) setAccountData( account,"tedad", box-1) -- 1 will be deducted from current box amount outputChatBox("#FF00FF[Pro-Box]: #ffffff"..getPlayerName(thePlayer).." Az Box Mablagh #FF00FF$"..jayeze.." #ffffffBe Dast Avord!", root, 255, 255, 255, true) else if box == 0 then -- box amount is 0 outputChatBox( "#ff0000[Error]: #ffffffShoma Box Nadarid!", thePlayer, 255, 0, 0,true ) else setAccountData( account,"tedad", 0) outputChatBox( "#ff0000[Error]: #ffffffShoma Box Nadarid!", thePlayer, 255, 0, 0,true ) end end end addCommandHandler("openbox", bazKardanBox)
  8. If player's box amount is equals to zero .. then it outputs. If there isn't "tedad" value in the account, set value to 0 and it output. It wouldn't output twice a same time.
  9. Check this out ! function bazKardanBox (thePlayer, command) local account = getPlayerAccount(thePlayer) local box = getAccountData(account, "tedad") local jayeze = math.random(100000,600000) if ( box > 0 ) then -- the variable 'box' is actually a numeric value givePlayerMoney(thePlayer, jayeze) setAccountData( account,"tedad", box-1) -- 1 will be deducted from current box amount outputChatBox("#FF00FF[Pro-Box]: #ffffff"..getPlayerName(thePlayer).." Az Box Mablagh #FF00FF$"..jayeze.." #ffffffBe Dast Avord!", root, 255, 255, 255, true) else if box == 0 then -- box amount is 0 outputChatBox( "#ff0000[Error]: #ffffffShoma Box Nadarid!", thePlayer, 255, 0, 0,true ) else -- when box ammount isn't exists or it's a boolean setAccountData( account,"tedad", 0) outputChatBox( "#ff0000[Error]: #ffffffShoma Box Nadarid!", thePlayer, 255, 0, 0,true ) end end end addCommandHandler("openbox", bazKardanBox)
  10. If there's not account data called "tedad" in the account, local value called box will receive a boolean [ false ]. So, you can't set it's data in line 10 since this is a boolean. Therefore, you need to set box's value to 0 if there isn't value already exists in that, like below. Server Side :- function dadanBox (thePlayer, command, player, tedad) local taraf = getPlayerFromName (player) local account = getPlayerAccount(taraf) local box = getAccountData(account, "tedad") or 0 local tedad = tonumber(tedad) local esmAdmin = getPlayerName(thePlayer) local esmesh = getPlayerName(taraf) if taraf then if tedad then setAccountData( account,"tedad", box+tedad) outputChatBox("#00ff00[Done]: #ffffffShoma Be #00ff00"..esmesh.." #ffffffTedad "..tedad.." Box Dadid!", thePlayer, 255, 255, 255, true) outputChatBox("#ffff00[Info]: #ffffffAdmin #ffff00"..esmAdmin.." #ffffffBe Shoma #ffff00"..tedad.." #ffffffBox Dad!", taraf, 255, 255, 255, true) else outputChatBox("#ff0000[Error]: #ffffffTedad Box Ra Vared Konid!", thePlayer, 255, 255, 255, true) end else outputChatBox("#00ff00Bezan: /givebox <PartOfName> <Tedad>", thePlayer, 255, 255, 255, true) end end addCommandHandler("givebox", dadanBox) function boxMan (thePlayer, command, tedad) local tedad = tonumber(tedad) local account = getPlayerAccount(thePlayer) local box = getAccountData(account, "tedad") outputChatBox("#00ff00Shoma #ffffff"..box.." #00ff00Box Darid!", thePlayer, 255, 255, 255, true) end addCommandHandler("mybox", boxMan)
  11. Hi ! what represents the 3rd argument [ true ] of "addEvent" ?
  12. I think your problem is... , when a GUI button was pressed by me, Infernus car should replaced only to me. But above code will replace it to all players. Is it your problem ? or what ?
  13. Or you can check that are there any element exist before destroy it. barreratbl = {} function consoleCreateObject ( player, commandName ) if exports.factions:isPlayerInFaction(player, 1) then local x, y, z = getElementPosition ( player ) -- get the player's position -- create a Object next to the player: obb = createObject ( 1228, x + 2, y , z, 0, 0, 0 ) table.insert (barreratbl, obb) if (obb) then outputChatBox("Barrier created",player,0,255,0) else outputChatBox("Barrier not created",player,255,0,0) end else outputChatBox("You aren't FCPD!!",player,255,0,0) end end addCommandHandler ( "barrera", consoleCreateObject ) function consoleCreateObject ( player, commandName ) if exports.factions:isPlayerInFaction(player, 1) then for i, v in pairs (barreratbl) do if isElement( v ) then destroyElement ( v )-- check if the Obeject was created successfully outputChatBox("The object was removed!!",player,0,255,0) end end else outputConsole ( "you aren't FCPD!!", player ) end end
  14. Well, can you see some edit options [ B, I, u] where you typing the texts to post ? There you can see a symbols like this <>. Click on it and paste your lua code there and click insert into post.
  15. I suggest you to use "moveObject" in this position. Can you please post your lua code with code option in edit panel ?
  16. You mean that marker should keep going with a same velocity when someone hit it ?
  17. This is an untested example. Hope it working ! Here you are ... local act1Marker1= createMarker(2445.3193359375,2376.3627929688,12.163512229919, "cylinder", 1.0,0,246,255,50) createBlipAttachedTo(act1Marker1,60) setElementData ( act1Marker1, "work", true ) local act1Marker2 = createMarker(2435.3193359375,2376.3627929688,12.163512229919, "cylinder", 1.0,0,246,255,50) setElementVisibleTo ( act1Marker2 , root, false ) setElementData ( act1Marker2, "work", false ) addEventHandler("onMarkerHit",act1Marker1, function(hitElement,matchingDimension) if getElementData ( source, "work" ) == true then triggerClientEvent("showGui", hitElement, hitElement) end end) function startact1Job(thePlayer) outputChatBox("Anda al siguiente marker!", hitElement,100,100,100) setElementVisibleTo ( act1Marker1, root, false) setElementData ( act1Marker1, "work", false ) setElementVisibleTo ( act1Marker2, root, true) setElementData ( act1Marker2, "work", true ) end addEvent("giveact1Job",true) addEventHandler("giveact1Job", root, startact1Job) function MarkerHit54( hitElement, matchingDimension ) if getElementData ( source, "work" ) == true then outputChatBox("Ganaste!", hitElement,100,100,100) setElementVisibleTo ( act1Marker1, root, true) setElementData ( act1Marker1, "work", true ) setElementVisibleTo ( act1Marker2, root, false) setElementData ( act1Marker2, "work", false ) end end addEventHandler( "onMarkerHit", act1Marker2, MarkerHit54 )
  18. So, it's easy to use setElementData to set an data to the marker when someone hit and check that element data is true or false when someone again hit it to decide that function should run or not.
  19. Well, as I understand... Use "destroyElement" to destroy the marker when someone hit. Instead of changing it's visibility. destroyElement([[Marker_Name]])
  20. Z4Zy

    help

    use /debugscript 3 command in game. Are there any script error related to this script ? Don't hesitate to display them here !
  21. As @LyricalMM said, you can create a vehicle, and set a data to it that change when player enter the vehicle or when the vehicle get destroyed or something else. then you can use addCommandHandler function to add a command to respawn the vehicle if vehicle's data has changed.
  22. Actually, Difference 01 :- The code that you have got from wiki will create a red marker near the player who command. And my code with your command fix will helps to move a certain object when a player command. Difference 02 :- The code that you have got from wiki has written the function separately from "addCommandHandler" event. As well as that function has given a name 'consoleCreateMarker'. And you can see.. that name has put into the 'addCommandHandler' event. But my code with your command fix has directly insert the function into the 'addCommandHandler' event without a function name. That's all I saw as different between that 2 codes. And note that my sample code is a simple code just generated by me.
  23. Server Side :- gate = --[ create a gate here ]-- gateOpen = false -- gate is closed by default addCommandHandler("openGate", function (player,command) if gateOpen ~= true then --[ set gate's position when opened ] -- outputChatBox("Gate Opened !",player,255,255,0) gateOpen = true elseif gateOpen == true then outputChatBox("Gate already opened !",player,255,0,0) end end addCommandHandler("closeGate", function (player,command) if gateOpen == true then --[ set gate's position when closed ] -- outputChatBox("Gate Closed !",player,255,255,0) gateOpen = false else outputChatBox("Gate already closed !",player,255,0,0) end end I think you are finding a thing like above. if so, then above is a sample that doesn't tested and completed yet.
  24. Hi ! Can you tell me a way to get a random player among players inside a col ? [ col refers to an area created by "createColSphere" function. ] "getRandomPlayer" function can't be use since it choose a random player from all players in the server. Any other way ?
×
×
  • Create New...