-
Posts
1,546 -
Joined
-
Last visited
Everything posted by Dimos7
-
function jailCell(thePlayer) toggleControl(thePlayer, "fire", false) toggleControl(thePlayer, "previouse_weapon", false) if isKeyBound("F1", "down") then cancelEvent() end toggleControl(thePlayer, "next_weapon", false) toggleControl(thePlayer, "anim_weapon", false) setPedWeaponSlot(thePlayer, 0) end add this to jail script and i guess will work
-
that was example not working code omg
-
local cell = createObject(2930, 1562.3000488281, -1634.3800048828, -87.699996948242, 0,0,90) setElementInterior (cell, 6) function open() moveObject(cell, 3000, 1560.6, -1634.3800048828, -87.699996948242, 0,0,0) end addCommandHandler("AD1o", open) addCommandHandler("ADopenall", open) function close() moveObject(cell, 3000, 1562.3000488281, -1634.3800048828, -87.699996948242, 0,0,0) end addCommandHandler("AD1c", close) addCommandHandler("ADcloseall", open)
-
local Ranks = { {"Cadet", 1}, {"Officer", 2}, {"Senior Officer", 3} {"Sergeant", 4} {"Lieutenant", 5} {"Captain", 6}, {"Deputy Chief", 7} {"Chief", 8} } function rankAPlayer(thePlayer) for i = 1, #Ranks do if not Rank[i] then Rank[i] = source setElementData(source, "Rank", i) break; connect = dbConnect("sqlite", "simple.db") dbExec(connect, "CREATE TABLE IF NOT EXIST `faction` (`name`, `faction`, `rank`)") dbExec(connect, "INSERT INTO faction (name, faction ,rank) VALUES", getPlayerName(source), getElementData(source, "faction"), i) end end enda
-
function blipPlayer(thePlayer) for _, v in ipairs (getElementsByType("player")) do if not thePlayer then local r, g, b = getPlayerNametagColor(v) createBlipAttachedTo(v, 0, 2, r, g, b, 255) end end end addEventHandler("onResourceStart", resourceRoot, blipPlayer)
-
function blipPlayer() for _, v in ipairs (getElementsByType("player")) do local r, g, b = getPlayerNametagColor(v) createBlipAttachedTo(v, 0, 2, r, g, b, 255) end end
-
function wio() health = getElementHealth(source) if health > 100 then setElementHealth(source, health+1) end end addEventHandler("onPlayerDamagae", root, wio) function oiu() timer = setTimer(wio, 400, 30, source) end addEventHandler("onPlayerDamagae", root, oiu)
-
function medkit(attacker, weapon) if weapon == (medkitid) then healTimer = setTimer( function() heal = getElementHealth(source) if (heal < 100) then setElementHealth(source, heal+5) elseif (isTimer(healTimer)) then killTimer(healTimer) end end, 5000, 20, source) end end addEventHandler("onPlayerDamage", root, medkit)
-
if its team you can make it like this: local gate = createObject ( 10828, 276.60000610352, 2503.3000488281, 28.10000038147, 0, 0, 90 ) local state = 0 function move(thePlayer) local team = getPlayerTeam(thePlayer) if (team == "team name here") then if state == 0 then moveObject ( gate, 4000, 276.5, 2537.1999511719, 28.10000038147) state = state + 1 elseif state == 1 then moveObject ( gate, 4000, 276.60000610352, 2503.3000488281, 28.10000038147) state = state - 1 end end end addCommandHandler("gate", move) if tis group like that do like this local gate = createObject ( 10828, 276.60000610352, 2503.3000488281, 28.10000038147, 0, 0, 90 ) local state = 0 function move(thePlayer) local group = getElementData(thePlayer, "Groups") if (group == "group name here") then if state == 0 then moveObject ( gate, 4000, 276.5, 2537.1999511719, 28.10000038147) state = state + 1 elseif state == 1 then moveObject ( gate, 4000, 276.60000610352, 2503.3000488281, 28.10000038147) state = state - 1 end end end addCommandHandler("gate", move)
-
function playerOnVehicle(thePlayer) local vehplayer = getPedOccupiedVehicle(thePlayer) if not (getElementModel(vehplayer) == 582) then outputChatBox("You are not in news car!", thePlayer, 255, 0, 0) end end
-
ipairs is slower and stop everythme for somethin pairs not do that
-
Can explane it better english please not understand what you want
-
is your player in team LSPD? if not then will not work
-
addEventHandler("onPlayerLogin", root, function() outputChatBox(getPlayerName(source).."has logged in as "..aclGroupGetName(aclGetGroup()), 211, 211, 211) end)
-
function ticket(thePlayer, commandName, targetPlayerNick, price, ...) local logged = getElementData(thePlayer, "login") local targetPlayer, targetPlayerName =findPlayerByPartialNick(thePlayer, targetPlayerNick) local hoursplayed = getElementData(targetPlayer, "hoursplay") if targetPlayer then if (logged==1) then local theTeam = getPlayerTeam(thePlayer) local factionType = getElementData(theTeam, "type") if (factionType==2) then if not (targetPlayerNick) or not (price) or not (...) then outputChatBox("SYNTAX: /" .. commandName .. " [Player Partial Nick] [Amount] [Reason]", thePlayer, 255, 194, 14) elseif hoursplayed<= 2 then outputChatBox("This person is less then hoursplayed!", thePlayer, 255, 0, 0) else price= tonumber(price) if (price>= 61) then outputChatBox("This is too much to ask for.", thePlayer, 255, 0, 0) else local x, y, z = getElementPosition(thePlayer) local tx, ty, tz = getElementPosition(targetPlayer) local distance = getDistanceBetweenPoints3D(x, y, z, tx, ty, tz) if (distance >= 10) then outputChatBox("You are too far away '".. targetPlayerName .."'.", thePlayer, 255, 0, 0) else local reason = table.concat({...}, " ") local money = getMoney(targetPlayer) local bankmoney = getElementData(targetPlayer, "bankmoney") if money + bankmoney >= 1 then if money + bankmoney < amount then outputChatBox("The player cannot afford the ticket(not money).", thePlayer, 255, 0, 0) else local takeFromCash = math.min( money, amount ) local takeFromBank = amount - takeFromCash if targetPlayer and commandName == "accept" then takeMoney(targetPlayer, takeFromCash) end -- Distribute money between the PD and Government local tax = exports.global:getTaxAmount() giveMoney( theTeam, math.ceil((1-tax)*price) ) giveMoney( getTeamFromName("Government of Los Santos"), math.ceil(tax*amount) ) outputChatBox("You ticketed " .. targetPlayerName .. " for " .. formatMoney(amount) .. ". Reason: " .. reason .. ".", thePlayer) outputChatBox("You were ticketed for " .. formatMoney(amount) .. " by " .. getPlayerName(thePlayer) .. ". Reason: " .. reason .. ".", targetPlayer) if takeFromBank > 0 then outputChatBox("Since you don't have enough money with you, $" .. formatMoney(takeFromBank) .. " have been taken from your bank account.", targetPlayer) end end end end end end end end end end addCommandHandler("ticket", ticket, false, false)
-
function ticket(thePlayer, commandName, targetPlayerNick, price, ...) local logged = getElementData(thePlayer, "login") local targetPlayer, targetPlayerName =findPlayerByPartialNick(thePlayer, targetPlayerNick) local hoursplayed = getElementData(targetPlayer, "hoursplay") if targetPlayer then if (logged==1) then local theTeam = getPlayerTeam(thePlayer) local factionType = getElementData(theTeam, "type") if (factionType==2) then if not (targetPlayerNick) or not (price) or not (...) then outputChatBox("SYNTAX: /" .. commandName .. " [Player Partial Nick] [Amount] [Reason]", thePlayer, 255, 194, 14) elseif hoursplayed<= 2 then outputChatBox("This person is less then hoursplayed!", thePlayer, 255, 0, 0) else price= tonumber(price) if (price>= 61) then outputChatBox("This is too much to ask for.", thePlayer, 255, 0, 0) else local x, y, z = getElementPosition(thePlayer) local tx, ty, tz = getElementPosition(targetPlayer) local distance = getDistanceBetweenPoints3D(x, y, z, tx, ty, tz) if (distance >= 10) then outputChatBox("You are too far away '".. targetPlayerName .."'.", thePlayer, 255, 0, 0) else local reason = table.concat({...}, " ") local money = getMoney(targetPlayer) local bankmoney = getElementData(targetPlayer, "bankmoney") if money + bankmoney >= 1 then if money + bankmoney < amount then outputChatBox("The player cannot afford the ticket(not money).", thePlayer, 255, 0, 0) else local takeFromCash = math.min( money, amount ) local takeFromBank = amount - takeFromCash if commandName == "accept" then takeMoney(targetPlayer, takeFromCash) end -- Distribute money between the PD and Government local tax = exports.global:getTaxAmount() giveMoney( theTeam, math.ceil((1-tax)*price) ) giveMoney( getTeamFromName("Government of Los Santos"), math.ceil(tax*amount) ) outputChatBox("You ticketed " .. targetPlayerName .. " for " .. formatMoney(amount) .. ". Reason: " .. reason .. ".", thePlayer) outputChatBox("You were ticketed for " .. formatMoney(amount) .. " by " .. getPlayerName(thePlayer) .. ". Reason: " .. reason .. ".", targetPlayer) if takeFromBank > 0 then outputChatBox("Since you don't have enough money with you, $" .. formatMoney(takeFromBank) .. " have been taken from your bank account.", targetPlayer) end end end end end end end end end end addCommandHandler("ticket", ticket, false, false)
-
yes sorry about that mistake
-
teampolice = createTeam ( "LSPD", 0, 0, 255 ) LSPDgateMoving = false LSPDgateMoved = false LSPDGate1 = createObject ( 971, 1589.0352783203, -1638.1243896484, 15.08652305603, 0, 0, 180 ) LSPDGate2 = createObject ( 2930, 1582.5673828125, -1637.8597412109, 15.019668579102, 0, 0, 90 ) function mv_func ( player ) local team = getPlayerTeam(player) if (getTeamName(team)== "LSPD")) then if getDistanceBetweenPoints3D ( 1589.0352783203, -1638.1243896484, 15.08652305603, getElementPosition ( player ) ) < 17 then if LSPDgateMoved == false then moveObject ( LSPDGate1, 3000, 1597.0734863281, -1638.0965576172, 15.08652305603 ) moveObject ( LSPDGate2, 1500, 1580.8779296875, -1637.8725585938, 15.019668579102 ) LSPDgateMoved = true else moveObject ( LSPDGate1, 3000, 1589.0352783203, -1638.0965576172, 15.08652305603 ) moveObject ( LSPDGate2, 1500, 1582.5673828125, -1637.8597412109, 15.019668579102 ) LSPDgateMoved = false end end end end addCommandHandler ( "gate", mv_func )
-
function hospital if (source == hospitalButton) then exports.texts.output("You are now on LV Hospital", 0, 255, 0) setElementPosition(localPlayer, 1614, 1817, 10) takePlayerMoney(amount) end end addEventHandler("onClientGUIClick", guiRoot, hospital)
-
myGate1 = createObject ( 3037, -2694.6999511719, 1394.5999755859, 8.3000001907349, 0, 0, 90 ) function openMyGate ( ) local account= getAccountName(getPlayerAccount(source)) if isObjectInACLGroup("user."..account, aclGetGroup("OMEGA")) then moveObject(myGate1, 3037, -2694.6999511719, 1394.5999755859, 3.000000) end end addCommandHandler("baseopen",openMyGate) function closeMyGate ( ) local account = getAccountName(getPlayerAccount(source)) if isObjectInACLGroup("user."..account,aclGetGroup("OMEGA")) then moveObject ( myGate1, 3037, -2694.6999511719, 1394.5999755859, 8.3100004196167 ) end end addCommandHandler("baseclose",closeMyGate)
-
<meta> <script src ="name script.lua" type="the type client or server"/> </meta>