xeon17 Posted February 8, 2014 Share Posted February 8, 2014 local function openMenu ( ply, commandName, ply2name ) local ply2 = getPlayerFromName(ply2name) local ply1 = getPlayerName(ply) setElementData(ply2, "requestedDueler", tostringply1) triggerClientEvent ( ply2,"requestDuel",ply2, ply1) end addCommandHandler ( "duel", openMenu ) addEventHandler( "onElementClicked", getRootElement(), openMenu ) function teleportPlayers ( ply1,ply2name ) ply2=getPlayerFromName(ply2name) setElementData( ply1, "duelingOrNot", true) setElementData( ply2, "duelingOrNot", true) setElementFrozen( ply1, true) setElementFrozen( ply2, true) setElementData(ply1, "timeTilStart", 5) dimToGo = math.random(500,1500) setElementPosition ( ply1, -387.36789, 2249.11597, 42.09375, true ) setElementDimension( ply1, dimToGo ) setElementPosition ( ply2, -376.50397, 2208.43066, 42.09375, true ) setElementDimension ( ply2, dimToGo ) setPlayerWeaponSlot ( ply1, 0 ) setPlayerWeaponSlot ( ply2, 0 ) countdownTimer= setTimer ( function() if(getElementData(ply1, "timeTilStart") < 1)then setElementFrozen( ply1, false) setElementFrozen( ply2, false) triggerClientEvent ( ply2,"roundStart",ply2) triggerClientEvent ( ply1,"roundStart",ply1) setPlayerWeaponSlot ( ply1, 0 ) setPlayerWeaponSlot ( ply2, 0 ) outputChatBox ( "Duel Started" ) setElementData(ply1, "timeTilStart", 5) killTimer(countdownTimer) else setPlayerWeaponSlot ( ply1, 0) setPlayerWeaponSlot ( ply2, 0) outputChatBox ( getElementData(ply1, "timeTilStart").." Until Duel Starts", ply1 ) outputChatBox ( getElementData(ply1, "timeTilStart").." Until Duel Starts", ply2 ) setElementData(ply1, "timeTilStart", getElementData(ply1, "timeTilStart")-1) end end, 1000, 0 ) addEventHandler ( "onPlayerWasted", getRootElement(), function() if(getElementData( source, "duelingOrNot"))then setElementData( ply1, "duelingOrNot", false) setElementData( ply2, "duelingOrNot", false) triggerClientEvent ( ply2,"roundEnd",ply2) triggerClientEvent ( ply1,"roundEnd",ply1) killPed(ply1) killPed(ply2) end end ) end addEvent( "teleportPlayers", true ) addEventHandler( "teleportPlayers", root, teleportPlayers ) [2014-02-08 18:58:51] WARNING: DUEL\server.lua:2: Bad argument @ 'getPlayerFromName' [2014-02-08 18:58:51] WARNING: DUEL\server.lua:5: Bad argument @ 'setElementData' [Expected element at argument 1, got boolean] [2014-02-08 18:58:51] WARNING: DUEL\server.lua:6: Bad argument @ 'triggerClientEvent' [Expected string at argument 1, got boolean] [2014-02-08 18:58:56] start: Requested by EufraT [2014-02-08 18:59:30] WARNING: DUEL\server.lua:2: Bad argument @ 'getPlayerFromName' [2014-02-08 18:59:30] WARNING: DUEL\server.lua:5: Bad argument @ 'setElementData' [Expected element at argument 1, got boolean] [2014-02-08 18:59:30] WARNING: DUEL\server.lua:6: Bad argument @ 'triggerClientEvent' [Expected string at argument 1, got boolean] [2014-02-08 18:59:32] WARNING: DUEL\server.lua:5: Bad argument @ 'setElementData' [Expected element at argument 1, got boolean] [2014-02-08 18:59:32] WARNING: DUEL\server.lua:6: Bad argument @ 'triggerClientEvent' [Expected string at argument 1, got boolean] Link to comment
Bonsai Posted February 8, 2014 Share Posted February 8, 2014 I think you don't understand how this board works. You can't just post your stolen code, some debuglog and expect others to fix it without even writing one sentence. And what about using normal topic names? Link to comment
tosfera Posted February 8, 2014 Share Posted February 8, 2014 I think you don't understand how this board works.You can't just post your stolen code, some debuglog and expect others to fix it without even writing one sentence. And what about using normal topic names? and if you made it, how about learning the default coding standards. Alot of people will skip your problem because it's a piece of unorganised crap in a box... Link to comment
myonlake Posted February 8, 2014 Share Posted February 8, 2014 Those are a few clicks away from fixing, why not look at your own code and fix them yourself instead of giving us the code and error logs, we don't give a single duck about your problems if you don't put any effort to it yourself. You didn't even explain the problem, even though you put the error logs. This is not a place for you to just drop in such errors, if you've scripted anything in your life you'd know exactly what those errors mean. This is a disgrace. We spend time helping people with issues that they've faced, but they're rarely as simple problems like these. Look at the errors, find the lines and think what's wrong. The errors are in plain English, we're not bug fixers, you're the bug fixer as it's your code. Link to comment
Castillo Posted February 8, 2014 Share Posted February 8, 2014 This script is not yours. Link to comment
Recommended Posts