-
Posts
1,050 -
Joined
-
Last visited
Everything posted by ViRuZGamiing
-
setVehicleLocked setElementFrozen -- Optional setVehicleFuelTankExplodable setVehicleDamageProof use what you need, not everyting is neccesarly needed. BTW I do have a Car-Dealership script in Wang Cars (link in signature). Regards ViRuZ
-
My guess is removing the aim for sniper and adding your own system. setWeaponProperty would be able to cancel the aiming.
-
theMusic needs to be tostring(theMusic)
-
local vehicle = { } addEvent ( "spawnEuro", true ) addEventHandler ("spawnEuro", root, function ( px, py, pz ) if isElement ( vehicle [source] ) then outputChatBox ( "Error - You already have a flash.", source, 255, 0, 0 ) return end vehicle [source] = createVehicle ( 565, px + 2, py + 2, pz ) outputChatBox ( "Flash was created successfully.", source, 0, 255, 0 ) end end ) 1 end to much, you already did return end
-
give the function another name then cancelEvent
-
addEvent("lockUnlockOutsideVehicle", true) addEventHandler("lockUnlockOutsideVehicle", getRootElement(), lockUnlockOutside) what is the point of this? are you triggering it from client side? because if so you are triggering from Client the server and back to client.
-
Read this on another post
-
Couldn't the problem be that theMusic isn't to string so it gives now as path; theMusic".mp3" which actually has to be "theMusic.mp3". tostring(theMusic)..".mp3"
-
That's because the is played Client Side. triggerClientEvent(source, "onLock", root) -- arg1. Source of the event is source, arg2. "onLock" the event, arg3. sent to? All a.k.a root.
-
give a name to your car. createVehicle (565, px+2, py+2, pz) Like this flash = createVehicle (565, px+2, py+2, pz) if (flash) then outputChatBox ("Flash was created successfully.", client, 255, 255, 255) end if you are not using it outside then function the declare it as a local else it will be global. local flash = createVehicle (565, px+2, py+2, pz)
-
RELEASE means for something to become available not neccesarly free, it can be under any condition.
-
Try starting from the beginning read the Wiki for the starting tutorial. Make easy scripts first, Hello World by example. Then get to know some Events and Functions. After this you can write your code and we will help repair if neccesary but we do not create from scratch.
-
addEventHandler ( "onClientPlayerDamage", getRootElement(), cancelEvent ) Should work aswell; addEventHandler ( "onClientPlayerDamage", getLocalPlayer(), cancelEvent ) It's just the event name as Anubhav mentioned.
-
An server side event trigger by client side isn't able to use thePlayer, i've occured this error many times. So the problem is the unpack, I should remove it.
-
You'll need to store and check name too so it doesn't make the same player count for 1+ visits.
-
localPlayer = It comes from Client Side as an trigger argument and works fine And yes I do have getVehicleOccupant but I added it after I uploaded code. (only thing changed) The problems is in the tables mainly. I don't understand them 100%
-
Other problem showed up; [17:42:07] WARNING: train-job\server.lua:52: Bad argument @ 'getVehicleOccupant' [Expected vehicle at argument 1, got player] [17:42:07] ERROR: train-job\server.lua:61: bad argument #1 to 'unpack' (table expected, got userdata) local trainData = {} local trainTable = { { --TRAIN ["create"]={538, -1947.7, 140.8, 27.4}, ["money"]=1000, ["spawn"]={602, -1917.5, 296.20001, 41, 0, 0, -180}, ["marker"]={1424.4, 2634.3, 9.8}, }, } function mapTrain () createObject(970, -1958.4, 135.5, 27.2) createObject(970, -1958.4, 140.3, 27.2) createObject(970, -1956.3, 137.9, 27.2, 0, 0, 90) trainGuy = createPed (253, -1958.2, 135.89999, 27.7) setElementRotation(trainGuy, 0, 0, 43) end addEventHandler ( "onResourceStart", resourceRoot, mapTrain ) function startTrainJob (localPlayer) local sv = trainTable for i=1,#sv do local trainTable = sv[i] local vehicle = createVehicle (trainTable["create"][1], trainTable["create"][2], trainTable["create"][3], trainTable["create"][4],trainTable["create"][5], trainTable["create"][6],trainTable["create"][7]) setVehicleLocked (vehicle, true) setTrainDirection (vehicle, true) local finishMarker = createMarker (trainTable["marker"][1], trainTable["marker"][2], trainTable["marker"][3], "checkpoint", 6, 255, 150, 0, 255, localPlayer) -- Size 6 addEventHandler("onMarkerHit", finishMarker, getPaid) local finishBlip = createBlip (trainTable["marker"][1], trainTable["marker"][2], trainTable["marker"][3], 56, 2, 255, 0, 0, 255, 0, 10000, localPlayer) setTrainDerailable(vehicle, false) trainData[vehicle] = { ["money"]=trainTable["money"], ["spawn"]=trainTable["spawn"], ["marker"]=trainTable["marker"], ["train"] = vehicle, ["blip"] = finishBlip, ["finishmarker"] = finishMarker } warpPedIntoVehicle (localPlayer, vehicle) end end addEvent("startTrainJob", true) addEventHandler("startTrainJob", root, startTrainJob, localPlayer) function getPaid (thePlayer) local data = trainData[source] if (data) then outputConsole("Data got!") local price = data["money"] local paycheck = givePlayerMoney (thePlayer, price) local sv = trainTable for i=1,#sv do local trainTable = sv[i] destroyElement (unpack(trainTable["finishmarker"])) destroyElement (unpack(trainTable["blip"])) destroyElement (unpack(trainTable["train"])) local spawn = data["spawn"] setElementPosition(thePlayer, unpack(data["spawn"])) end end end
-
You should look through the table
-
addEventHandler("onMarkerHit", finishMarker, getPaid) Line 40, finishMarker not found
-
Hi guys, as the title says how can I get the marker created in a function to work as event handler. function startTrainJob (localPlayer) local sv = trainTable for i=1,#sv do local trainTable = sv[i] local vehicle = createVehicle (trainTable["create"][1], trainTable["create"][2], trainTable["create"][3], trainTable["create"][4],trainTable["create"][5], trainTable["create"][6],trainTable["create"][7]) setVehicleLocked (vehicle, true) setTrainDirection (vehicle, true) local finishMarker = createMarker (trainTable["marker"][1], trainTable["marker"][2], trainTable["marker"][3], "checkpoint", 6, 255, 150, 0, 255, localPlayer) -- Size 6 local finishBlip = createBlip (trainTable["marker"][1], trainTable["marker"][2], trainTable["marker"][3], 56, 2, 255, 0, 0, 255, 0, 10000, localPlayer) setTrainDerailable(vehicle, false) trainData[vehicle] = { ["money"]=trainTable["money"], ["spawn"]=trainTable["spawn"], ["marker"]=trainTable["marker"] } trainTable["train"] = vehicle trainTable["blip"] = finishBlip trainTable["finishmarker"] = finishMarker warpPedIntoVehicle (localPlayer, vehicle) end end addEvent("startTrainJob", true) addEventHandler("startTrainJob", root, startTrainJob, localPlayer) function getPaid (thePlayer) if data then local price = data["money"] givePlayerMoney (thePlayer, price) destroyElement (unpack(trainTable["finishmarker"])) destroyElement (unpack(trainTable["blip"])) destroyElement (unpack(trainTable["train"])) local spawn = data["spawn"] setElementPosition(thePlayer, unpack(data["spawn"])) end end addEventHandler("onMarkerHit", finishMarker, getPaid) No error's except; expected element at arg. 2, got nil but that's quite normal as it not created yet. I've also tried to place the event handler in the function but that didn't work. Regards ViRuZ
-
https://wiki.multitheftauto.com/wiki/GetPlayerIP
-
If I may suggest, set a text next to the buttons says that it's a button for the weapon and one for the ammo. Not everyone reads the description but they just install the script.
-
I'm sure this is a quite unique script idea. I'm a fan of it although as said before I'm not really like the graphics, apart from that you've said it's a W.I.P so I understand it's not that great looking atm. Some suggestions; • Inventory System • Drops from A.I's • XP and Leveling • Skill points every level to improve your powers. • IF possible maybe insert some medieval animals/vehicles such as horse(s), ... • Party System • Guild System Pretty much look at a casual MMORPG Hoping to see improvements later on and it'll be great, Regards Viruz