Hello, as I am newbie in Lua scripting then I am coming here with dumb questions.. heh
So I hope somebody will help me.
I downloaded this free resource - https://community.multitheftauto.com/ind ... ls&id=6359
And it works just great, but I wanted to upgrade it a bit, since it's Roleplay server.
I want player to wait for car washing, for about 30 secounds. Also I need that server takes 50$ from his money.
And If he doesnt have that much money, server tells to earn some cash and to come back
It's really easy and for those who dont want to download the code, here it is -
Oah and if it's possible then add some time when the car gets dirty otherwise it becames dirty after 3 or 5minutes after car wash. That 's too quick.
server.lua
function onserver ( )
fadeCamera ( source, false, 2.5, 0, 0, 0 )
setTimer ( fadeCamera, 2500, 1, source, true, 2.5)
outputChatBox ( "Your Welcome in Wash Car", source, 0, 255, 255, true )
end
addEvent("onserver",true)
addEventHandler("onserver", root, onserver)
client.lua
myShader = dxCreateShader( "texture.fx" )
local x,y,z = 1911.2,-1776,12
local Marker = createMarker ( x, y, z, "cylinder", 5, 255, 0, 0, 150 )
local blip = exports.customblips:createCustomBlip ( x, y, 20, 20, "icon.png" )
local gate = createObject(968, 1915.5, -1771.80, 13, 0, -90)
local gate1 = createObject(968, 1915.5, -1780.85, 16, 0, -90)
function cleancar (hitPlayer, matchingDimension)
local theVehicle = getPlayerOccupiedVehicle ( hitPlayer )
if ( theVehicle ) then
engineApplyShaderToWorldTexture( myShader, "vehiclegrunge256", theVehicle )
engineApplyShaderToWorldTexture( myShader, "?emap*", theVehicle )
triggerServerEvent ("onserver", hitPlayer, onserver)
moveObject(gate, 9000, 1915.5, -1771.80, 16)
moveObject(gate1, 2000, 1915.5, -1780.85, 13)
end
end
addEventHandler("onClientMarkerHit", Marker, cleancar)
function moveBack()
moveObject(gate, 2000, 1915.5, -1771.80, 13)
moveObject(gate1, 9000, 1915.5, -1780.85, 16)
end
addEventHandler("onClientMarkerLeave", Marker, moveBack)