-
Posts
1,491 -
Joined
-
Last visited
-
Days Won
3
Everything posted by Walid
-
didn't work because: source: not defined in your code. player: same thing with player. Try to use "onPlayerVehicleEnter" or just get a table of all the vehicles that exist and loop through it. Example: local g_ArmedVehicles = {[425] = true,[447] = true,[520] = true,[430] = false,[464] = false,[432] = true} function checkNoDMGreen() local vehicles = getElementsByType ( "vehicle" ) for _, vehicle in ipairs(vehicles) do if g_ArmedVehicles[getElementModel(vehicle)] then local invicsible = getElementData(vehicle,"invincible") local green = getElementData(vehicle,"green") if invicible or green then local player = getVehicleController (vehicle) if player then toggleControl(player, 'vehicle_fire', false) toggleControl(player, 'vehicle_secondary_fire', false) end end end end end setTimer(checkNoDMGreen,100,0)
-
you can use sth like this -- Example: local example = "an example string" for i in string.gmatch(example, "%S+") do outputChatBox(i) end
-
For triggerServerEvent, client is always set. i.e.: triggerServerEvent("EventName" , localPlayer) source is localPlayer client is localPlayer triggerServerEvent("EventName" , resourceRoot or root) source is resourceRoot or root client is localPlayer -- Server side function acceptjob() setElementData(client, "Job", "Fishermen") setElementData(client, "Fishermen", true) outputChatBox("You are now a fisherman!", client, 255, 255, 0) setPlayerTeam(client, getTeamFromName("Services")) end addEvent("acceptjob", true) addEventHandler("acceptjob", getRootElement(), acceptjob) -- Client side addEventHandler("onClientGUIClick",resourceRoot,function() if (source == accept) then guiSetVisible(window,false) showCursor(false) triggerServerEvent("acceptjob", localPlayer) elseif ( source == cancel) then guiSetVisible(window,false) showCursor(false) end end )
-
-- Client side -- output event stuff function output (text,name) if text and name then t , n = text , name addEventHandler ( "onClientRender", getRootElement(), drawEvent) setTimer(removeEventDraw,10000,1) end end addEvent("sendText", true) addEventHandler("sendText", getRootElement(), output) -- remove draw event after 10 seconds function removeEventDraw () removeEventHandler ( "onClientRender", getRootElement(), drawEvent ) end -- draw event message local screenW, screenH = guiGetScreenSize ( ) function drawEvent() dxDrawText(t.."[Hosted by "..n.."]", screenW*(280/1980), 30, screenW*(280/1980), 30, tocolor(254, 254, 254, 255), 1,"default", "center", "top", false, false, true, true, false) end --Server side: function events(thePlayer,_, ...) local nametags_Players = getElementsByType('player') if exports.staff:isPlayerStaff(thePlayer) then for i,allPlayers in ipairs(nametags_Players) do local message = table.concat({...}, ' ') if message and message ~= "" then local name = getPlayerName(thePlayer) triggerClientEvent(allPlayers, "sendText", getRootElement(), message,name) end end end end addCommandHandler("event",events)
-
try to use this local FishingSpot = createMarker(494.214, -1925.360, -0.550, 'cylinder', 5.0, 0, 0, 255, 150) local FishingSpot2 = createMarker(469, -1941.166015625, -0, 'cylinder', 5.0, 0, 0, 255, 150) local markers = {FishingSpot,FishingSpot2} local blips = {} for i=1,#markers do setElementID(markers[i], "marker".. i) blips[markers[i]] = createBlipAttachedTo(markers[i], 41) end
-
Just remove setTimer function here:
-
Both are correct and both have the bodypart argument.
-
Replace "onPlayerDamage" with "onPlayerWasted" here and change the event arguments.
-
it's an event not a function. anyways all what you need is: -- Function getPlayerWantedLevel() setPlayerWantedLevel() setElementPosition() getElementType() -- Events onPlayerWasted
-
Untested (i'm using the phone) *Client side -- output event stuff function output (text,name) text = text name = name addEventHandler ( "onClientRender", getRootElement(), drawEvent) setTimer(removeEventDraw,10000,1) end addEvent("sendText", true) addEventHandler("sendText", getRootElement(), output) -- remove draw event after 10 seconds function removeEventDraw () removeEventHandler ( "onClientRender", getRootElement(), drawEvent ) end -- draw event message local screenW, screenH = guiGetScreenSize ( ) function drawEvent() dxDrawText(text.."[Hosted by "..name.."]", screenW*(280/1980), 30, screenW*(280/1980), 30, tocolor(254, 254, 254, 255), 1,"default", "center", "top", false, false, true, true, false) end *Server side function events(thePlayer,_, ...) local nametags_Players = getElementsByType('player') if exports.staff:isPlayerStaff(thePlayer) then for i,allPlayers in ipairs(nametags_Players) do local message = table.concat({...}, ' ') if message and message ~= "" then local name = getPlayerName(thePlayer) triggerClientEvent(allPlayers, "sendText", getRootElement(), message,name) end end end end addCommandHandler("event",events)
-
Try this one function experience () for i, pPlayer in ipairs( getElementsByType( "player" ) ) do local pAccount = getPlayerAccount( pPlayer ) if pAccount and not isGuestAccount(pAccount) then local exps = getAccountData(pAccount, "exp") or 0 local lvls = getAccountData(pAccount, "lvl") or 0 local needexp = lvls * 4 if exps ~= 0 then setAccountData(pAccount, "exp", tonumber(exps) + 1) if exps == needexp then setAccountData(pAccount, "lvl", tonumber(lvls) + 1) setAccountData(pAccount, "exp", 1) outputChatBox("Ваш уровень повышен до " .. lvls + 1 .. "!",pPlayer, 0, 255, 0) end else setAccountData(pAccount, "exp", 1) setAccountData(pAccount, "allexp", 1) setAccountData(pAccount, "lvl", 1) outputChatBox("Ваш опыт: " ..tonumber(exps).. "/" ..tonumber(needexp),pPlayer, 0, 255, 0) end end end end setTimer(experience, 3600000, 0) function nilexp (thePlayer) local account = getPlayerAccount(thePlayer) if account and not isGuestAccount(account) then setAccountData(account, "exp", 1) setAccountData(account, "lvl", 1) end end addCommandHandler("nilexp", nilexp) function command (thePlayer) local account = getPlayerAccount(thePlayer) if account and not isGuestAccount(account) then local exps = getAccountData(account, "exp") or 0 local lvls = getAccountData(account, "lvl") or 0 local needexp = lvls * 4 outputChatBox("Ваш опыт: " ..tonumber(exps).. "/" ..tonumber(needexp)..".", thePlayer, 0, 255, 0) outputChatBox("Ваш уровень: " ..tonumber(lvls).. ".", thePlayer, 0, 255, 0) end end addCommandHandler("level", command)
-
Try this ------------>> local screenW, screenH = guiGetScreenSize ( ) function renderNewLocation() local x,y,z = getElementPosition(localPlayer) local zone = getZoneName(x, y, z) if (zone == "El Castillo del Diablo") then zone = "Ghost Town" end dxDrawText(zone, screenW*(280/1980), 30, screenW*(280/1980), 30, tocolor(254, 254, 254, 255), scale,"bankgothic", "center", "top", false, false, true, true, false) end addEventHandler("onClientRender",root,renderNewLocation)
-
wrong section post it here or here
-
check this: --Example 1: local teams = { ["Team1"] = teamName1; ["Team2"] = teamName2; } -- then you can use this to get the team from name local theTeam = getTeamFromName(teams["Team1"]) -- Example 2 local teams = { team1 = teamName1; team2 = teamName2; } -- and you can use this to get the team from name local theTeam = getTeamFromName(teams.team1)
-
Thanks alot, but u can delete the code? due to the stealers. Lol you already using leaked resource. :fp: .
-
try to use tables. local music = {} music[localPlayer] = ...
-
getPlayerWeapons(): There is no function called getPlayerWeapons. player: it's not defined in your code. weaponID: it's not defined in your code. weaponAmmo: Also it's not defined in your code. Same thing with ammotype. end expected to close the function at line 10 and 11.
-
Here is what you need local chars = {',','-','+'} function convert(player, cmd, amount) local account = getPlayerAccount(player) if account and not isGuestAccount(account) then local accountName = getAccountName(account) local vip = getElementData(player, "CISvip") or 0 if vip ~= 0 then for _,chr in ipairs(chars) do amount = amount:gsub(chr,'') end if (amount) and tonumber(amount) then if tonumber(amount) <= vip then local cash = math.ceil(amount*10000) exports.CISvip:removePlayerVIP(accountName,tonumber(amount)) exports.CISaccounts:GPM(player, cash, "converted "..amount.." VIP Hours for "..cash) outputChatBox("You have successfully converted "..amount.." VIP hours to $"..cash.."", player, 0, 255, 0) else outputChatBox("You can't convert more than you have",player,255,0,0) end else outputChatBox("[usage]/convertviptomoney ",player,255,0,0) end else outputChatBox("You don't have VIP hours to convert!", player, 255, 0, 0) end end end addCommandHandler("convertviptomoney", convert)
-
:fp: don't ask for ready codes , do it by yourself then post your code here.
-
You can't see every thing using debugscript 3 , Try using outputDebugString to see what the problem is.
-
all what you need is: getSlotFromWeapon() getPedTotalAmmo() giveWeapon()