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