ozulus
Members-
Posts
131 -
Joined
-
Last visited
Everything posted by ozulus
-
Hi guys i have a problem about string. For example i have a word which called "Furkan Ozulus" I want to convert letters to underline like that "_ _ _ _ _ _ _ _ _ _ _ _" Thanks.
-
Well, check this out. https://forum.multitheftauto.com/viewtop ... 06#p351160
-
You should use that function onInsuredVehicleDamage(loss) -- The source of this event is the vehicle that got damaged. local dbid = tonumber(getElementData(source, "dbid")) if (dbid) then local thePlayer = getVehicleOwnerByDBid(dbid) -- why you used that idk if (getElementData(source, "insured") == 1) then if getElementHealth(source) < 250 then -- if the health gets to 250 the vehicle gets on fire fixVehicle(source) end end end end addEventHandler("onVehicleDamage", getRootElement(), onInsuredVehicleDamage)
-
function enableGhostMode(player) setElementData ( player, "SpawnProtectionEnabled", true ) setElementData ( player, "GodmodeEnabled", true ) setElementAlpha ( player, 150 ) toggleControl ( player, "fire", false ) toggleControl ( player, "next_weapon", false ) toggleControl ( player, "previous_weapon", false ) end function disableGhostMode(player) setElementData ( player, "GodmodeEnabled", false ) setElementData ( player, "SpawnProtectionEnabled", false ) setElementAlpha ( player, 255 ) toggleControl ( player, "fire", true ) toggleControl ( player, "next_weapon", true ) toggleControl ( player, "previous_weapon", true ) end Usage: addEvent ("Hospital", true) addEventHandler ("Hospital", root, function ( data ) spawnPlayer (source, data[2], data[3], data[4]+2, data[8], data[9], 0, 0) setCameraTarget (source,source) enableGhostMode(source) -- like that setTimer ( function ( source ) disableGhostMode(source) -- like that end, 10000, 1, source ) end)
-
You can use onElementDataChange for check data. function outputChange(dataName,oldValue) if getElementType(source) == "player" and dataName == "isSpawnProtectionEnabled" then local ghostmode = getElementData(source,"isSpawnProtectionEnabled") if ghostmode == false then -- do nothing else -- add your own function here ex: disableGhostMode(source) -- use setTimer in disable ghost mode function end end end addEventHandler("onElementDataChange",getRootElement(),outputChange) if you want you can make your own function it would be better to use Sorry for my bad English, i hope you'll understand
-
Use setTimer. Just like that: addEvent("spawn",true) addEventHandler("spawn",root, function (player, ID, marker) if isElement(Vehicles[player]) then destroyElement(Vehicles[player]) end local x, y, z = getElementPosition(marker) Vehicles[player] = createVehicle(ID, x, y, z+3, 0, 0, markers[marker][3]) warpPedIntoVehicle(player, Vehicles[player]) setElementData(Vehicles[player],"allowedRoles",markers[marker][1]) setElementData(Vehicles[player],"allowedData",markers[marker][4]) if (Vehicles[player] and getElementData ( player, "isSpawnProtectionEnabled" ) == true) then setElementData ( player, "isSpawnProtectionEnabled", true ) setElementData ( player, "isGodmodeEnabled", true ) setElementAlpha ( Vehicles[player], 150 ) toggleControl ( player, "fire", false ) toggleControl ( player, "next_weapon", false ) toggleControl ( player, "previous_weapon", false ) setTimer( function(player) setElementData ( player, "isGodmodeEnabled", false ) setElementData ( player, "isSpawnProtectionEnabled", false ) setElementAlpha ( Vehicles[player], 255 ) toggleControl ( player, "fire", true ) toggleControl ( player, "next_weapon", true ) toggleControl ( player, "previous_weapon", true ) end,10000,1,player) else setElementData ( player, "isGodmodeEnabled", false ) setElementData ( player, "isSpawnProtectionEnabled", false ) setElementAlpha ( Vehicles[player], 255 ) toggleControl ( player, "fire", true ) toggleControl ( player, "next_weapon", true ) toggleControl ( player, "previous_weapon", true ) end end)
-
Not sure but should be like that function spawnButton(button) if button == "left" then local targetplayer = guiGetText(player) local targetcolour1 = guiGetText(colour1) local targetcolour2 = guiGetText(colour2) local vehiclemodel = guiGridListGetItemText(vehicleMenuCarsList,guiGridListGetSelectedItem(vehicleMenuCarsList),1) if targetplayer == "Player" or "" then targetplayer = source -- i wrote source instead of thePlayer because thePlayer isnt defined else targetplayer = getPlayerFromPartialName(targetplayer) end if targetcolour1 == "Colour 1" or "" then targetcolour1 = 1 end if targetcolour2 == "Colour 2" or "" then targetcolour2 = 1 end if vehiclemodel == -1 then guiSetVisible(vehicleMenuWindow,false) showCursor(false) outputChatBox("You did not select a vehicle to spawn.",targetplayer) end local xs,ys,zs = getElementPosition(targetplayer) local vehicleid = createVehicle(vehiclemodel, xs, ys, zs) setVehicleColor(vehicleid, targetcolour1, targetcolour2, 0, 0) guiSetVisible(vehicleMenuWindow,false) showCursor(false) outputChatBox("You have spawned a vehicle.",targetplayer) end end function getPlayerFromPartialName(name) local name = name and name:gsub("#%x%x%x%x%x%x", ""):lower() or nil if name then for _, player in ipairs(getElementsByType("player")) do local name_ = getPlayerName(player):gsub("#%x%x%x%x%x%x", ""):lower() if name_:find(name, 1, true) then return player end end end end
-
Omg sorry double post
-
Try this. Client: local shootingAllowed = true function playerSpawn() shootingAllowed = true end addEventHandler("onClientPlayerSpawn", getLocalPlayer(), playerSpawn) function doShoot() if shootingAllowed == true then if not isPlayerDead(getLocalPlayer()) then shootingAllowed = false local theVehicle = getPedOccupiedVehicle(getLocalPlayer()) local x,y,z = getElementPosition(theVehicle) local rX,rY,rZ = getVehicleRotation(theVehicle) local x = x+4*math.cos(math.rad(rZ+90)) local y = y+4*math.sin(math.rad(rZ+90)) createProjectile(theVehicle, 19, x, y, z, 1.0, nil) setTimer(allowShooting, 3000, 1) end end end function allowShooting() shootingAllowed = true end function onClientMapStarting_Handler (map) if string.find( map.name, "Shooter", 1, true ) then for keyName, state in pairs(getBoundKeys("vehicle_fire")) do bindKey(keyName, "down", doShoot) end end end addEventHandler("onClientMapStarting",root,onClientMapStarting_Handler) addEvent("onClientMapStarting",true)
-
Like that. I only wrote root instead of playerSource function nyanCommand ( playerSource, commandName ) local acc = getPlayerAccount (playerSource) if acc and not isGuestAccount(acc) then local accName = getAccountName (acc ) if isObjectInACLGroup ("user."..accName, aclGetGroup ( "VIP" ) ) then local theTriggerer = getPlayerName ( playerSource ) if commandName == "nyan" then triggerClientEvent (root, "playMusicEvent", root,"nyan" ) -- changed outputChatBox ( theTriggerer .. "#E45800 Is a Nyan Cat !", getRootElement(), 255, 255, 255, true ) elseif commandName == "fools" then triggerClientEvent (root, "playMusicEvent", root,"fools" ) -- changed outputChatBox ( theTriggerer .. "#E45800 Is Killing Fools!", getRootElement(), 255, 255, 255, true ) end end end end addCommandHandler ( "nyan", nyanCommand ) addCommandHandler ( "fools", nyanCommand)
-
Good work Bilal, keep it up!
-
Amazing work, keep it up!!
-
#RooTs thanks but this functions replaces dff and txd to all players vehicle. I mean, when my car's health is 300, replace model for ONLY ME.
-
I want to make damage model for cheetah like this, I don't know any function to replace dff for one player. If there isn't this function, how can I do this? Please help me. Sorry for bad English. I hope, you will understand me.
-
This code works well, thanks. Also, how can i do only one player? For example i am vip player and i have shader. Other players haven't shader.
-
I am using this code, when the scripts started, i can see texture but other players can not see. Please help me what should i do?? Note: I have shader.fx local vehicle = getOccupiedVehicle() local Shader = dxCreateShader( "shader.fx" ) local Texture = dxCreateTexture( "mavericktexture.png" ) dxSetShaderValue( Shader, "Tex", Texture ) engineApplyShaderToWorldTexture( Shader, "Bell_206B_T", vehicle )
-
Thank you for your quick reply. I know 3D rendering and interpolation animations but i don't know how to get circles? Can you give example to me?
-
I watched this video. When the player win race or dd, stars turning on your vehicle ( with animations ) If you don't understand please watch the video ( 0:37 - 0:40 ) How can i do this script? Please give me script functions.
