Jump to content

PLEASE HELP CODING


mucuk6547

Recommended Posts

Hello I'm writing a C4 system I'm writing createObject but please don't help anything

CLİENT CODE:

function mapLoad ( object )
   -- create an object at a specified position with a specified rotation
   createObject ( 1225, -1568.75061, 393.524353, 8.30840778, 90, 0, 0 )
end
addEventHandler ( "onResourceStart", resourceRoot, mapLoad )

SERVER CODE:
function consoleCreateObject ( thePlayer, commandName )
   if ( thePlayer ) then
      local -1568.75061, 393.524353, 8.30840778 = getElementPosition ( thePlayer ) -- get the player's position
      -- create a Object next to the player:
      local theObject = createObject ( 1225, -1568.75061 + 2, 393.524353 + 2, 8.30840778, 0, 0, 0 )
      if ( theObject ) then -- check if the Obeject was created successfully
         outputConsole ( "Object created successfully", thePlayer )
      else
         outputConsole ( "Failed to create Object", thePlayer )
      end
   end
end
addCommandHandler ( "createObject", consoleCreateObject )

Syntax CODE

object createObject ( int 1225, float -1568.75061, float 393.524353, float 8.30840778, [ float rx, float ry, float rz, bool isLowLOD = false ] )

PLS HELP ME :(

Link to comment
function createC4(thePlayer)
  local x, y, z = getElementPosition(thePlayer)
  theObject = createObject(1225, x, y, z, 0,0 0)
  if theObject then
    outputConsole("Object created successfully", thePlayer)
  else
    outputConsole("Failed to create object", thePlayer)
  end 
end
addCommandHandler("createObject", createC4)

 

Edited by Dimos7
Link to comment
1 hour ago, Dimos7 said:

function createC4(thePlayer)
  local x, y, z = getElementPosition(thePlayer)
  theObject = createObject(1225, x, y, z, 0,0 0)
  if theObject then
    outputConsole("Object created successfully", thePlayer)
  else
    outputConsole("Failed to create object", thePlayer)
  end 
end
addCommandHandler("createObject", createC4)

 

It did not work

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...