-
Posts
1,491 -
Joined
-
Last visited
-
Days Won
3
Everything posted by Walid
-
onPlayerCommand()
-
sorry man i'm busy try to do it by yourself and post your code here
-
Use setAccountData(). -- Client side addEventHandler("onClientResourceStart",resourceRoot, function() local screenW, screenH = guiGetScreenSize() LicenseWindow = guiCreateWindow(208, 311, 164, 171, "", false) guiWindowSetSizable(LicenseWindow, false) guiSetVisible(LicenseWindow,false) BuyLicense = guiCreateButton(30, 63, 97, 47, "Buy Gun License", false, LicenseWindow) addEventHandler ( "onClientGUIClick", BuyLicense, license, false) end ) function guilicense() guiSetVisible(LicenseWindow, true) showCursor(true) end addEvent("CallGuiLicense",true) addEventHandler ("CallGuiLicense",getRootElement(),guilicense) function license () triggerServerEvent("license", getLocalPlayer()) guiSetVisible(LicenseWindow, false) showCursor(false) end -- Server side local gunlicensemarker = createMarker(-2586.7861328125,162.4683380127,-6.8921875953674,"cylinder",1.5,255,0,0,100) function licenseGUI (player,matchDim) if matchDim and isElement(player) and getElementType( player ) == "player" and not isPedInVehicle(player) then triggerClientEvent(player,"CallGuiLicense",player) end end addEventHandler("onMarkerHit",gunlicensemarker,licenseGUI) function gunlicense() local money = getPlayerMoney(source) local account = getPlayerAccount(source) if not isGuestAccount(account) then local lic = getAccountData(account,"Gun.license") or 0 if tonumber(lic) == 1 then outputChatBox("You already have Gun license",source,255,0,0,true) return end if (money > 5000) then takePlayerMoney(source,5000) setAccountData(account,"Gun.license",1) else outputChatBox("You dont have enough money",source,255,0,0,true) end end end addEvent("license",true) addEventHandler("license",getRootElement(),gunlicense)
-
you must add this in you server side. skinsTable = {} skinsTable.all = {} skinsTable.categories = {} also this ")" missing in line 35 function Skiny() local xml = xmlLoadFile("Skiny.xml") for index, category in pairs(xmlNodeGetChildren(xml)) do local cName = xmlNodeGetAttribute(category, "Nazwa") skinsTable.categories[cName] = {} for index, skin in pairs(xmlNodeGetChildren(category)) do local id, Nazwa = xmlNodeGetAttribute(skin, "Model"), xmlNodeGetAttribute(skin, "Nazwa") skinsTable.categories[cNames][id] = Nazwa skinsTable.all[id] = Nazwa end end xmlUnloadFile(xml) end addEventHandler("onResourceStart", resourceRoot, Skiny)
-
the problem in your meta.xml
-
function nadajkolory(_,cur) local r,g,b = 56 , 24 , 67 local a,b,c = setAccountData(cur, "kolor", r),setAccountData(cur, "kolor2", g),setAccountData(cur, "kolor3", b) triggerClientEvent(source, "kolorely", source, r,g,b) end addEventHandler("onPlayerLogin", getRootElement(), nadajkolory) function dajkolor(a, b, c) setVehicleColor(kar, tonumber(a)..","..tonumber(b)..","..tonumber(c)) outputChatBox(a..","..b..","..c) end addEvent("kolorely",true) addEventHandler("kolorely", root, dajkolor)
-
use onClientGUIDoubleClick()
-
replace getAccountData() with setAccountData() here
-
you are welcome
-
Thank you everyone. Everyone? Its Only Me lol anyway np Yeh i know i mean you and SkatCh anyways enjoy.
-
Do it by yourself and i will help you.
-
you are welcome try to use setAccountData()
-
try this one local TimeTable = {} local waitTime = 3000 -- 3 seconds local Blips = {} local details = {} local Entred = {} local Markers = { {522, 1986, -1478.1, 21.5, 17.500, "StantName Here"}, -- Marker 1 {522, 1114, -1822, 33.5, 17.500,"StantName Here"}, -- Marker 2 {522, 776.8, -1036, 39.5, 9000,"StantName Here"}, -- Marker 3 {522, 1313, -1163, 41, 7500,"StantName Here"}, -- Marker 4 {522, 1404, -806, 85, 7500,"StantName Here"}, -- Marker 5 {522, 775.7, -1060.5, 33.2, 5000,"StantName Here"}, -- Marker 6 } for i , v in pairs (Markers) do HitMarker = createMarker ( v[2], v[3], v[4], "corona", 1.20, 255, 0, 0, 255 ) Blips[HitMarker] = createBlipAttachedTo( HitMarker, 0 ) details[HitMarker] = {v[1],v[5],v[6]} end function allowedVehicles( hitElement, matchingDimension ) if matchingDimension and isElement(hitElement) and getElementType(hitElement) == "player" then if isPedInVehicle ( hitElement ) then local vehicle = getPedOccupiedVehicle ( hitElement ) if vehicle then if Entred[hitElement] == source then outputChatBox("Sorry you can't enter the marker twice" , hitElement,255,0,0) return end theTable = details[source] if (theTable) then model, cash, name = details[source][1], details[source][2], details[source][3] if getElementModel ( vehicle ) == model then TimeTable[hitElement] = setTimer(StuntComplete, waitTime, 1, hitElement,source) setElementData ( hitElement, "entered.marker", true ) Entred[hitElement] = source else outputChatBox ( "You have entered in Stunt with wrong vehicle", hitElement, 255, 0, 0 ) end end end end end end addEventHandler( "onMarkerHit", resourceRoot, allowedVehicles ) function StuntComplete (player,marker) if isElement ( player ) then if getElementData ( player, "entered.marker" ) then givePlayerMoney ( player, tonumber(cash)) outputChatBox ( "You have completed the Stunt and earned "..tonumber(cash).."$", player, 0, 255, 0 ) if isElement( Blips[marker] ) then setBlipColor ( Blips[marker], 0, 255, 0, 255 ) setMarkerColor (marker,0, 255, 0, 255 ) end local totalStunts = getElementData( player, "totalStunts" ) or 0 setElementData( player, "totalStunts" , tonumber(totalStunts)+1) end end end addEventHandler ( "onMarkerLeave", resourceRoot, function ( leaveElement ) if ( isElement ( leaveElement ) and getElementType ( leaveElement ) == "player" ) then setElementData ( leaveElement, "entered.marker", false ) outputChatBox("You failed the Stunt!", leaveElement, 255, 0, 0) end end ) function stuntsFinished ( player ) if isElement(player) then local count = getElementData( player, "totalStunts" ) or 0 outputChatBox( "You have finished "..tonumber(count).."/512 Stunts", player, 0, 255, 0) end end addCommandHandler("fstunts", stuntsFinished) Edit : Try it now
-
Man check the code before you start talking because i already changed every thing in it check this: local TimeTable = {} local waitTime = 3000 -- 3 seconds local Blips = {} local details = {} local Entred = {} local Markers = { {522, 1986, -1478.1, 21.5, 17.500, "StantName Here"}, -- Marker 1 {522, 1114, -1822, 33.5, 17.500,"StantName Here"}, -- Marker 2 {522, 776.8, -1036, 39.5, 9000,"StantName Here"}, -- Marker 3 {522, 1313, -1163, 41, 7500,"StantName Here"}, -- Marker 4 {522, 1404, -806, 85, 7500,"StantName Here"}, -- Marker 5 {522, 775.7, -1060.5, 33.2, 5000,"StantName Here"}, -- Marker 6 } for i , v in pairs (Markers) do HitMarker = createMarker ( v[2], v[3], v[4], "corona", 1.20, 255, 0, 0, 255 ) Blips[HitMarker] = createBlipAttachedTo( HitMarker, 0 ) details[HitMarker] = {v[1],v[5],v[6]} end function allowedVehicles( hitElement, matchingDimension ) if matchingDimension and isElement(hitElement) and getElementType(hitElement) == "player" then if isPedInVehicle ( hitElement ) then local vehicle = getPedOccupiedVehicle ( hitElement ) if vehicle then if Entred[hitElement] == source then outputChatBox("Sorry you can't enter the marker twice" , hitElement,255,0,0) return end if getElementModel ( vehicle ) == getElementData ( source, "model" ) then TimeTable[hitElement] = setTimer(StuntComplete, waitTime, 1, hitElement,source) setElementData ( hitElement, "entered.marker", true ) Entred[hitElement] = source else outputChatBox ( "You have entered in Stunt with wrong vehicle", hitElement, 255, 0, 0 ) end end end end end addEventHandler( "onMarkerHit", resourceRoot, allowedVehicles ) function StuntComplete (player,marker) if isElement ( player ) then if getElementData ( player, "entered.marker" ) then local theTable = details[marker] if (theTable) then local model, cash, name = details[marker][1], details[marker][2], details[marker][3] givePlayerMoney ( player, tonumber(cash)) outputChatBox ( "You have completed the Stunt and earned "..tonumber(cash).."$", player, 0, 255, 0 ) if isElement( Blips[marker] ) then setBlipColor ( Blips[marker], 0, 255, 0, 255 ) setMarkerColor (marker,0, 255, 0, 255 ) end local totalStunts = getElementData( player, "totalStunts" ) or 0 setElementData( player, "totalStunts" , tonumber(totalStunts)+1) end end end end addEventHandler ( "onMarkerLeave", resourceRoot, function ( leaveElement ) if ( isElement ( leaveElement ) and getElementType ( leaveElement ) == "player" ) then setElementData ( leaveElement, "entered.marker", false ) outputChatBox("You failed the Stunt!", leaveElement, 255, 0, 0) end end ) function stuntsFinished ( player ) if isElement(player) then local count = getElementData( player, "totalStunts" ) or 0 outputChatBox( "You have finished "..tonumber(count).."/512 Stunts", player, 0, 255, 0) end end addCommandHandler("fstunts", stuntsFinished)
-
Many things wrong in your code , sorry i can't fix them all i'm busy anyways try this one it should work. --these are the banned vehicle ids where you cannot get drift points. local BannedIDs = { 432, 532 } local rootElem = getRootElement() local thisRoot = getResourceRootElement(getThisResource()) local player = getLocalPlayer() local vehicle local size = 1.2 local modo = 0.01 local score = 0 local screenScore = 0 local tick local idleTime local multTime local driftTime local Yellow = tocolor(0,207,186) local rr,gg,bb = getPlayerNametagColor(player) local Yel = tocolor(rr,gg,bb) local Yelx = tocolor(255,0,0) local Red = tocolor(234,0,3) local TempCol = Yellow local TempCol2 = tocolor(rr,gg,bb) local mult = 1 local tablamult = {10,10,10,10} local anterior = 0 local mejor = 0 local total = 0 local global_mejor = 0 local global_nombre = "N/A" local screenWidth, screenHeight = guiGetScreenSize() local x1,y1,x2,y2 = screenWidth*0.2,screenHeight*0.1,screenWidth*0.8,screenHeight*0.8 addEventHandler("onClientResourceStart", thisRoot, function() addEventHandler("onClientRender", rootElem, showText) --outputChatBox("Waiting for server drift data...") triggerServerEvent("driftClienteListo", rootElem, player) triggerServerEvent ( "load", player) end ) addEventHandler("onClientResourceStop", thisRoot, function() removeEventHandler("onClientRender", rootElem, showText) end ) function isValidVehicle() local temp = getPedOccupiedVehicle(player) if not temp or getVehicleOccupant(temp,0) ~= player or getVehicleType(temp) ~= "Automobile" then return false end local vehID = getElementModel(temp) for k,v in ipairs(BannedIDs) do if vehID == v then return false end end return temp end function showText() theName = global_nombre theName = theName:gsub("#%x%x%x%x%x%x","") if getElementData(player,"renk") == 1 then --dxDrawText(string.format("En Çok Drift: %d / %s",global_mejor,theName),15,182,screenWidth,screenHeight,Yel,1.2,"sans") end if not getElementData(player,"renk") then --dxDrawText(string.format("En Çok Drift: %d / %s",global_mejor,theName),15,182,screenWidth,screenHeight,Yelx,1.2,"sans") end vehicle = isValidVehicle() if not vehicle then return end if size > 1.3 then modo = -0.01 elseif size < 1.2 then modo = 0.01 end size = size + modo tick = getTickCount() local angulo,velocidad = angle() local tempBool = tick - (idleTime or 0) < 750 if not tempBool and score ~= 0 then anterior = score --setElementData(player, "Last Drift", anterior) toti = getElementData(player,"Toplam drift") bes = getElementData(player,"En iyi drift") total = toti+anterior setElementData(player, "Toplam drift", total) triggerServerEvent("driftNuevoRecord", rootElem, total, getPlayerName(player)) triggerServerEvent ( "totaldrift", player,total) if score > bes then mejor = score setElementData(player, "En iyi drift", mejor) triggerServerEvent ( "bestdrift", player,mejor) end triggerEvent("onVehicleDriftEnd", rootElem, player) score = 0 end if angulo ~= 0 then if score == 0 then triggerEvent("onVehicleDriftStart", rootElem) driftTime = tick end if tempBool then score = score + math.floor(angulo*velocidad)*mult else score = math.floor(angulo*velocidad)*mult end if TempCol == Red then TempCol = Yellow end screenScore = score idleTime = tick end --local temp2 = string.format("Factor: X%d\n%s",mult,mult~=5 and string.format("Gain X%d with %d",mult+1,tablamult[mult]) or "MAX") --dxDrawText(temp2, 20,155,screenWidth,screenHeight, Yellow, 1.2, "sans","left","top", false,true,false) if velocidad <= 0.3 and mult ~= 1 then --dxDrawText("\n\nToo Slow!", 20,155,screenWidth,screenHeight, Yellow, 1.2, "sans","left","top", false,true,false) end if tick - (idleTime or 0) < 3000 then local temp = "DRIFT" if score >= 100000 then temp = "DRIFT\n\nDrift Kralı!" elseif score >= 50000 then temp = "DRIFT\n\nDeli Drift!" elseif score >= 20000 then temp = "DRIFT\n\nMuhteşem!" elseif score >= 15000 then temp = "DRIFT\n\nMükemmel!" elseif score >= 7000 then temp = "DRIFT\n\nSüper Drift!" elseif score >= 3000 then temp = "DRIFT\n\nIyi Drift!" elseif score >= 1000 then temp = "DRIFT\n\nGüzel Drift!" end theName = global_nombre theName = theName:gsub("#%x%x%x%x%x%x","") if not getElementData(player,"renk") then dxDrawText(temp, x1,y1,x2,y2, TempCol, 2.2, "sans","center","top", false,true,false) dxDrawText(string.format("\n%d",screenScore), x1,y1-10,x2,y2, TempCol, size, "pricedown","center","top", false,true,false) end if getElementData(player,"renk") == 1 then dxDrawText(temp, x1,y1,x2,y2, TempCol2, 2.2, "sans","center","top", false,true,false) dxDrawText(string.format("\n%d",screenScore), x1,y1-10,x2,y2, TempCol2, size, "pricedown","center","top", false,true,false) end end end function angle() local vx,vy,vz = getElementVelocity(vehicle) local modV = math.sqrt(vx*vx + vy*vy) if not isVehicleOnGround(vehicle) then return 0,modV end local rx,ry,rz = getElementRotation(vehicle) local sn,cs = -math.sin(math.rad(rz)), math.cos(math.rad(rz)) local deltaT = tick - (multTime or 0) if mult~= 1 and modV <= 0.3 and deltaT > 750 then mult = mult-1 multTime = tick elseif deltaT > 1500 then local temp = 1 if score >= 10 then temp = 5 end if temp>mult then mult = temp multTime = tick end end if modV <= 0.2 then return 0,modV end --speed over 40 km/h local cosX = (sn*vx + cs*vy)/modV if cosX > 0.966 or cosX < 0 then return 0,modV end --angle between 15 and 90 degrees return math.deg(math.acos(cosX))*0.5, modV end addEvent("driftCarCrashed", true) addEventHandler("driftCarCrashed", rootElem, function() if score ~= 0 then score = 0 mult = 0 TempCol = Red triggerEvent("onVehicleDriftEnd", rootElem, source) triggerServerEvent ( "takemoney", player) end end ) addEvent("driftActualizarRecord", true) addEventHandler("driftActualizarRecord", rootElem, function(score, name) global_mejor = score global_nombre = name end ) function resetScore() anterior,mejor,total = 0,0,0 --setElementData(player, "Last Drift", anterior) setElementData(player, "Toplam drift", total) setElementData(player, "En iyi drift", mejor) end addEvent("driftResetAllScores", true) addEventHandler("driftResetAllScores", rootElem, resetScore) addCommandHandler("resetdrift", resetScore) function resetScore() if not getELementData(player,"Toplam drift") and not getElementData(player,"En iyi drift") then setElementData(player, "Toplam drift",0) setElementData(player, "En iyi drift",0) end end addEventHandler("onPlayerJoin", rootElem, resetScore) function asd(player) givePlayerMoney(player,1) -- money here outputChatBox("test",player,255,0,0) end addEvent("onVehicleDriftEnd", true) addEventHandler("onVehicleDriftEnd", getRootElement(), asd)
-
add my code server side
-
Np here is your code local TimeTable = {} local waitTime = 3000 -- 3 seconds local Blips = {} local details = {} local Markers = { {522, 1986, -1478.1, 21.5, 17.500, "StantName Here"}, -- Marker 1 {522, 1114, -1822, 33.5, 17.500,"StantName Here"}, -- Marker 2 {522, 776.8, -1036, 39.5, 9000,"StantName Here"}, -- Marker 3 {522, 1313, -1163, 41, 7500,"StantName Here"}, -- Marker 4 {522, 1404, -806, 85, 7500,"StantName Here"}, -- Marker 5 {522, 775.7, -1060.5, 33.2, 5000,"StantName Here"}, -- Marker 6 } for i , v in pairs (Markers) do HitMarker = createMarker ( v[2], v[3], v[4], "corona", 1.20, 255, 0, 0, 255 ) Blips[HitMarker] = createBlipAttachedTo( HitMarker, 0 ) details[HitMarker] = {v[1],v[5],v[6]} end function allowedVehicles( hitElement, matchingDimension ) if matchingDimension and isElement(hitElement) and getElementType(hitElement) == "player" then if isPedInVehicle ( hitElement ) then local vehicle = getPedOccupiedVehicle ( hitElement ) if vehicle then local alreadyEntred = getElementData ( hitElement, "entered.marker") if alreadyEntred then outputChatBox("Sorry you can't enter the marker twice" , hitElement,255,0,0) return end if getElementModel ( vehicle ) == getElementData ( source, "model" ) then TimeTable[hitElement] = setTimer(StuntComplete, waitTime, 1, hitElement,source) setElementData ( hitElement, "entered.marker", true ) else outputChatBox ( "You have entered in Stunt with wrong vehicle", hitElement, 255, 0, 0 ) end end end end end addEventHandler( "onMarkerHit", resourceRoot, allowedVehicles ) function StuntComplete (player,marker) if isElement ( player ) then if getElementData ( player, "entered.marker" ) then local theTable = details[marker] if (theTable) then local model, cash, name = details[marker][1], details[marker][2], details[marker][3] givePlayerMoney ( player, tonumber(cash)) outputChatBox ( "You have completed the Stunt and earned "..tonumber(cash).."$", player, 0, 255, 0 ) if isElement( Blips[marker] ) then setBlipColor ( Blips[marker], 0, 255, 0, 255 ) setMarkerColor (marker,0, 255, 0, 255 ) end local totalStunts = getElementData( player, "totalStunts" ) or 0 setElementData( player, "totalStunts" , tonumber(totalStunts)+1) end end end end addEventHandler ( "onMarkerLeave", resourceRoot, function ( leaveElement ) if ( isElement ( leaveElement ) and getElementType ( leaveElement ) == "player" ) then setElementData ( leaveElement, "entered.marker", false ) outputChatBox("You failed the Stunt!", leaveElement, 255, 0, 0) end end ) function stuntsFinished ( player ) if isElement(player) then local count = getElementData( player, "totalStunts" ) or 0 outputChatBox( "You have finished "..tonumber(count).."/512 Stunts", player, 0, 255, 0) end end addCommandHandler("fstunts", stuntsFinished)
-
Try this one local TimeTable = {} local waitTime = 3000 -- 3 seconds local Blips = {} local Markers = { {522, 1986, -1478.1, 21.5, 17.500, "StantName Here"}, -- Marker 1 {522, 1114, -1822, 33.5, 17.500,""}, -- Marker 2 {522, 776.8, -1036, 39.5, 9000,""}, -- Marker 3 {522, 1313, -1163, 41, 7500,""}, -- Marker 4 {522, 1404, -806, 85, 7500,""}, -- Marker 5 {522, 775.7, -1060.5, 33.2, 5000,""}, -- Marker 6 } for i , v in pairs (Markers) do HitMarker = createMarker ( v[2], v[3], v[4], "corona", 1.20, 255, 0, 0, 255 ) Blips[HitMarker] = createBlipAttachedTo( HitMarker, 0 ) setElementData ( HitMarker, "model", v[1] ) setElementData ( HitMarker, "cash", v[5] ) setElementData ( HitMarker, "markerName", v[6] ) end function allowedVehicles( hitElement, matchingDimension ) if matchingDimension and isElement(hitElement) and getElementType(hitElement) == "player" then if isPedInVehicle ( hitElement ) then local vehicle = getPedOccupiedVehicle ( hitElement ) if vehicle then if getElementModel ( vehicle ) == getElementData ( source, "model" ) then TimeTable[hitElement] = setTimer(StuntComplete, waitTime, 1, hitElement,source) setElementData ( hitElement, "entered.marker", true ) else outputChatBox ( "You have entered in Stunt with wrong vehicle", hitElement, 255, 0, 0 ) end end end end end addEventHandler( "onMarkerHit", resourceRoot, allowedVehicles ) function StuntComplete ( player,marker) if isElement ( player ) then if getElementData ( player, "entered.marker" ) then givePlayerMoney ( player, tonumber(getElementData (marker, "cash"))) outputChatBox ( "You have completed the Stunt and earned "..tonumber(getElementData (marker, "cash")).."$", player, 0, 255, 0 ) if isElement( Blips[marker] ) then setBlipColor ( Blips[marker], 0, 255, 0, 255 ) setMarkerColor (marker,0, 255, 0, 255 ) end local totalStunts = getElementData( player, "totalStunts" ) or 0 setElementData( player, "totalStunts" , tonumber(totalStunts)+1) end end end addEventHandler ( "onMarkerLeave", resourceRoot, function ( leaveElement ) if ( isElement ( leaveElement ) and getElementType ( leaveElement ) == "player" ) then setElementData ( leaveElement, "entered.marker", false ) outputChatBox("You failed the Stunt!", leaveElement, 255, 0, 0) end end ) function stuntsFinished ( player ) if isElement(player) then local count = getElementData( player, "totalStunts" ) or 0 outputChatBox( "You have finished "..tonumber(count).."/512 Stunts", player, 0, 255, 0) end end addCommandHandler("fstunts", stuntsFinished)
-
Try this local TimeTable = {} local waitTime = 3000 -- 3 seconds local Blips = {} local Markers = { {522, 1986, -1478.1, 21.5, 17.500}, -- Marker 1 {522, 1114, -1822, 33.5, 17.500}, -- Marker 2 {522, 776.8, -1036, 39.5, 9000}, -- Marker 3 {522, 1313, -1163, 41, 7500}, -- Marker 4 {522, 1404, -806, 85, 7500}, -- Marker 5 {522, 775.7, -1060.5, 33.2, 5000}, -- Marker 6 } for i , v in pairs (Markers) do HitMarker = createMarker ( v[2], v[3], v[4], "corona", 1.20, 255, 0, 0, 255 ) Blips[HitMarker] = createBlipAttachedTo( HitMarker, 0 ) setElementData ( HitMarker, "model", v[1] ) setElementData ( HitMarker, "cash", v[5] ) setElementData ( HitMarker, "markerName", v[6] ) end function allowedVehicles( hitElement, matchingDimension ) if matchingDimension and isElement(hitElement) and getElementType(hitElement) == "player" then if isPedInVehicle ( hitElement ) then local vehicle = getPedOccupiedVehicle ( hitElement ) if vehicle then if getElementModel ( vehicle ) == getElementData ( source, "model" ) then TimeTable[hitElement] = setTimer(StuntComplete, waitTime, 1, hitElement,source) setElementData ( hitElement, "entered.marker", true ) else outputChatBox ( "You have entered in Stunt with wrong vehicle", hitElement, 255, 0, 0 ) end end end end end addEventHandler( "onMarkerHit", resourceRoot, allowedVehicles ) function StuntComplete ( player,marker) if isElement ( player ) then if getElementData ( player, "entered.marker" ) then givePlayerMoney ( player, tonumber(getElementData (marker, "cash"))) outputChatBox ( "You have completed the Stunt and earned "..tonumber(getElementData (marker, "cash")).."$", player, 0, 255, 0 ) if isElement( Blips[marker] ) then setBlipColor ( Blips[marker], 0, 255, 0, 255 ) setMarkerColor (marker,0, 255, 0, 255 ) local totalStunts = getElementData( player, "totalStunts" ) setElementData( player, "totalStunts" , tonumber(totalStunts)+1) end end end end addEventHandler ( "onMarkerLeave", resourceRoot, function ( leaveElement ) if ( isElement ( leaveElement ) and getElementType ( leaveElement ) == "player" ) then setElementData ( leaveElement, "entered.marker", false ) outputChatBox("You failed the Stunt!", leaveElement, 255, 0, 0) end end ) function stuntsFinished ( player ) if isElement(player) then local count = getElementData( player, "totalStunts" ) or 0 outputChatBox( "You have finished "..tonumber(count).."/512 Stunts", player, 0, 255, 0) end end addCommandHandler("fstunts", stuntsFinished)
-
addEventHandler("onResourceStart",getResourceRootElement(getThisResource()), function() call(getResourceFromName("scoreboard"),"addScoreboardColumn","fps") end )
-
Try to use string.format("%02d:%02d",.......,...........)
-
You mus use sth like this -- Give player weapons addEventHandler("onPlayerSpawn", root, function ( ) local account = getPlayerAccount(source) if (account) and not (isGuestAccount(account)) then local weapons = getAccountData(account, "weapons") if (weapons) then takeAllWeapons(source) for weapon, ammo in pairs(fromJSON(weapons)) do giveWeapon(source, weapon, ammo, true) end end end end) -- Save player weapons when he die addEventHandler("onPlayerWasted", root, function ( ) local account = getPlayerAccount(source) if (account) and not (isGuestAccount(account)) then local weapons = getAllPedWeapon(source) setAccountData(account, "weapons", toJSON(weapons)) end end) -- check all player weapons function getAllPedWeapon(thePed) if (isPedDead(source)) then return end local weapons = { } for slot=1, 12 do local weapon = getPedWeapon(thePed, slot) local ammo = getPedTotalAmmo(thePed, slot) if (weapon > 0) and (ammo > 0) then weapons[weapon] = ammo end end return weapons end