JesusAliso Posted March 16, 2013 Share Posted March 16, 2013 Hola Me pueden decir que Comando son para que un Jugador entre en un "Área" y le de dinero cada segundo.el "Área" puede ser createColCuboid Cuales Serian los que faltan? Link to comment
JesusAliso Posted March 16, 2013 Author Share Posted March 16, 2013 Eso seria todo? Gracias Link to comment
JesusAliso Posted March 16, 2013 Author Share Posted March 16, 2013 Hice esto, Cuando entra al "Área" Le da 100$, Como haría para que le Diera 1000$ cada segundo? local hillArea = createColCuboid ( 1187.7066650391, -1409.201171875, 12.010873603821, 150, 122, 35 ) local hillRadar = createRadarArea ( 1187.7066650391, -1409.201171875, 150, 122, 117, 233, 229, 220 ) function hill_Enter ( thePlayer, matchingDimension ) givePlayerMoney ( thePlayer, 1000 ) if (getElementType(thePlayer) == "player") then outputChatBox( getPlayerName(thePlayer) .. " Entro a zona de ganar Dinero!", getRootElement(), 255, 255, 109 ) setRadarAreaFlashing ( hillRadar, true ) end end addEventHandler ( "onColShapeHit", hillArea, hill_Enter ) Tambien Cuando entro y salgo del are, Me da 1000$ Link to comment
MTA Team 0xCiBeR Posted March 16, 2013 MTA Team Share Posted March 16, 2013 Debes usar un simple timer: setTimer ( hill_Enter 1000, 1 ) Link to comment
MTA Team 0xCiBeR Posted March 16, 2013 MTA Team Share Posted March 16, 2013 local hillArea = createColCuboid ( 1187.7066650391, -1409.201171875, 12.010873603821, 150, 122, 35 ) local hillRadar = createRadarArea ( 1187.7066650391, -1409.201171875, 150, 122, 117, 233, 229, 220 ) function hill_Enter ( thePlayer, matchingDimension ) givePlayerMoney ( thePlayer, 1000 ) if (getElementType(thePlayer) == "player") then outputChatBox( getPlayerName(thePlayer) .. " Entro a zona de ganar Dinero!", getRootElement(), 255, 255, 109 ) setRadarAreaFlashing ( hillRadar, true ) end end addEventHandler ( "onColShapeHit", hillArea, hill_Enter ) setTimer ( hill_Enter 1000, 1 ) Asi seria mas o menos..Prueba asi Link to comment
MTA Team 0xCiBeR Posted March 16, 2013 MTA Team Share Posted March 16, 2013 Recuerda que eso va hacer que se repita la funcion cada cierto cantidad de tiempo..Por lo tanto el outputChatBox te va a spamear el server..Mete lo de "Entro a Zona de ganar dinero en otra funcion.! Link to comment
JesusAliso Posted March 16, 2013 Author Share Posted March 16, 2013 ok quitare el del outPutChatBox, Pero haora dice "client.lua:5: Bad Argument @ givePlayerMoney Link to comment
MTA Team 0xCiBeR Posted March 16, 2013 MTA Team Share Posted March 16, 2013 lol men xq lo tienes Client-Side Cuando ese script es Server-Side Cambaialo en el Meta a Server-Side Link to comment
MTA Team 0xCiBeR Posted March 16, 2013 MTA Team Share Posted March 16, 2013 Sino debes usar localPlayer, pero no te lo recomiendo ya que no se guardara en el server.. Link to comment
JesusAliso Posted March 16, 2013 Author Share Posted March 16, 2013 Real mente, e visto que hablan mucho de eso y te digo que no se que significa e hechos post para saber sobre eso. Pero esta es la meta "Under" name="radar" version="1.0.3" type="script"/> Link to comment
MTA Team 0xCiBeR Posted March 16, 2013 MTA Team Share Posted March 16, 2013 Y si no quieres que te de dinero cuando sales usas "onColShapeLeave" Asi seria: local hillArea = createColCuboid ( 1187.7066650391, -1409.201171875, 12.010873603821, 150, 122, 35 ) local hillRadar = createRadarArea ( 1187.7066650391, -1409.201171875, 150, 122, 117, 233, 229, 220 ) function hill_Enter ( thePlayer, matchingDimension ) givePlayerMoney ( thePlayer, 1000 ) if (getElementType(thePlayer) == "player") then outputChatBox( getPlayerName(thePlayer) .. " Entro a zona de ganar Dinero!", getRootElement(), 255, 255, 109 ) setRadarAreaFlashing ( hillRadar, true ) end end function hill_Leave ( thePlayer, matchingDimention ) givePlayerMoney ( thePlayer, 0 ) end addEventHandler ( "onColShapeHit", hillArea, hill_Enter ) addEventHandler ( "onColShapeHit", hillArea, hill_Leave ) setTimer ( hill_Enter 1000, 1 ) Link to comment
MTA Team 0xCiBeR Posted March 16, 2013 MTA Team Share Posted March 16, 2013 Lo pues asi tienes tu meta? Ya esta server-Side Link to comment
JesusAliso Posted March 16, 2013 Author Share Posted March 16, 2013 Si, y acabo de probar como me dijiste pero no Pasa nada. Link to comment
MTA Team 0xCiBeR Posted March 16, 2013 MTA Team Share Posted March 16, 2013 Probas asi, me comi una Coma local hillArea = createColCuboid ( 1187.7066650391, -1409.201171875, 12.010873603821, 150, 122, 35 ) local hillRadar = createRadarArea ( 1187.7066650391, -1409.201171875, 150, 122, 117, 233, 229, 220 ) function hill_Enter ( thePlayer, matchingDimension ) givePlayerMoney ( thePlayer, 1000 ) if (getElementType(thePlayer) == "player") then outputChatBox( getPlayerName(thePlayer) .. " Entro a zona de ganar Dinero!", getRootElement(), 255, 255, 109 ) setRadarAreaFlashing ( hillRadar, true ) end end function hill_Leave ( thePlayer, matchingDimention ) givePlayerMoney ( thePlayer, 0 ) end addEventHandler ( "onColShapeHit", hillArea, hill_Enter ) addEventHandler ( "onColShapeHit", hillArea, hill_Leave ) setTimer ( hill_Enter, 1000, 1 ) Link to comment
AlvareZ_ Posted March 16, 2013 Share Posted March 16, 2013 Creo que es .. local hillArea = createColCuboid ( 1187.7066650391, -1409.201171875, 12.010873603821, 150, 122, 35 ) local hillRadar = createRadarArea ( 1187.7066650391, -1409.201171875, 150, 122, 117, 233, 229, 220 ) function hill_Enter ( thePlayer, matchingDimension ) givePlayerMoney ( thePlayer, 1000 ) if (getElementType(thePlayer) == "player") then outputChatBox( getPlayerName(thePlayer) .. " Entro a zona de ganar Dinero!", getRootElement(), 255, 255, 109 ) setRadarAreaFlashing ( hillRadar, true ) end end addEventHandler ( "onColShapeHit", hillArea, hill_Enter ) setTimer ( hill_Enter, 1000, 1 ) function hill_Leave ( thePlayer, matchingDimention ) givePlayerMoney ( thePlayer, 0 ) end addEventHandler ( "onColShapeLeave", hillArea, hill_Enter ) Link to comment
MTA Team 0xCiBeR Posted March 16, 2013 MTA Team Share Posted March 16, 2013 Lool me equivoque denuevo.. seria asi: local hillArea = createColCuboid ( 1187.7066650391, -1409.201171875, 12.010873603821, 150, 122, 35 ) local hillRadar = createRadarArea ( 1187.7066650391, -1409.201171875, 150, 122, 117, 233, 229, 220 ) function hill_Enter ( thePlayer, matchingDimension ) givePlayerMoney ( thePlayer, 1000 ) if (getElementType(thePlayer) == "player") then outputChatBox( getPlayerName(thePlayer) .. " Entro a zona de ganar Dinero!", getRootElement(), 255, 255, 109 ) setRadarAreaFlashing ( hillRadar, true ) end end function hill_Leave ( thePlayer, matchingDimention ) givePlayerMoney ( thePlayer, 0 ) end addEventHandler ( "onColShapeHit", hillArea, hill_Enter ) addEventHandler ( "onColShapeLeave", hillArea, hill_Leave ) setTimer ( hill_Enter, 1000, 1 ) Link to comment
MTA Team 0xCiBeR Posted March 16, 2013 MTA Team Share Posted March 16, 2013 Se no me anda el Quote estoy con el Opera.. Link to comment
AlvareZ_ Posted March 16, 2013 Share Posted March 16, 2013 Se ve mas bonito el mio, Jum >< Link to comment
MTA Team 0xCiBeR Posted March 16, 2013 MTA Team Share Posted March 16, 2013 OFFtopic: El mio esta mas ordenado :3 *-* Link to comment
JesusAliso Posted March 16, 2013 Author Share Posted March 16, 2013 Me dice este error, newprueba/client.lua:5: Bad argument @ 'givePlayerMoney' el otro dice: newprueba/client.lua:6: Bad argument @ 'getElementType' [Expected element at argument 1, got nill] Link to comment
AlvareZ_ Posted March 16, 2013 Share Posted March 16, 2013 (edited) Intenta esto: local hillArea = createColCuboid ( 1187.7066650391, -1409.201171875, 12.010873603821, 150, 122, 35 ) local hillRadar = createRadarArea ( 1187.7066650391, -1409.201171875, 150, 122, 117, 233, 229, 220 ) function hill_Enter ( thePlayer, matchingDimension ) if (getElementType(thePlayer) == "player") then givePlayerMoney ( thePlayer, 1000 ) outputChatBox( getPlayerName(thePlayer) .. " Entro a zona de ganar Dinero!", getRootElement(), 255, 255, 109 ) setRadarAreaFlashing ( hillRadar, true ) end end addEventHandler ( "onColShapeHit", hillArea, hill_Enter ) setTimer ( hill_Enter, 1000, 1 ) function hill_Leave ( thePlayer, matchingDimention ) givePlayerMoney ( thePlayer, 0 ) end addEventHandler ( "onColShapeLeave", hillArea, hill_Enter ) Edited March 16, 2013 by Guest Link to comment
JesusAliso Posted March 16, 2013 Author Share Posted March 16, 2013 Aun sigue sin Darme dinero por segundo, y me dio error el "segundo que dije" el mismo Link to comment
Recommended Posts