-
Posts
1,546 -
Joined
-
Last visited
Everything posted by Dimos7
-
function onPlayerSaveSkin() local playerAcc = getPlayerAccount(source) if not isGuestAccount(playerAcc) then local playerSkin = getElementModel(source) setAccountData(playerAcc, "skin", tostring(playerSkin)) end end addEventHandler("onPlayerQuit", root, onPlayerSaveSkin) function onPlayerLoadSkin(thePlayer) local playerAcc = getPlayerAccount(thePlayer) local playerSkin = tonumber (getAccountData(playerAcc, "skin")) triggerClientEvent(thePlayer, "makePed", root, playerSkin) end addEvent("makePed", true) addEventHandler("makePed", root, onPlayerLoadSkin) function onPlayerCheckSkin(playerSkin) triggerServerEvent("makePed", root , localPlayer) createPed(playerSkin or 0 ,-1600.9000244141,-1620.6999511719,36.599998474121,241.908905,0,0) end addEvent("makePed", true) addEventHandler("makePed", root , onPlayerCheckSkin)
-
function onPlayerSaveSkin() local playerAcc = getPlayerAccount(source) if not isGuestAccount(playerAcc) then local playerSkin = getElementModel(source) setAccountData(playerAcc, "skin", tostring(playerSkin)) end end addEventHandler("onPlayerQuit", root, onPlayerSaveSkin) function onPlayerLoadSkin(thePlayer) local playerAcc = getPlayerAccount(thePlayer) local playerSkin = getAccountData(playerAcc, "skin") setElementData(thePlayer, "skin", playerSkin) end addEvent("makePed", true) addEventHandler("makePed", root, onPlayerLoadSkin) function onPlayerCheckSkin() triggerServerEvent("makePed", resourceRoot, localPlayer) local playerSkin = tonumber(getElementData(localPlayer, "skin")) createPed(playerSkin or 0 ,-1600.9000244141,-1620.6999511719,36.599998474121,241.908905,0,0) end addEventHandler("onClientResourceStart", resourceRoot, onPlayerCheckSkin)
-
I know thank you
-
function onPlayerSaveSkin() local playerAcc = getPlayerAccount(source) if not isGuestAccount(playerAcc) then local playerSkin = getElementModel(source) setAccountData(playerAcc, "skin", tostring(playerSkin)) end end addEventHandler("onPlayerQuit", root, onPlayerSaveSkin) function onPlayerLoadSkin(thePlayer) local playerAcc = getPlayerAccount(getPlayerName(thePlayer)) local playerSkin = getAccountData(playerAcc, "skin") setElementData(thePlayer, "skin", playerSkin) end addEvent("makePed", true) addEventHandler("makePed", root, onPlayerLoadSkin) function onPlayerCheckSkin() triggerServerEvent("makePed", resourceRoot, localPlayer ) local playerSkin = tonumber(getElementData(localPlayer, "skin")) createPed(playerSkin or 0 ,-1600.9000244141,-1620.6999511719,36.599998474121,241.908905,0,0) end addEventHandler("onClientResourceStart", resourceRoot, onPlayerCheckSkin)
-
function onPlayerSaveSkin() local playerAcc = getPlayerAccount(source) if not isGuestAccount(playerAcc) then local playerSkin = getElementModel(source) setAccountData(playerAcc, "skin", tostring(playerSkin)) end end addEventHandler("onPlayerQuit", root, onPlayerSaveSkin) function onPlayerLoadSkin(thePlayer) local playerAcc = getPlayerAccount(getPlayerName(thePlayer)) local playerSkin = getAccountData(playerAcc, "skin") setElementData(thePlayer, "skin", playerSkin) end addEvent("makePed", true) addEventHandler("makePed", root, onPlayerLoadSkin) function onPlayerCheckSkin() triggerServerEvent("makePed", resourceRoot) local playerSkin = tonumber(getElementData(localPlayer, "skin")) createPed(playerSkin or 0 ,-1600.9000244141,-1620.6999511719,36.599998474121,241.908905,0,0) end addEventHandler("onClientResourceStart", resourceRoot, onPlayerCheckSkin) If that not work i give up
-
function onPlayerSaveSkin() local playerAcc = getPlayerAccount(source) if not isGuestAccount(playerAcc) then local playerSkin = getElementModel(source) setAccountData(playerAcc, "skin", tostring(playerSkin)) end end addEventHandler("onPlayerQuit", root, onPlayerSaveSkin) function onPlayerLoadSkin(thePlayer) local playerAcc = getPlayerAccount(getPlayerName(thePlayer)) local playerSkin = tonumber(getAccountData(playerAcc, "skin")) createPed(playerSkin or 0 ,-1600.9000244141,-1620.6999511719,36.599998474121,241.908905,0,0) end addEvent("makePed", true) addEventHandler("makePed", root, onPlayerLoadSkin) function onPlayerCheckSkin() triggerServerEvent("makePed", localPlayer) end addEventHandler("onClientResourceStart", resourceRoot, onPlayerCheckSkin) Try this
-
You want player has login or before login?
-
function onPlayerCheckSkin() triggerServerEvent("makePed", localPlayer, playerSkin) createPed(playerSkin or 0,-1600.9000244141,-1620.6999511719,36.599998474121,241.908905,0,0) end addEventHandler("onClientResourceStart", resourceRoot , onPlayerCheckSkin) function onPlayerSaveSkin() local playerAcc = getPlayerAccount(source) if not isGuestAccount(playerAcc) then local playerSkin = getElementModel(source) setAccountData(playerAcc, "skin" , tostring(playerSkin)) end end addEventHandler("onPlayerQuit", root, onPlayerSaveSkin) function onPlayerLoadSkin(thePlayer) local playerAcc = getPlayerAccount(thePlayer) local playerSkin = tonumber(getAccountData(playerAcc, "skin")) end addEvent("makePed", true) addEventHandler("makePed", root, onPlayerLoadSkin) Oh i see i will help you
-
function onPlayerSaveSkin() local playerAcc = getPlayerAccount(source) if not isGuestAccount(playerAcc) then local playerSkin = getElementModel(source) setAccountData(playerAcc, "skin", tostring(playerSkin)) end end addEventHandler("onPlayerQuit", root, onPlayerSaveSkin) function onPlayerLoadSkin(thePlayer) local playerAcc = getPlayerAccount(thePlayer) local playerSkin = tonumber(getAccountData(playerAcc, "skin")) triggerClientEvent(thePlayer, "createSkinLogin", root, playerSkin) end function onPlayerCheckSkin(playerSkin) createPed(playerSkin or 0,-1600.9000244141,-1620.6999511719,36.599998474121,241.908905,0,0) end addEvent("createSkinLogin", true) addEventHandler("createSkinLogin", root, onPlayerCheckSkin)
-
Use getAccountData setAccountData triggerClientEvent addEvent addEventHandler
-
Use triggers event
-
No but for # is more Master than pairs
-
Pairs looks is faster than ipairs
-
function replaceModel() banner = engineLoadTXD("ce_payspray.txd") engineImportTXD( banner, 12978 ) dff = engineLoadDFF("sw_shed02.dff") engineReplaceModel( dff, 12978 ) end addEventHandler ( "onClientResourceStart", resourceRoot , replaceModel)
-
In show dx put getPlayerTeam getTeamName or getElementData
-
You want change position when you die?
-
Or use the interior system and when exit the store start the Timer
-
You need to download it and put it on resource folder of your server after start the resource and after export the function you want in your code
-
Create a marker and then check if player is out
-
On your server
-
local x,y = guiGetScreenSize()local sx, sy = x/1280, y/768 addEvent("StartRobTimer",true) addEventHandler("StartRobTimer",root,function() addEventHandler( "onClientRender", root, showRobTime ) Time = 300 tick = getTickCount() end) function showRobTime( ) if getElementData( localPlayer, "ArrestedBy" ) or getElementData(localPlayer,"Jailed") == "yes" or isPedDead ( localPlayer ) then removeEventHandler("onClientRender",root,showRobTime) triggerServerEvent("giveRobMoney",localPlayer,1) return end if getTickCount( )-tick >= 1000 then Time = Time -1 tick = getTickCount() end dxDrawText(Time.." seconds left ", sx*69, sy*728, sx*187, sy*758, tocolor(254, 0, 0, 255), 1.80, "default-bold", "left", "bottom", false, false, false, false, false) if Time <= 0 then removeEventHandler("onClientRender",root,showRobTime) triggerServerEvent("giveRobMoney",localPlayer) end end local wantedPoints = {}Timer= setTimer ( function () for _, plr in ipairs(Element.getAllByType("player")) do if (getWantedPoints(plr) and not getElementData(plr,"ArrestedBy")and not getElementData(plr,"Jailed") == true ) then if (getWantedPoints(plr) > 0) then setWantedPoints(plr, getWantedPoints(plr) - 1) end end end end, 60 * 1000, 0)function getWantedPoints(plr) if (plr and not plr.account.guest) then local a = plr.account.name if (not wantedPoints[a]) then wantedPoints[a] = getElementData(plr, "Wanted") or 0 end return wantedPoints[a] ndend function giveTheMoney(data) if(data == 1) then setElementData(source, "rob", false) exports.Messages:sendClientMessage("Store Robbery: The robbery ended because you were jailed/arrested!",source, 255, 100, 0) return end money = 3000 + math.random(100, 900) vip = getElementData(source, "viplevel") if vip == 2 then money = money+money*0.25 elseif vip == 3 then money = money+money*0.50 elseif vip == 4 then money = money+money*0.75 end givePlayerMoney(source, money) exports["Jobs"]:addJobMark(source, "Gangster", 1) setElementData(source, "rob", false) local textDisplay = textCreateDisplay() local textItem = textCreateTextItem("Robbery Successfull!You received: "..convertNumber(money).."$", 0.5, 0.5, 2, 208, 29, 37, 200, 4, "center", "center" ) textDisplayAddText(textDisplay, textItem) textDisplayAddObserver(textDisplay, source) setTimer(textDestroyTextItem, 5000, 1, textItem) setTimer(textDestroyDisplay, 5000, 1, textDisplay) local xdata = exports.bcho:getPlayerAccountData(source,"robs") if xdata == nil or xdata == 0 or xdata == false then xdata = 0 end exports.bcho:setPlayerAccountData(source,"robs",xdata+1) local xdata = exports.bcho:getPlayerAccountData(source,"robs") if xdata == 1 then exports.ucp:givePlayerAch(source,2) elseif xdata == 50 then exports.ucp:givePlayerAch(source,3) elseif xdata == 1000 then exports.ucp:givePlayerAch(source,4) end end addEvent("giveRobMoney", true) addEventHandler("giveRobMoney", root , giveTheMoney) function convertNumber ( number ) local formatted = number while true do formatted, k = string.gsub(formatted, "^(-?%d+)(%d%d%d)", '%1,%2') if ( k==0 ) then break end end return formatted end addEventHandler("onPlayerTarget", root , function(targetEl) if exports.bcho:isCriminal(source) then if(targetEl) then if(getElementType(targetEl) == "ped") then if(not getElementData(source, "rob")) then if(getElementData(targetEl, "robLoc") ~= false) then robloc = getElementData(targetEl, "robLoc") setElementData(source, "rob", robloc) setElementData(source, "Charges", tonumber(getElementData(source, "Charges"))+1000) if getElementInterior (source) == 0 then triggerClientEvent(source, "StartRobTimer", root) exports.Messages:sendClientMessage("Store Robbery: Don't get arrested/killed or you will fail the robbery",source, 255, 100, 0) end end end end end end end) addEventHandler("onResourceStop", resourceRoot , function() for k, v in ipairs(getElementsByType("player")) do setElementData(v, "rob", false) end end)
-
Well instead use command handler make a costum event and use event handler and triger it on play login event