Jump to content

malu2000

Members
  • Posts

    3
  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

malu2000's Achievements

I ordered some spaghetti with marinara sauce and I got egg noodles and ketchup. I'm an average nobody.

I ordered some spaghetti with marinara sauce and I got egg noodles and ketchup. I'm an average nobody. (2/54)

0

Reputation

  1. malu2000

    Despawn car

    Hello, i've made some changes to the default freeroam script so if a player tries to spawn a car while the player is in the despawn area, it will display a message that you can't spawn a vehicle in the despawn area and the vehicle is despawned.. However i have problems when i try to make if a vehicle enters the despawn area, it will be despawned.. can you help me? Here is the code: local despawnArea = {x = -2280, y = 1694, z = 1522, width = 200, depth = 200, height = 200} function isPlayerInDespawnArea(player) local playerPosition = player.position return playerPosition.x >= despawnArea.x and playerPosition.x <= despawnArea.x + despawnArea.width and playerPosition.y >= despawnArea.y and playerPosition.y <= despawnArea.y + despawnArea.depth and playerPosition.z >= despawnArea.z and playerPosition.z <= despawnArea.z + despawnArea.height end function createSelectedVehicle(leaf) if not leaf then leaf = getSelectedGridListLeaf(wndCreateVehicle, 'vehicles') if not leaf then return end end if isPlayerInDespawnArea(localPlayer) then outputChatBox("You cannot spawn a car in the despawn area.", 255, 0, 0) return end server.giveMeVehicles(leaf.id) end wndCreateVehicle = { 'wnd', text = 'Create vehicle', width = 300, controls = { { 'lst', id='vehicles', width=280, height=340, columns={ {text='Vehicle', attr='name'} }, rows={xml='data/vehicles.xml', attrs={'id', 'name'}}, onitemdoubleclick=createSelectedVehicle, DoubleClickSpamProtected=true, }, {'btn', id='create', onclick=createSelectedVehicle, ClickSpamProtected=true}, {'btn', id='close', closeswindow=true} } } function createVehicleCommand(cmd, ...) local args = {...} if not ... then return errMsg("Enter vehicle model please! Syntax: /cv [vehicle ID/name]") end vehID = getVehicleModelFromName(table.concat(args, " ")) or tonumber(args[1]) and math.floor(tonumber(args[1])) or false if not vehID or not tostring(vehID) or not tonumber(vehID) then return errMsg("Invalid vehicle model!") end if string.len(table.concat(args, " ")) > 25 or tonumber(vehID) and string.len(vehID) > 3 then return errMsg("Invalid vehicle model!") end if vehID and vehID >= 400 and vehID <= 611 then if isPlayerInDespawnArea(localPlayer) then outputChatBox("You cannot spawn a car in the pvp area.", 255, 0, 0) return end server.giveMeVehicles(vehID) else errMsg("Invalid vehicle model!") end end addCommandHandler('createvehicle', createVehicleCommand) addCommandHandler('cv', createVehicleCommand)
  2. Unfortunately, your script has the same problem, doesn't give me the money, but i have another script that works, i'm gonna use that because i think it's more complex. I don't even know why i did this topic because as i said i have another script that works. I guess i was curious why it didn't work.. ?
  3. Hello i'm new here and i need help with a script, if you type /getgift it's says that you have recived $1000 but i didn't.. help me please local lastUsed = {} function giveMoney() local player = source local playerName = getPlayerName(player) local currentTime = getRealTime().timestamp if lastUsed[playerName] then local lastUsedTime = lastUsed[playerName] local timePassed = currentTime - lastUsedTime if timePassed < 86400 then outputChatBox("You can only use this command once per day.", player) return end end givePlayerMoney(player, 1000) outputChatBox("You have received $1000.", player) lastUsed[playerName] = currentTime end addCommandHandler("getgift", giveMoney)
×
×
  • Create New...