-
Posts
21,935 -
Joined
-
Last visited
-
Days Won
6
Everything posted by Castillo
-
Es porque no se puede remplazar las luces y el nitro, ademas, "engineLoadFXP" no existe.
-
@adward: Remember to add this resource to the acl.xml in the group "Admin", executeCommandHandler requires admin permissions.
-
-- client side: GUIEditor_Window = {} GUIEditor_Button = {} GUIEditor_Window[1] = guiCreateWindow(234,165,422,347,"console-command",false) guiSetVisible (GUIEditor_Window[1], false) GUIEditor_Button[1] = guiCreateButton(18,59,381,94,"command-1",false,GUIEditor_Window[1]) GUIEditor_Button[2] = guiCreateButton(30,200,367,90,"command-2",false,GUIEditor_Window[1]) bindKey ( "F2" , "down" , function() if ( guiGetVisible ( GUIEditor_Window[1] ) == true ) then guiSetVisible ( GUIEditor_Window[1] ,false ) showCursor (false ) guiSetInputEnabled(false) elseif ( guiGetVisible ( GUIEditor_Window[1] ) == false ) then guiSetVisible ( GUIEditor_Window[1] ,true ) showCursor (false ) guiSetInputEnabled(true) end end ) addEventHandler("onClientGUIClick",root, function () if (source == GUIEditor_Button[1]) then triggerServerEvent("executeACommand",localPlayer,localPlayer,"20") elseif (source == GUIEditor_Button[2]) then triggerServerEvent("executeACommand",localPlayer,localPlayer,"30") end end) -- server side: addEvent("executeACommand",true) addEventHandler("executeACommand",root, function (client, action) executeCommandHandler("vote", client, "arena ".. tostring(action)) end)
-
Well, the script himself works, but I have no idea how handling stuff works. Maybe you should use velocity instead of handling. -- client side: addEvent("playSonicSound",true) addEventHandler("playSonicSound",root, function () if isElement(sound) then destroyElement(sound) end sound = playSound("boom.mp3") end) -- server side: addEventHandler("onResourceStart",resourceRoot, function () for index, player in pairs(getElementsByType("player")) do bindKey ( player, "lshift", "down", sonicboom ) end end) addEventHandler("onPlayerJoin",root, function () bindKey ( source, "lshift", "down", sonicboom ) end) function sonicboom (player) if not isPedInVehicle(player) then return end local speedx, speedy, speedz = getElementVelocity ( getPedOccupiedVehicle(player) ) actualspeed = (speedx^2 + speedy^2 + speedz^2)^(0.5) kmh = actualspeed * 180 outputChatBox ( getPlayerName(player) .." current velocity: " .. kmh .. " metres per second." ) if kmh >= 130 then triggerClientEvent(player,"playSonicSound",player) setElementVelocity ( getPedOccupiedVehicle(player), speedx*1.05, speedy*1.05, speedz*1.05) end end
-
-- client side: addEvent("playSonicSound",true) addEventHandler("playSonicSound",root, function () if isElement(sound) then destroyElement(sound) end sound = playSound("boom.mp3") end) -- server side: addEventHandler("onResourceStart",resourceRoot, function () for index, player in pairs(getElementsByType("player")) do bindKey ( player, "lshift", "down", sonicboom ) end end) addEventHandler("onPlayerJoin",root, function () bindKey ( source, "lshift", "down", sonicboom ) end) function sonicboom (player) if not isPedInVehicle(player) then return end speedx, speedy, speedz = getElementVelocity ( getPedOccupiedVehicle(player) ) actualspeed = (speedx^2 + speedy^2 + speedz^2)^(0.5) kmh = actualspeed * 180 outputChatBox ( getPlayerName(player) .." current velocity: " .. kmh .. " metres per second." ) if kmh >= 130 then triggerClientEvent(player,"playSonicSound",player) setVehicleHandling(getPedOccupiedVehicle(player), "maxVelocity", 200) end end
-
Do you know how this script works? it's suposed to get the velocity & so on from a player called "Someguy", do you want that?
-
playSound is only client side.. and bindKey doesn't work that way in server side.
-
This script is client side, right?
-
Stop posting without being answered!
-
Could you give more information about WHAT is not working? you just say "Its not working I dont know what is the problem plz Help me" and nothing else, does it output errors in the debugscript (/debugscript 3)?
-
setVehicleHandling requires a vehicle element, not a vehicle model if I'm right. function sonicboom () speedx, speedy, speedz = getElementVelocity ( getPlayerFromName ( "someguy" ) ) actualspeed = (speedx^2 + speedy^2 + speedz^2)^(0.5) kmh = actualspeed * 180 outputChatBox ( "Someguy's current velocity: " .. mps .. " metres per second." ) if kmh >= 130 then playSound("boom.mp3") setVehicleHandling(getPedOccupiedVehicle(getPlayerFromName ( "someguy" )), "maxVelocity", 200) end end bindKey ( "lshift", "down", sonicboom )
-
Please, speak only English on this forum section, you can use the Multi language section for your own language. viewforum.php?f=117
-
local dutyMarker = createMarker ( 1229, -1423.6999511719, 13,'cylinder', 2.0, 225, 0, 0, 137 ) CrimGui = guiCreateWindow(227,106,342,376,"MLAW Criminal job",false) Have_Job = guiCreateButton(39,313,111,45,"Have job!",false,CrimGui) Cancel = guiCreateButton(200,312,111,45,"Cancel",false,CrimGui) Doel = guiCreateMemo(63,44,234,242,"Criminal:\nAs Criminal you need to rob houses. You will get 0-1K from this.",false,CrimGui) guiMemoSetReadOnly( Doel,true ) guiSetVisible ( CrimGui, false ) addEventHandler("onClientMarkerHit", dutyMarker, function(hitElement) if hitElement ~= localPlayer then return end if CrimGui ~= nil then guiSetVisible(CrimGui, true) showCursor(true) guiSetInputEnabled(true) else outputChatBox ("You aren't ready yet. Re-enter the marker.") end end ) addEventHandler ("onClientGUIClick", Have_Job, function ( ) triggerServerEvent("CrimTeam",localPlayer) showCursor(false) guiSetInputEnabled(false) guiSetVisible(CrimGui, false) showCursor(false) end, false ) addEventHandler ("onClientGUIClick", Cancel, function ( ) guiSetInputEnabled(false) guiSetVisible(CrimGui, false) showCursor(false) end, false )
-
Could you at least tell us what "problems" did you get? does it output errors to debugscript?
-
function sonicboom () speedx, speedy, speedz = getElementVelocity ( getPlayerFromName ( "someguy" ) ) actualspeed = (speedx^2 + speedy^2 + speedz^2)^(0.5) kmh = actualspeed * 180 outputChatBox ( "Someguy's current velocity: " .. mps .. " metres per second." ) if kmh >= 130 then playSound("boom.mp3") setVehicleHandling(520, "maxVelocity", 200) end end bindKey ( "lshift", "down", sonicboom ) P.S: When you use outputChatBox in client side, none else but the client will see it.
-
function position () setElementPosition ( source, 1549.88953, -1685, 13 ) end addEventHandler("onPlayerLogin", root, position)
-
function giveArmor() local pC= getAlivePlayers() if (#pC >= 1 and #pC <= 5) then for id, player in ipairs(pC) do setPedArmor(player, 50) outputChatBox(getPlayerName(player).." has won 50% Armor For Alive on Round", root, 0, 255, 0) outputChatBox("You Have won Free Armor for be Alive in Round", player, 255, 255, 0) end end if getPedArmor(source) > 0 then setPedArmor(source, 0) outputChatBox(getPlayerName(source).." has Lost His Armor For Dead in Round Noob!", root, 255, 255, 0) end end addEventHandler("onPlayerWasted", root, giveArmor)
-
function giveArmor() local pC= getAlivePlayers() if (#pC >= 1 and #pC <= 5) then for id, player in ipairs(pC) do setPedArmor(player, 50) outputChatBox(getPlayerName(player).." has won 50% Armor For Alive on Round", root, 0, 255, 0) outputChatBox("You Have won Free Armor for be Alive in Round", player, 255, 255, 0) end end setPedArmor(source, 0) outputChatBox(getPlayerName(source).." has Lost His Armor For Dead in Round Noob!", root, 255, 255, 0) end addEventHandler("onPlayerWasted", root, giveArmor)
-
Your only problem so far is the "MoveObject" function with has with upper case "M", and second if I'm right, your gate and your marker aren't in the same position, and you're trying to move the gate just a little, so maybe that's why you don't see it. local ingang1 = createObject ( 980, 1602.099609375, -1613.099609375, 15.300000190735, 0, 0, 0 ) local ingangmarker = createMarker(-1907.9000244141, 1613.1999511719, 13.5, "cylinder", 5, 0, 0, 0, 0) local teams = {["Police"] = true} function moveGate1 ( hitElement, matchingDimension ) if getElementType ( hitElement ) == "player" and getPlayerTeam ( hitElement ) and teams[getTeamName(getPlayerTeam ( hitElement ))] then moveObject ( ingang1, 3000, 1602.099609375, -1613.1999511719, 15.300000190735 ) end end addEventHandler("onMarkerHit", ingangmarker, moveGate1) function moveGate1Back ( leaveElement, matchingDimension ) if getElementType ( leaveElement ) =="player" and getPlayerTeam ( leaveElement ) and teams [getTeamName(getPlayerTeam ( leaveElement ))] then moveObject (ingang1, 3000, 1602.099609375, -1613.099609375, 15.300000190735 ) end end addEventHandler ("onMarkerLeave", ingangmarker, moveGate1Back)
-
local invitations = {} function getPlayerByPartOfName(playerPart) local pl = getPlayerFromName(playerPart) if isElement(pl) then return pl else for i,v in ipairs (getElementsByType ("player")) do if (string.find(getPlayerName(v),playerPart)) then return v end end end end addCommandHandler("warpto", function (thePlayer, cmd, who) if (not who or who == "") then outputChatBox("/"..cmd..": No player inserted.",thePlayer,255,0,0) return end local player = getPlayerByPartOfName(who) if (not player) then outputChatBox("/"..cmd..": This player does not exists.",thePlayer,255,0,0) return end if (invitations[thePlayer]) then outputChatBox("/"..cmd..": You already sent a warp invitation.",thePlayer,255,0,0) return end outputChatBox(getPlayerName(player) .." want's to warp to you, write /accept ".. getPlayerName(thePlayer) ..".",player,0,255,0) outputChatBox("You have sent a warp invitation to ".. getPlayerName(player) ..".",player,0,255,0) invitations[thePlayer] = player setTimer(function () invitations[thePlayer] = nil end, 60000, 1) end) addCommandHandler("accept", function (thePlayer, cmd, who) if (not who or who == "") then outputChatBox("/"..cmd..": No player inserted.",thePlayer,255,0,0) return end local player = getPlayerByPartOfName(who) if (not player) then outputChatBox("/"..cmd..": This player does not exists.",thePlayer,255,0,0) return end if invitations[player] then setElementPosition(player, getElementPosition(thePlayer)) outputChatBox("You have accepted ".. getPlayerName(player) .."'s warp invitation.",thePlayer,0,255,0) outputChatBox(getPlayerName(thePlayer) .. " accepted your warp invitation.",player,0,255,0) invitations[player] = nil end end)
-
Rename one of the commands?
