HunT Posted June 12, 2011 Share Posted June 12, 2011 (edited) I Guyz. I made this command "NosAll" whit png (Give nos to everyone + show png for 2 sec.) nosall.lua serverside function stereo3 (thePlayer, commandName) for i,v in pairs(getElementsByType("player")) do if isPedInVehicle(v) and getElementData(v,"state") == "alive" then local vehicle = getPedOccupiedVehicle(v) addVehicleUpgrade(vehicle,1010) triggerClientEvent ("showImage", getRootElement (), object) end end end addCommandHandler("nosall", stereo3) nospng.lua clientside addEvent ("showImage", true) function showClientImageNos() local nos = guiCreateStaticImage(310,68,417,323,"image/nitro.png",false) guiSetAlpha(nos,0.7) setTimer(destroyElement, 2000, 1, nos) end addEventHandler( "showImage", getRootElement (), showClientImageNos ) This command work . . .but i press the /nosall and the game stop for one second (Type lag ) Only in server "lag" , in map editor no. nitro.png is 500x500 What is problem? Size png? Change the guiCreateStaticImage whit dxDrawImage? Tnx For Support Edit : This is nitro.png Edited June 12, 2011 by Guest Link to comment
BinSlayer1 Posted June 12, 2011 Share Posted June 12, 2011 try this instead of your triggerClientEvent triggerClientEvent (v,"showImage", getRootElement ()) btw, i saw you were passing 'object' as parameter for triggering the event showImage, but I don't see no object defined anywhere so I removed it from the above line Link to comment
HunT Posted June 12, 2011 Author Share Posted June 12, 2011 try this instead of your triggerClientEventtriggerClientEvent (v,"showImage", getRootElement ()) btw, i saw you were passing 'object' as parameter for triggering the event showImage, but I don't see no object defined anywhere so I removed it from the above line Ok Tnx now test and resize to 200x200 Link to comment
Dark Dragon Posted June 12, 2011 Share Posted June 12, 2011 Don't use guiCreateStaticImage, it's not meant to be used for temporary on screen pictures. If you use dxDrawImage it should be fine. Link to comment
HunT Posted June 12, 2011 Author Share Posted June 12, 2011 Don't use guiCreateStaticImage, it's not meant to be used for temporary on screen pictures. If you use dxDrawImage it should be fine. Now work with "v" (getPedOccupiedVehicle) is Perfect. Show image only the alive players and no lag . Tnx BinSlayer1. Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now