iFoReX Posted July 11, 2012 Share Posted July 11, 2012 cuando pongo los scripts no me aparece nada en el chat ni me teletransporta a otra dimension ni me freezea function afk() if source == getElementsByType("player") then if getElementDimension(source) == 0 and not isPedInVehicle(source) then local dimensionAFK = setElementDimension(source,math.random(1,3000)) setElementFrozen(source,true) outputChatBox(getPlayerName(source)..", esta AFK",getRootElement(),255,255,255,true) elseif getElementDimension(source) > 0 and not isPedInVehicle(source) then outputChatBox("ya estas AFK !",source) elseif isPedInVehicle(source) then outputChatBox("estas dentro de un vehiculo !",source) end end end addCommandHandler("afk",afk) function back() if source == getElementsByType("player") then if getElementDimension(source) == 0 and not isPedInVehicle(source) then outputChatBox("no estas AFK !",source) elseif getElementDimension(source) > 0 and not isPedInVehicle(source) then setElementDimension(source,0) setElementFrozen(source,true) outputChatBox(getPlayerName(source)..",esta devuelta",getRootElement(),255,255,255,true) elseif isPedInVehicle(source) then outputChatBox("estas dentro de un Vehiculo !",source) end end end addCommandHandler("back",back) Link to comment
Castillo Posted July 11, 2012 Share Posted July 11, 2012 'source' no esta definido en ninguna parte, tenes que poner el primer argumento en la funcion. Link to comment
Alexs Posted July 11, 2012 Share Posted July 11, 2012 En un comando el jugador es playerSource, intenta con esto: function afk(playerSource) if getElementDimension(playerSource) == 0 and not isPedInVehicle(source) then local dimensionAFK = setElementDimension(playerSource,math.random(1,3000)) setElementFrozen(playerSource,true) outputChatBox(getPlayerName(playerSource)..", esta AFK",getRootElement(),255,255,255,true) elseif getElementDimension(playerSource) > 0 and not isPedInVehicle(playerSource) then outputChatBox("ya estas AFK !",playerSource) elseif isPedInVehicle(playerSource) then outputChatBox("estas dentro de un vehiculo !",playerSource) end end addCommandHandler("afk",afk) function back(playerSource) if getElementDimension(playerSource) == 0 and not isPedInVehicle(playerSource) then outputChatBox("no estas AFK !",source) elseif getElementDimension(playerSource) > 0 and not isPedInVehicle(playerSource) then setElementDimension(playerSource,0) setElementFrozen(playerSource,true) outputChatBox(getPlayerName(playerSource)..",esta devuelta",getRootElement(),255,255,255,true) elseif isPedInVehicle(playerSource) then outputChatBox("estas dentro de un Vehiculo !",playerSource) end end addCommandHandler("back",back) PD: si utilizas interiors o mabako-services entonces los usuarios no podran ponerse AFK en un AmmuNation. Link to comment
iFoReX Posted July 11, 2012 Author Share Posted July 11, 2012 no uso interiors o mabako services solo house_system, Ok, gracias alexs lo ire a probar enseguida. Link to comment
BorderLine Posted July 11, 2012 Share Posted July 11, 2012 me parece que el freze siges moviendote. Debes deshabilitar las bindkeys para moverse, w,a,s,d, salto, correr y nose cuales mas eran. En fin suerte Link to comment
Recommended Posts