Jump to content

ratoc

Members
  • Posts

    11
  • Joined

  • Last visited

Everything posted by ratoc

  1. ratoc

    god mode

    i like generateboosting too clientside: function damag(attacker, weapon, bodypart) cancelEvent() end addEventHandler("onClientPlayerDamage", getLocalPlayer(), damag) nobody can help me in the savepos/loadpos problem? stunt is very bad without it
  2. ratoc

    god mode

    here is a car spawner with spoosh: function cmdCreateVehicle(player, cmd, vehname) local vehid = getVehicleIDFromName(vehname) if(vehid) then if isPlayerInVehicle(player) then newveh = getPlayerOccupiedVehicle(player) setVehicleModel(newveh, vehid) else local X, Y, Z = getElementPosition(player) local rot = getPlayerRotation(player) newveh = createVehicle(vehid, X, Y, Z, 0, 0, rot) warpPlayerIntoVehicle(player, newveh) end setVehicleDamageProof(newveh, true) setVehicleGunsEnabled(newveh, false) outputChatBox("Vehicle spawned.", player) else outputChatBox("Vehicle not found.", player) end end addCommandHandler("spawn", cmdCreateVehicle) just put into the mod
  3. ill write a php race>dm converter
  4. ratoc

    god mode

    only health to vehicle: setVehicleDamageProof(veh, true)
  5. I use editplus, there is syntax highlight in it for lua just add this stx file: http://www.editplus.com/dn.cgi?lua51.zip
  6. ratoc

    god mode

    hmm saving is ok, but loading data isnt works function savepos(player, cmd) local posX, posY, posZ = getElementPosition(player) local rot = getPlayerRotation(player) local name = getClientName(player) local positions = {posX, posY, posZ, rot} local setting = set(name, positions) if setting then outputChatBox("Position saved.", player) else outputChatBox("Failed to save position.", player) end end function loadpos(player, cmd) local name = getClientName(player) local data = get(name) if data then setElementPosition(player, data[0], data[1], data[2]) setPlayerRotation(player, data[3]) outputChatBox("Position loaded.", player) else outputChatBox("You aren't saved yet.", player) end end addCommandHandler("sp", savepos) addCommandHandler("lp", loadpos) whats wrong? oh, and the error:
  7. you putted it to a client-side script?
  8. local x, y, z = getElementPosition(player) local a = getPlayerRotation(player) x += (10 * math.sin(-a)) y += (10 * math.cos(-a)) createObject (modelid, x, y, z, 0, 0, a) ^ you can create an object in front of the player with this code
  9. ratoc

    god mode

    i tryed to write a god mode script.. my code: function playerDamage(attacker, weapon, bodypart, loss) SetElementHealth(source, 10000) -- 163. line end addEventHandler("onPlayerDamage", root, playerDamage) but i get this error: what do i do wrong? other: i want write a location save/load script, but i dont know how should i store the positions, because it isnt do anything: positions = {} function savepos(player, cmd) local posX, posY, posZ = getElementPosition(player) local rot = getPlayerRotation(player) local name = getClientName(player) positions[name][x] = posX positions[name][y] = posY positions[name][z] = posZ positions[name][rot] = rot end function loadpos(player, cmd) setElementPosition(player, positions[name][x], positions[name][y], positions[name][z]) setPlayerRotation(player, positions[name][rot]) end addCommandHandler("sp", savepos) addCommandHandler("lp", loadpos) Thanks, Ratoc.
×
×
  • Create New...