-
Posts
21,935 -
Joined
-
Last visited
-
Days Won
6
Everything posted by Castillo
-
local Exitdoor = createMarker ( 2290.9851, 2473.5014, 38.6875, "cylinder", 1.5, 150, 0, 0, 255 ) function Exitd ( player ) if ( source == Exitdoor ) then if ( getElementType ( player ) == "player" ) then fadeCamera ( player, false, 1, 0, 0, 0 ) setTimer ( fadeCamera, 1000, 1, player, true, 1 ) setTimer ( setElementInterior, 1000, 1, player, 0, 2306.4257, 2456.0712, 10.8203 ) end end end addEventHandler ( "onMarkerHit", getRootElement() ,Exitd ) local Doorentry = createMarker ( 2306.4257, 2456.0712, 10.8203, "cylinder", 1.5, 255, 0, 0, 255 ) function Doore ( player ) if ( source == Doorentry ) then if ( getElementType ( player ) == "player" ) then fadeCamera ( player, false, 1, 0, 0, 0 ) setTimer ( fadeCamera, 1000, 1, player, true, 1 ) setTimer ( setElementInterior, 1000, 1, player, 0, 2290.9851, 2473.5014, 38.6875 ) end end end addEventHandler ( "onMarkerHit", getRootElement(), Doore )
-
'thePlayer' is not defined there, also, how are you triggering "playTheSound"?
-
One is the race one for sure, you'll have to find out how to hide it, or remove it completely.
-
El tema es que el inventario lo haces como queres, no es que haya una forma con la cual todos lo hacen, yo mis script de inventario los hice diferentes a los que vi.
-
You're welcome.
-
You don't get the problem, the event is never triggered.
-
@kevenz: Just by renaming the parameter name, it won't make it work.
-
You must make a table, then store the objects/timers in there.
-
local str = " Test" local start = str:find ( "<" ) local _, end_ = str:find ( ">" ) local str = str:gsub ( str:sub ( ( start + 1 ), ( end_ - 1 ) ), "" ) outputChatBox ( str ) That seems to work, it removes "Hello World" and leaves: "<> Test" intact.
-
local mySkins = { 171, 172, 133, 149 } local index = { } function Selection ( player ) showCursor ( player, true ) bindKey ( player, "rshift", "down", Spawn ) bindKey ( player, "arrow_l", "down", SwitchSkin ) bindKey ( player, "arrow_r", "down", SwitchSkin ) fadeCamera ( player, true ) index [ player ] = 1 end function Selection2 ( player ) if ( not isPedDead ( player ) ) then outputChatBox ( " ", player, 0, 255, 0 ) outputChatBox ( "You'll choose your skin again.", player, 0, 138, 138 ) outputChatBox ( "Press Arrow keys to switch skins and Right shift to spawn!", player, 0, 138, 138 ) killPed ( player, player ) end setTimer ( Selection, 1000, 1, player ) end function SwitchSkin ( player, key ) if ( key == "arrow_l" ) then if ( index [ player ] == 1 ) then index [ player ] = #mySkins else index [ player ] = ( index [ player ] - 1 ) end else if ( index [ player ] == #mySkins ) then index [ player ] = 1 else index [ player ] = ( index [ player ] + 1 ) end end outputChatBox ( index [ player ] ) setElementModel ( player, mySkins [ index [ player ] ] ) playSoundFrontEnd ( player, 32 ) end function Spawn ( player ) showCursor ( player, false ) playSoundFrontEnd ( player, 44 ) outputChatBox("Done!", player, 0, 255, 138) unbindKey ( player, "rshift", "down", Spawn ) unbindKey ( player, "arrow_l", "down", SwitchSkin ) unbindKey ( player, "arrow_r", "down", SwitchSkin ) setCameraTarget ( player, player ) end function GamemodeStart ( res ) local players = getElementsByType ( "player" ) for _, v in ipairs ( players ) do bindKey ( v, "F4", "down", Selection2 ) outputChatBox ( "< Press Arrow keys to switch skins and Right shift to spawn. >", v, 255, 138, 0 ) setTimer ( SpawnPlayer, 1000, 1, v ) setTimer ( Selection, 1000, 1, v ) fadeCamera ( v, true ) end end function GamemodeEnd ( res ) local players = getElementsByType ( "player") for _, v in ipairs ( players ) do unbindKey ( v, "F4", "down", Selection2 ) end end function PlayerDeath ( ) setTimer ( SpawnPlayer, 1000, 1, source ) end function SpawnPlayer ( source ) spawnPlayer ( source, -2026.5035, 156.7506, 29.0391, 269.1424, 167 ) end function PlayerJoin ( ) bindKey ( source, "F4", "down", Selection2 ) outputChatBox ( "< Press Arrow Keys to switch skins and Right shift to spawn. >", source, 255, 255, 0 ) setTimer ( SpawnPlayer, 1000, 1, source ) fadeCamera (source, true ) setTimer ( Selection, 1500, 1, source ) end addEventHandler ( "onResourceStart", resourceRoot, GamemodeStart ) addEventHandler ( "onResourceStop", resourceRoot, GamemodeEnd ) addEventHandler ( "onPlayerJoin", getRootElement(), PlayerJoin ) Try that.
-
Postea lo que intentaste hacer.
-
Before this line: if getElementSpeed( element ) == 0 then Add: outputChatBox ( tostring ( getElementSpeed ( element ) ) )
-
Main problem was that you were defining the function name, but with the method you were attaching the event handler of "onMarkerHit", it didn't work. addEvent ( "onRaceStateChanging", true ) addEventHandler ( "onRaceStateChanging", getRootElement(), function ( newState, oldState ) if ( newState == "Running" ) then myMarker = createMarker ( 156.8359375, 2504.0920410156, 34, "ring", 6.7, 255, 0, 0, 255 ) end end ) addEventHandler ( "onMarkerHit", getRootElement(), function ( player, matchingDimension ) -- define MarkerHit function for the handler if ( getElementType ( player ) == "player" ) then if ( source == myMarker ) then setTimer ( function ( ) myMarker = createMarker ( 156.8359375, 2504.0920410156, 34, "ring", 6.7, 255, 0, 0, 255 ) end ,500, 1 ) local account = getPlayerAccount ( player ) setAccountData ( account, "cash", getAccountData ( account, "cash" ) + 100 ) outputChatBox ( "#FFFFFFYou have earned #FF0000$100#FFFFFF for that jump!", player, 255, 0, 0, true ) scoreboardRefresh ( player ) end end end )
-
These errors can't stop you from entering, what is the exact problem? why it doesn't let you enter?
-
You downloaded MTA from the main page? does it say which files are missing?
-
What's the point of creating another function? you can just bind it to "toggleWindow" function. bindKey ( "F5", "down", toggleWindow )
-
What is the problem with that script?
-
Have you checked what getElementSpeed is returning?
-
En el titulo del tema mencionaste dos funciones, intentaste usarlas?
-
That's a map editor bug as far as I know.
-
That's something the map editor adds to your map to remove world models ( if you removed any ), and not sure if it's also used for something else.