Jump to content

CapY

Members
  • Posts

    1,647
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by CapY

  1. CapY

    Sv . static

    In client , Here: glp = getLocalPlayer() notallowed = {[432] = true, [538] = true, [569] = true, [590] = true, [537] = true, [449] = true} spaces = {["Police Maverick"] = true, ["Mountain Bike"] = true, ["Pizza Boy"] = true, ["Utility Van"] = true, ["Police Car (Los Santos)"] = true, ["Police Car (San Fierro)"] = true, ["Police Ranger"] = true, ["FBI Rancher"] = true, ["FBI Truck"] = true, ["Fire Truck"] = true, ["Fire Truck (Ladder)"] = true, ["Police Car (Las Venturas)"] = true, ["Black Boxville"] = true, ["Linerunner (From 'Tanker Commando')"] = true, ["Mr. Whoopee"] = true, ["Cement Truck"] = true, ["Combine Harvester"] = true, ["Berkley's RC Van"] = true, ["Damaged Sadler"] = true, ["News Van"] = true, ["RC Bandit"] = true, ["RC Baron"] = true, ["RC Goblin"] = true, ["RC Raider"] = true, ["RC Tiger"] = true, ["BF Injection"] = true, ["Bloodring Banger"] = true, ["Monster 2"] = true, ["Super GT"] = true, ["Hotring Racer"] = true, ["Hotring Racer 2"] = true, ["Hotring Racer 3"] = true, ["Rancher (From 'Lure')"] = true, ["RC Cam (flower pot)"] = true, ["News Chopper"] = true } function isNumber(n) return tonumber(n) ~= nil end addCommandHandler("sv", function(cmd, carName, ...) if (glp and isElement(glp) and getElementType(glp) == "player") then if (not isTimer(antiSpam)) then if (isPlayerDead(glp)) then return end local px, py, pz = getElementPosition(glp) if (carName == nil) then msg("No vehicle specified") elseif not isNumber(carName) and (notallowed[getVehicleModelFromName(tostring(carName))]) then msg("Vehicle not allowed") elseif isNumber(carName) and ((notallowed[tonumber(carName)]) or (notallowed[tonumber(math.floor(carName))])) then msg("Vehicle not allowed") elseif (not getVehicleModelFromName(tostring(carName and ...)) and not isNumber(carName) and spaces[tostring(carName)] == false and not tostring(carName) == "none") then msg("Invalid vehicle name '" .. carName .. "'") elseif (getElementInterior(glp) > 0) then elseif (not isPedInVehicle(glp)) then if (isNumber(carName) and tonumber(carName) < 400 or isNumber(carName) and tonumber(carName) > 610) then cancelEvent() msg("Invalid vehicle " .. carName .. "'") else triggerServerEvent("create", glp, glp, px, py, pz, arg2, carName, ...) end elseif (isPedInVehicle(glp)) then if (isNumber(carName) and tonumber(carName) < 400 or isNumber(carName) and tonumber(carName) > 610) then cancelEvent() msg("Invalid vehicle '" .. carName .. "'") else triggerServerEvent("change", glp, glp, cmd, arg2, carName, ...) end end antiSpam = setTimer(function() end, 70, 1) else end end end ) function msg(err) outputChatBox(err,255,0,0) end
  2. CapY

    Sv . static

    Why i get error at sv\server.statc:88: Bad argument @ 'setTimer' Server: function isNumber(n) return tonumber(n) ~= nil end addEvent("create", true) addEventHandler("create", root, function(glp, px, py, pz, arg2, ...) if (isPedDead(glp)) then return end if (isPedInVehicle(glp)) then return exitVehicle(getPedOccupiedVehicle(glp)) end local _Name = table.concat({...}, " ") if (_Name == "none") then return end if not isNumber(_Name) and not getVehicleModelFromName(_Name) then outputChatBox("Invalid vehicle '".. _Name .."'",glp,255,0,0) return end if isNumber(_Name) and not getVehicleNameFromModel(_Name) then outputChatBox("Invalid vehicle '".. _Name .."'",glp,255,0,0) return end for _,v in ipairs(getElementsByType("vehicle")) do if (getElementData(v, "svowner") == getPlayerName(glp)) then destroyElement(v) end end local gID = getVehicleModelFromName(_Name) local nV = createVehicle(gID or tonumber(gID) or ..., px, py, pz, 0, 0, 0) local gpv = getPedOccupiedVehicle(glp) local vehOcc = isPedInVehicle(glp) warpPedIntoVehicle(glp, nV) local gpv = getPedOccupiedVehicle(glp) local rz = getPedRotation(glp) setVehicleRotation(gpv, 0, 0, rz) setElementData(nV, "svowner", getPlayerName(glp), false) end ) addEvent("change", true) addEventHandler("change", root, function(glp, cmd, arg2, ...) local _Name = table.concat({...}, " ") local gID = getVehicleModelFromName(_Name) local gpv = getPedOccupiedVehicle(glp) if (getPedOccupiedVehicleSeat(glp) == 0) then if (_Name == "none") then return destroyElement(gpv) end if not isNumber(_Name) and not getVehicleModelFromName(_Name) then outputChatBox("Invalid vehicle '".. _Name .."'",glp,255,0,0) return end if isNumber(_Name) and not getVehicleNameFromModel(_Name) then outputChatBox("Invalid vehicle '".. _Name .."'",glp,255,0,0) return end setElementModel(gpv, gID or tonumber(gID) or ...) setElementData(gpv, "svowner", getPlayerName(glp), false) if getElementData(glp, "fighting") then return end fixVehicle(gpv) end end ) function none(source, cmd, arg) if (arg == "none" and isTimer(onStart)) then if (isElement(getPedOccupiedVehicle(source))) then destroyElement(getPedOccupiedVehicle(source)) end if (isTimer(onStart)) then killTimer(onStart) end return end end addCommandHandler("sv", none) function destroyVehicle(vehicle) local check = false for _,gPlayer in ipairs(getElementsByType("player")) do if (getPedOccupiedVehicle(gPlayer) == vehicle) then if (getPedOccupiedVehicleSeat(gPlayer) == 0) then check = true end end end if (isElement(vehicle) and getElementType(vehicle) == "vehicle" and check == false) then destroyElement(vehicle) end end addEventHandler("onVehicleStartExit", root, function(_, seat) if (seat > 0) then removeEventHandler("onPlayerVehicleExit", root, exitVehicle) else removeEventHandler("onPlayerVehicleExit", root, exitVehicle) addEventHandler("onPlayerVehicleExit", root, exitVehicle) end end ) addEventHandler("onVehicleStartEnter", root, function(glp, _, _, door) setElementData(source, "svowner", getPlayerName(glp), false) if (getVehicleType" class="kw2">getVehicleType" class="kw2">getVehicleType(source) == "Train") then setTrainDerailable(source, false) end if (door == 0 and getPlayerName(getVehicleOccupant(source, 0)) == getPlayerName(glp) and not isVehicleLocked(source)) then onStart = setTimer(svNone, 50, 0) end end ) addEventHandler("onPlayerQuit", root, function() for _,v in ipairs(getElementsByType("vehicle")) do if (getElementData(v, "svowner") == getPlayerName(source)) then destroyElement(v) end end end ) addEventHandler("onPlayerWasted", root, function() for _,v in ipairs(getElementsByType("vehicle")) do if (getElementData(v, "svowner") == getPlayerName(source)) then exitVehicle(v) end end end ) function exitVehicle(vehicle) if (isElement(vehicle) and getElementType(vehicle) == "vehicle") then setTimer(destroyVehicle, 90000, 1, vehicle) end end addEventHandler("onPlayerVehicleStartExit", root, exitVehicle) Anybody can help me with this ?
  3. CapY

    JSave Resource

    not working .
  4. Burgerman is that server still exists ?
  5. CapY

    CJ bug.

    Reinstall MTA .
  6. CapY

    vehramps

    Can you start that ? --Do something with the "mode" and "returnedData" here
  7. CapY

    vehramps

    Still the same error message on debug3 showing Client : local gRoot = getRootElement() local g_Root = gRoot local gMe = getLocalPlayer() local gResourceRoot = getResourceRootElement(getThisResource()) local theRamps = {} addEvent ( "vehicleramps_SpawnRamp", true ) addEventHandler ( "vehicleramps_SpawnRamp", gRoot, function ( mode, returnedData ) --outputChatBox ( "A RAMP WAS MADE BY " .. getPlayerName(source) ) if ( theRamps[source] ) then --outputChatBox ( "Destroying the ramps table" ) destroyElement(theRamps[source]) theRamps[source] = false end local parentUnit = createElement("myRamps" .. getPlayerID(source)) theRamps[source] = parentUnit if ( mode == "1" ) then if ( #returnedData == 6 ) then spawnRamp ( source, returnedData[1], returnedData[2], returnedData[3], returnedData[4], returnedData[5], returnedData[6], 1632 ) end elseif ( mode == "1s" ) then spawnRamp ( source, returnedData[1], returnedData[2], returnedData[3], 0, 0, 0, 1632 ) spawnRamp ( source, returnedData[4], returnedData[5], returnedData[6], 0, 0, 90, 1632 ) spawnRamp ( source, returnedData[7], returnedData[8], returnedData[9], 0, 0, 180, 1632 ) spawnRamp ( source, returnedData[10], returnedData[11], returnedData[12], 0, 0, 270, 1632 ) elseif ( mode == "2" ) then if ( #returnedData == 9 ) then spawnRamp ( source, returnedData[1], returnedData[2], returnedData[3], returnedData[7], returnedData[8], returnedData[9], 1632 ) spawnRamp ( source, returnedData[4], returnedData[5], returnedData[6], returnedData[7], returnedData[8], returnedData[9], 1632 ) end elseif ( mode == "3" ) then if ( #returnedData == 9 ) then local thisRamp = spawnRamp ( source, returnedData[1], returnedData[2], returnedData[3], returnedData[7], returnedData[8], returnedData[9], 1632 ) local rx, ry, rz = getElementRotation ( thisRamp ) spawnRamp ( source, returnedData[4], returnedData[5], returnedData[6], rx + 22, returnedData[8], returnedData[9], 1632 ) end elseif ( mode == "5" ) then if ( #returnedData == 6 ) then spawnRamp ( source, returnedData[1], returnedData[2], returnedData[3], 0, 0, returnedData[6], 13592 ) end elseif ( mode == "6" ) then if ( #returnedData == 6 ) then spawnRamp ( source, returnedData[1], returnedData[2], returnedData[3], 0, 0, returnedData[6], 13641 ) end elseif ( mode == "custom" ) then if ( #returnedData == 7 ) then spawnRamp ( source, returnedData[1], returnedData[2], returnedData[3], 0, 0, returnedData[6], returnedData[7] ) end end end ) addEventHandler ( "onClientResourceStart", gResourceRoot, function(name) --outputChatBox ( "Client Script Started" ) outputChatBox ( "Client Script Started" ) bindKey ( "1", "down", workOutRamps, 1 ) bindKey ( "2", "down", workOutRamps, 2 ) bindKey ( "3", "down", workOutRamps, 3 ) bindKey ( "5", "down", workOutRamps, 5 ) bindKey ( "6", "down", workOutRamps, 6 ) end) function workOutRamps(mode) local playerVehicle = getPedOccupiedVehicle(getLocalPlayer()) if ( playerVehicle ) then local PV = getVehicleController(playerVehicle) if ( PV ~= getLocalPlayer() ) then outputChatBox ( "Your not the driver!" ) return end if ( theRamps[gMe] ) then --outputChatBox ( "Destroying the ramps table" ) destroyElement(theRamps[gMe]) theRamps[gMe] = false end local parentUnit = createElement("myRamps" .. getPlayerID(gMe)) theRamps[gMe] = parentUnit local distance = 20 local returnedData = {} local vehX, vehY, vZ = getElementPosition(playerVehicle) local rotX, rotY, rotZ = getElementRotation(playerVehicle) if ( mode == "1" ) then if ( getKeyState("lshift") ) then local ramp1X, ramp1Y = vehX + distance*math.cos(math.rad(rotZ+90)), vehY + distance*math.sin(math.rad(rotZ+130)) local ramp1Z = getGroundForCoords(ramp1X, ramp1Y, vZ) local ramp2X, ramp2Y = ramp1X+5.5, ramp1Y --vehX + distance*math.cos(math.rad(rotZ+74.5)), vehY + distance*math.sin(math.rad(rotZ+90)) local ramp2Z = ramp1Z --getGroundForCoords(ramp2X, ramp2Y, vZ) local ramp3X, ramp3Y = ramp1X, ramp1Y+5.5 --vehX + distance*math.cos(math.rad(rotZ+90)), vehY + distance*math.sin(math.rad(rotZ+90)) + 5.5 local ramp3Z = ramp1Z --getGroundForCoords(ramp3X, ramp3Y, vZ) local ramp4X, ramp4Y = ramp1X-5.5, ramp1Y --vehX + distance*math.cos(math.rad(rotZ+90)) - 5.5, vehY + distance*math.sin(math.rad(rotZ+90)) local ramp4Z = ramp1Z --getGroundForCoords(ramp4X, ramp4Y, vZ) ramp1Y = ramp1Y - 5.5 returnedData[1] = ramp1X returnedData[2] = ramp1Y returnedData[3] = ramp1Z + 1 returnedData[4] = ramp2X returnedData[5] = ramp2Y returnedData[6] = ramp2Z + 1 returnedData[7] = ramp3X returnedData[8] = ramp3Y returnedData[9] = ramp3Z + 1 returnedData[10] = ramp4X returnedData[11] = ramp4Y returnedData[12] = ramp4Z + 1 spawnRamp ( gMe, returnedData[1], returnedData[2], returnedData[3], 0, 0, 0, 1632 ) spawnRamp ( gMe, returnedData[4], returnedData[5], returnedData[6], 0, 0, 90, 1632 ) spawnRamp ( gMe, returnedData[7], returnedData[8], returnedData[9], 0, 0, 180, 1632 ) spawnRamp ( gMe, returnedData[10], returnedData[11], returnedData[12], 0, 0, 270, 1632 ) triggerServerEvent ( "vehicleramps_PlayerSpawnedRamp", getLocalPlayer(), mode .. "s", returnedData ) setElementPosition ( playerVehicle, ramp1X, ramp1Y, ramp1Z+3 ) setElementRotation ( playerVehicle, 0, 0, 0 ) setElementVelocity ( playerVehicle, 0, 0, 0 ) setElementVelocity ( playerVehicle, 0, 0, 0 ) else local ramp1X, ramp1Y = vehX + distance*math.cos(math.rad(rotZ+90)), vehY + distance*math.sin(math.rad(rotZ+90)) local ramp1Z = getGroundForCoords(ramp1X, ramp1Y, vZ) if ( doneOnce ) then if ( lastx == ramp1X ) then if ( lasty == ramp1Y ) then ramp1Z = ramp1Z - 0.78579690039 end else doneOnce = false end else doneOnce = true end lastx = ramp1X lasty = ramp1Y returnedData[1] = ramp1X returnedData[2] = ramp1Y returnedData[3] = ramp1Z + 1 returnedData[4] = rotX returnedData[5] = rotY returnedData[6] = rotZ spawnRamp ( gMe, returnedData[1], returnedData[2], returnedData[3], returnedData[4], returnedData[5], returnedData[6], 1632 ) triggerServerEvent ( "vehicleramps_PlayerSpawnedRamp", getLocalPlayer(), mode, returnedData ) end elseif ( mode == "2" ) then local ramp1X, ramp1Y = vehX + distance*math.cos(math.rad(rotZ+83)), vehY + distance*math.sin(math.rad(rotZ+83)) local ramp2X, ramp2Y = vehX + distance*math.cos(math.rad(rotZ+95)), vehY + distance*math.sin(math.rad(rotZ+95)) local ramp1Z = getGroundForCoords(ramp1X, ramp1Y, vZ) local ramp2Z = getGroundForCoords(ramp1X, ramp1Y, vZ) if ( doneOnce ) then if ( lastx == ramp1X ) then if ( lasty == ramp1Y ) then ramp1Z = ramp1Z - 0.78579690039 end else doneOnce = false end else doneOnce = true end lastx = ramp1X lasty = ramp1Y returnedData[1] = ramp1X returnedData[2] = ramp1Y returnedData[3] = ramp1Z + 1 returnedData[4] = ramp2X returnedData[5] = ramp2Y returnedData[6] = ramp2Z + 1 returnedData[7] = rotX returnedData[8] = rotY returnedData[9] = rotZ spawnRamp ( gMe, returnedData[1], returnedData[2], returnedData[3], returnedData[7], returnedData[8], returnedData[9], 1632 ) spawnRamp ( gMe, returnedData[4], returnedData[5], returnedData[6], returnedData[7], returnedData[8], returnedData[9], 1632 ) triggerServerEvent ( "vehicleramps_PlayerSpawnedRamp", getLocalPlayer(), mode, returnedData ) elseif ( mode == "3" ) then local ramp1X, ramp1Y = vehX + distance*math.cos(math.rad(rotZ+90)), vehY + distance*math.sin(math.rad(rotZ+90)) local ramp2X, ramp2Y = vehX + (distance+5)*math.cos(math.rad(rotZ+90)), vehY + (distance+5)*math.sin(math.rad(rotZ+90)) local ramp1Z = getGroundForCoords(ramp1X, ramp1Y, vZ) local ramp2Z = getGroundForCoords(ramp1X, ramp1Y, vZ) if ( doneOnce ) then if ( lastx == ramp1X ) then if ( lasty == ramp1Y ) then ramp1Z = ramp1Z - 0.78579690039 end else doneOnce = false end else doneOnce = true end lastx = ramp1X lasty = ramp1Y returnedData[1] = ramp1X returnedData[2] = ramp1Y returnedData[3] = ramp1Z + 1 returnedData[4] = ramp2X returnedData[5] = ramp2Y returnedData[6] = ramp2Z + 4.5 returnedData[7] = rotX returnedData[8] = rotY returnedData[9] = rotZ local thisRamp = spawnRamp ( gMe, returnedData[1], returnedData[2], returnedData[3], returnedData[7], returnedData[8], returnedData[9], 1632 ) local rx, ry, rz = getElementRotation ( thisRamp ) spawnRamp ( gMe, returnedData[4], returnedData[5], returnedData[6], rx + 22, returnedData[8], returnedData[9], 1632 ) triggerServerEvent ( "vehicleramps_PlayerSpawnedRamp", getLocalPlayer(), mode, returnedData ) elseif ( mode == "5" ) then local ramp1X, ramp1Y = vehX + distance*math.cos(math.rad(rotZ+90)), vehY + distance*math.sin(math.rad(rotZ+115)) local ramp1Z = getGroundForCoords(ramp1X, ramp1Y, vZ) if ( doneOnce ) then if ( lastx == ramp1X ) then if ( lasty == ramp1Y ) then ramp1Z = ramp1Z - 0.78579690039 end else doneOnce = false end else doneOnce = true end lastx = ramp1X lasty = ramp1Y returnedData[1] = ramp1X returnedData[2] = ramp1Y returnedData[3] = ramp1Z + 9 returnedData[4] = rotX returnedData[5] = rotY returnedData[6] = rotZ - 90 spawnRamp ( gMe, returnedData[1], returnedData[2], returnedData[3], 0, 0, returnedData[6], 13592 ) triggerServerEvent ( "vehicleramps_PlayerSpawnedRamp", getLocalPlayer(), mode, returnedData ) elseif ( mode == "6" ) then local ramp1X, ramp1Y = vehX + distance*math.cos(math.rad(rotZ+90)), vehY + distance*math.sin(math.rad(rotZ+90)) local ramp1Z = getGroundForCoords(ramp1X, ramp1Y, vZ) if ( doneOnce ) then if ( lastx == ramp1X ) then if ( lasty == ramp1Y ) then ramp1Z = ramp1Z - 0.78579690039 end else doneOnce = false
  8. CapY

    Creating GUI

    Yeah , that would be good .
  9. CapY

    CJ bug.

    viewtopic.php?f=91&t=27027
  10. I want unicorn. If you want scripters you will need to pay.
  11. CapY

    vehramps

    Debugscript : ERROR:Client triggered serverside event veicleramps_PlayerSpawnedRamp, but event is not added serverside IDK how to add that event .
  12. CapY

    Creating GUI

    Or you can start with wiki : https://wiki.multitheftauto.com/wiki/Int ... ng_the_GUI
  13. CapY

    vehramps

    It is already triggered , but there is no server-side script
  14. It's good idea . P.S. Blueman , your avatar pisses me alot, i keep hitting my monitor every 5 secs
  15. CapY

    vehramps

    Can anyone create a server side for this community resource called vehramp ? https://community.multitheftauto.com/ind ... ails&id=92 It's stupid to spawn ramps and others can't see it , people will be think they are cheaters who can fly with vehicles ...
  16. Yep , it's pretty awesome !
  17. Tommorow i think .
  18. Got visual c++ crash 3 times .
  19. Next time , there will be good to have more slots than 140 .
  20. CapY

    Mysql

    yep
  21. CapY

    Mysql

    yep
  22. CapY

    Mysql

    Host, user, password , database...
  23. I can get in now , but Cannonballs system still dont work . http://imageshack.us/f/153/mysqlerror.png/
  24. CapY

    Mysql

    http://imageshack.us/f/153/mysqlerror.png/ I has typed all informations in cfg file and this show up .
  25. CapY

    Gui.lua

    Read posts again , what else to say
×
×
  • Create New...