Aruna Posted September 30, 2014 Share Posted September 30, 2014 Hola, quisiera saber como podria colocarle un tiempo de espera al sacar este objeto desde un panel. Esto vendria siendo la linea del script de la funcion que le da el objeto function VidaeColete() name = getPlayerName ( source ) setElementData(source,"M4 Mag",getElementData(source,"M4 Mag") + 60) outputChatBox("#FFFF00[VIP-#ff0000"..name.."#FFff00] #FFFFFF Ha sacado 60 balas de M4", getRootElement(), 255, 255, 255 , true) end addEvent("M4MAG", true) addEventHandler("M4MAG", getRootElement(), VidaeColete) y como haria para cuando un usuario saque este objeto pueda volver a sacarlo nuevamente dentro de 5 minutos?? Link to comment
Tomas Posted September 30, 2014 Share Posted September 30, 2014 Usas GUI o comando? setGuiEnabled o si usas comando lo mejor es una función booleana Oshe Alexs me ama e.e Link to comment
Aruna Posted September 30, 2014 Author Share Posted September 30, 2014 Usas GUI o comando?setGuiEnabled o si usas comando lo mejor es una función booleana Oshe Alexs me ama e.e Es un GUI WTF oshe alex me ama jajaja Aca esta el GUI function BuyWeaponOnServer(weapon_name,data,value) name = getPlayerName ( source ) if(weapon_name == "Equiparme") then setElementData(source, "MAX_Slots" , 125) setElementData(source, "CZ 550", 1) setElementData(source, "CZ 550 Mag", 25) setElementData(source, "M4", 1) setElementData(source, "M4 Mag", 260) setElementData(source, "Milk", 2) setElementData(source, "Pizza", 2) setElementData(source, "Medic Kit", 2) setElementData(source, "Morphine", 2) setElementData(source, "Blood Bag", 1) setElementData(source, "Infrared Goggles", 1) setElementData(source, "Civilian[F] Clothing", 1) setElementData(source, "Map", 1) setElementData(source, "GPS", 1) setElementData(source, "Toolbox", 1) setElementData(source, "PDW", 1) setElementData(source, "PDW Mag", 100) setElementData(source, "Night Vision Goggles", 1) setElementData(source, "Radio Device", 1) setElementData(source, "Watch", 1) outputChatBox("#FFff00[VIP-#ff0000"..name.."#FFff00] #FFFFFFha usado el Kit de Vip", getRootElement(), 255, 255, 255 , true) end if(weapon_name == "SpawnSanchez") then outputChatBox("#FFFF00[VIP] #FFFFFF Este comando esta #FF0000DESACTIVADO#FFFFFF !", source, 255, 255, 255 , true) end if(weapon_name == "Spawnpatriot") then outputChatBox("#FFFF00[VIP] #FFFFFF Este comando esta #FF0000DESACTIVADO #FFFFFF !", source, 255, 255, 255 , true) end if(weapon_name == "slotsmochila") then setElementData(source, "MAX_Slots", 125) outputChatBox("#FFFF00[VIP] #FFFFFF Ahora su mochila tiene 125 slot !", source, 255, 255, 255 , true) end end addEvent("onClientGiveWeapon", true) addEventHandler("onClientGiveWeapon", getRootElement(), BuyWeaponOnServer) Link to comment
Tomas Posted September 30, 2014 Share Posted September 30, 2014 Eso no es una GUI,pasa el client, o al menos la función donde clickean la GUI Link to comment
Aruna Posted October 7, 2014 Author Share Posted October 7, 2014 addEventHandler ( "onClientGUIClick", getResourceRootElement(getThisResource()), function ( ) if (source == equipar) then triggerServerEvent("onClientGiveWeapon", localPlayer, "Equiparme") end end ) Link to comment
Tomas Posted October 7, 2014 Share Posted October 7, 2014 addEventHandler ( "onClientGUIClick", getResourceRootElement(getThisResource()), function ( ) if (source == equipar) then triggerServerEvent("onClientGiveWeapon", localPlayer, "Equiparme") guiSetEnabled(equipar,false) setTimer(guiSetEnabled,tiempoenmilisegundos,1,equipar,true) end end ) Link to comment
Aruna Posted October 14, 2014 Author Share Posted October 14, 2014 Gracias Tomas me funciono Link to comment
Recommended Posts