
karlis
Members-
Posts
1,314 -
Joined
-
Last visited
Everything posted by karlis
-
other suggest, as explosions is making shakes u can use clientside explosion w/o damage,sound, and hided after screen --clientside! shakeintensity=-1.0 time=100000 function shakescreen() camTargX,camTargY,camTargZ,camPosX,camPosY,CamPosZ=getCameraMatrix() createExplosion(camPosX-(camTargX-camPosX),camPosY-(camTargY-camPosY),camPosZ-(camTargZ-CamPosZ),11,true,shakeintensity,false) --creating explosion without damage,sound, and in back from screen, with shaking effect end setTimer(shakescreen,time,1000)--create it every second for long effect but heres also downsides:it might run fps down since much explosions is created, and it migh not work when cameras matrix target is very away from camera position i believe trigonometrical functions would be much more efficient, but sorry i cant help with them
-
no errors? try this: _root = getRootElement() addEvent("onPlayerFinish",true) addEventHandler("onPlayerFinish",_root, function (rank,time) if not (isGuestAccount (getPlayerAccount (source))) then local playerAccount = getPlayerAccount(source) local playerMoney = getAccountData(playerAccount,"VIPM-Money") if (playerAccount) then local alivePlayer = getAlivePlayers() if (alivePlayer == 1) then outputChatBox("#aa00ff<Script>:#ffffff " .. getPlayerName(source) .. " won 1000$ for 1st!!",_root,255,255,255,true) if playerMoney then money=playerMoney+1000 else money=1000 end setAccountData (playerAccount, "VIPM-Money", money ) end end end end)
-
i say for sure, textures arent in air, they are where they should be in .dff, so problem is in dff
-
i think its prety easy to make own convertor, then just save map file with build in file reading/writing functions
-
did you make that object? by that i mean that collisons(ones that makes obj solid) are really higher than .dff files(whose makes visual object 3D and says where to put textures)
-
_root = getRootElement() addEvent("onPlayerFinish",true) addEventHandler("onPlayerFinish",_root, function (rank,time) if not (isGuestAccount (getPlayerAccount (source))) then local playerAccount = getPlayerAccount(source) local playerMoney = getAccountData(playerAccount,"VIPM-Money") if (playerAccount) then local alivePlayer = getAlivePlayers() if (alivePlayer == 1) then outputChatBox("#aa00ff<Script>:#ffffff " .. getPlayerName(source) .. " won 1000$ for 1st!!",_root,255,255,255,true) setAccountData (playerAccount, "VIPM-Money", playerMoney +1000) end end end end) is easyer and fine too
-
thats 30lines of code, just learn basic scripting and try make it on your own
-
AddStaticVehicle(modelid,x,y,z,samp rotation, color1, color2) to createVehicle ( modelid, x, y, z, math.floor(samprotation/314*36000)/100 )
-
1)your colisons doesn't stick dff bounds property 2)object is transparent from down if u specially don't fill it with texture from down too
-
you still need use addEvent, watch race wiki
-
it would give him weapon
-
use addEvent("onPlayerFinish",true) too
-
if u will destroy parent, you will destroy child too, if you attach some handler on parent, it might work on child too, in gui scripting if you move, change parent, you will change child too.
-
problem is that at beginig noone got that account data, heres it fixed _root = getRootElement() addEventHandler("onPlayerFinish",_root, function (rank,time) if not (isGuestAccount (getPlayerAccount (source))) then local playerAccount = getPlayerAccount(source) local playerMoney = getAccountData(playerAccount,"VIPM-Money") if (playerAccount) then local alivePlayer = getAlivePlayers() if (alivePlayer == 1) then outputChatBox("#aa00ff<Script>:#ffffff " .. getPlayerName(source) .. " won 1000$ for 1st!!",_root,255,255,255,true) setAccountData (playerAccount, "VIPM-Money", playerMoney +1000) end end end end)
-
u need be admin or do it via server console, not client
-
turn server on and then write in console "start editor" and press enter
-
im very sopry, not GetRootElement(), but getRootElement()
-
replace ur "thePlayer" with GetRootElement(), anyway i dont see why u should put my work in quotes, isn't that i wrote some code from zero just to help u enough?
-
i found such hax in race resource: -- This is a hax file to make custom model loading work reliably -- Usage: loadCustomModel(objID, dffFile, txdFile) in the main script body, -- then createObject() in an event handler. Or: loadCustomModel in an event, -- and createObject() in an event that gets triggered later. local preloads = {} local pendingEvents = {} local _addEventHandler = addEventHandler function addEventHandler(event, elem, handler, getPropagated) if event == 'onClientRender' then return _addEventHandler(event, elem, handler, getPropagated) end return _addEventHandler( event, elem, function(...) if not next(preloads) then handler(...) else table.insert(pendingEvents, { fn = handler, source = source, args = { ... } }) end end, getPropagated ) end local function customModelPreloaded() local id = table.find(preloads, 'elem', source) if not id then return end local preload = preloads[id] local txd = engineLoadTXD(preload.txd) engineImportTXD(txd, id) local dff = engineLoadDFF(preload.dff, id) engineReplaceModel(dff, id) removeEventHandler('onClientElementStreamIn', source, customModelPreloaded) destroyElement(source) preloads[id] = nil while not next(preloads) and #pendingEvents > 0 do local event = table.remove(pendingEvents, 1) source = event.source event.fn(unpack(event.args)) end end function loadCustomModel(id, dff, txd) if preloads[id] then return end local x, y, z = getElementPosition(getLocalPlayer()) local elem if id <= 609 then elem = createVehicle(id, x, y, z - 10) else elem = createObject(id, x, y, z - 10) end setCameraTarget(getLocalPlayer()) preloads[id] = { dff = dff, txd = txd, elem = elem } _addEventHandler('onClientElementStreamIn', elem, customModelPreloaded, false) end -- Make sure the preloads are near the player so the onClientElementStreamIn event gets triggered local function checkPreloads() for id,preload in pairs(preloads) do local px, py, pz = getElementPosition(getLocalPlayer()) local ex, ey, ez = getElementPosition(preload.elem) local dist = getDistanceBetweenPoints3D ( px, py, pz, ex, ey, ez ) if( dist > 50 ) then setElementPosition( preload.elem, px, py, pz - 10 ) end end end setTimer(checkPreloads, 500, 10 ) what does it exactly do, how to use it propertly(i failed), why its not specified in meta, whats is his idea to do, could i make it much simpler and smaller if ill attach lines to general script, not making it as new scriptfile?
-
better /base * and /arena * or /newbase, /newarena
-
basicly u need integrate that "isdownloading" function and replacing onClientPlayerJoin with onClientPlayerSpawn edit:fixed my code litle
-
i made this for separated use, u need run it on own, but i didnt test it so i give no grantee it will work property
-
would be better if you put script in [/code] tags [code=lua]