Jump to content

nasserdfdd

Members
  • Posts

    191
  • Joined

  • Last visited

Everything posted by nasserdfdd

  1. +1 the fake server stole reosurce and made server call cif original although they dont have the old accounts
  2. hi all so i have ingame map editor i want u can only build on a specific object like by object id ok so any help if u did not understand i mean i want to be able to build like on a floor but i can build any object script local playerobj = {} local marker = {} objectid = {} maxobjects = 500 function playerLeave () setElementData ( source, "tempbuilder", false ) setElementData ( source, "permbuilder", false ) end function playerJoin () setElementData ( source, "tempbuilder", false ) setElementData ( source, "permbuilder", false ) local pname = getClientName(source) if (pname == "example") or (pname == "example2") then setElementData ( source, "permbuilder", true ) end end function thisResourceStart () local players = getElementsByType ( "player" ) for k,v in ipairs(players) do setElementData ( v, "tempbuilder", false ) setElementData ( v, "permbuilder", false ) local pname = getClientName(v) if (pname == "example") or (pname == "example2") then setElementData ( v, "permbuilder", true ) end end end addEventHandler ( "onResourceStart", getResourceRootElement(getThisResource()), thisResourceStart ) addEventHandler ( "onPlayerJoin", getRootElement(), playerJoin ) addEventHandler ( "onPlayerQuit", getRootElement(), playerLeave ) function guestBuildPlayer ( player, commandName, player2nick ) if ( hasObjectPermissionTo ( player, "function.unbanSerial", true)) or (getElementData ( player, "permbuilder" ) == true) then local player2 = getPlayerFromNick ( player2nick ) local player2n = getClientName ( player2 ) if (getElementData ( player2, "tempbuilder" ) == false) then outputChatBox ( "#FFFF00"..player2n.." recieved map editor pass.", getRootElement(), 255, 255, 255, true ) setElementData ( player2, "tempbuilder" , true ) else outputChatBox ( "#FFFF00"..player2n.." map editor pass removed.", getRootElement(), 255, 255, 255, true ) setElementData ( player2, "tempbuilder" , false ) end else outputChatBox ( "You do not have permission to do that.", player ) end end addCommandHandler("guestb", guestBuildPlayer ) function createCurrentObject (player,cmd,objid) if ( hasObjectPermissionTo ( player, "function.unbanSerial", true)) or (getElementData ( player, "permbuilder" ) == true) or (getElementData ( player, "tempbuilder" ) == true) then if playerobj[player] then outputChatBox ( "You are already editing an object. Please save or delete to make another.", player ) else local x, y, z = getElementPosition(player) destroyMObj (player) playerobj[player] = createObject(tonumber(objid), x + 5, y + 5, z - 1) if marker[player] then destroyElement(marker[player]) end if playerobj[player] then marker[player] = createMarker ( x, y, z, "arrow", 5, 255, 255, 0, 255) attachElementToElement ( marker[player], playerobj[player], 0, 0, 10) else outputChatBox ( "" ..objid.. " does not appear to be a valid model ID.", player ) end end else outputChatBox ( "You do not have permission to build.", player ) end end addCommandHandler( "mcreate", createCurrentObject ) function cloneCurrentObject (player, cmd, addx, addy, addz, addrx, addry, addrz) if ( hasObjectPermissionTo ( player, "function.unbanSerial", true)) or (getElementData ( player, "permbuilder" ) == true) or (getElementData ( player, "tempbuilder" ) == true) then if addx then addx = tonumber(addx) else addx = 0 end if addy then addy = tonumber(addy) else addy = 0 end if addz then addz = tonumber(addz) else addz = 0 end if addrx then addrx = tonumber(addrx) else addrx = 0 end if addry then addry = tonumber(addry) else addry = 0 end if addrz then addrz = tonumber(addrz) else addrz = 0 end if playerobj[player] then local x, y, z = getElementPosition(playerobj[player]) local rx, ry, rz = getObjectRotation(playerobj[player]) local model = getObjectModel ( playerobj[player] ) saveObjID(player) playerobj[player] = createObject(model, x + addx, y + addy, z + addz, rx + addrx, ry + addry, rz + addrz) end if playerobj[player] then marker[player] = createMarker ( x, y, z, "arrow", 5, 255, 255, 0, 255) attachElementToElement ( marker[player], playerobj[player], 0, 0, 10) else outputChatBox ( "Failed to clone object. Make sure you have one selected.", player ) end else outputChatBox ( "You do not have permission to build.", player ) end end addCommandHandler( "mclone", cloneCurrentObject ) function stackCurrentObject (player, cmd, times, addx, addy, addz, addrx, addry, addrz) if ( hasObjectPermissionTo ( player, "function.unbanSerial", true)) or (getElementData ( player, "permbuilder" ) == true) or (getElementData ( player, "tempbuilder" ) == true) then if tonumber(times) < 50 and addx then times = tonumber(times) addx = tonumber(addx) if addy then addy = tonumber(addy) else addy = 0 end if addz then addz = tonumber(addz) else addz = 0 end if addrx then addrx = tonumber(addrx) else addrx = 0 end if addry then addry = tonumber(addry) else addry = 0 end if addrz then addrz = tonumber(addrz) else addrz = 0 end if playerobj[player] then for i=0,times do local x, y, z = getElementPosition(playerobj[player]) local rx, ry, rz = getObjectRotation(playerobj[player]) local model = getObjectModel ( playerobj[player] ) saveObjID(player) playerobj[player] = createObject(model, x + addx, y + addy, z + addz, rx + addrx, ry + addry, rz + addrz) end end if playerobj[player] then marker[player] = createMarker ( x, y, z, "arrow", 5, 255, 255, 0, 255) attachElementToElement ( marker[player], playerobj[player], 0, 0, 10) else outputChatBox ( "Failed to stack object. Make sure you have one selected.", player ) end else outputChatBox ( "Failed to stack object. You can only stack up to 50 items at once. Also make sure you at least specified an X value.", player ) end else outputChatBox ( "You do not have permission to build.", player ) end end addCommandHandler( "mstack", stackCurrentObject ) function loopCurrentObject (player, cmd, pieces, radi, offset, rotaxis, loops, rota) if ( hasObjectPermissionTo ( player, "function.unbanSerial", true)) or (getElementData ( player, "permbuilder" ) == true) or (getElementData ( player, "tempbuilder" ) == true) then local angle local newi if loops then loops = tonumber(loops) else loops = 1 end if rota then rota = rota*(math.pi/180) else rota = 0 end if rotaxis == "x" or rotaxis == "-x" or rotaxis == "y" or rotaxis == "-y" then --do nothing else rotaxis = "x" end if radi and pieces and offset then radi = tonumber(radi) pieces = tonumber(pieces) offset = tonumber(offset) local spiralp = math.atan((offset/2)/(2*radi))/loops if playerobj[player] then local orx, ory, orz = getElementPosition(playerobj[player]) newi = -1 for i=0,pieces do local x, y, z = getElementPosition(playerobj[player]) local rx, ry, rz = getObjectRotation(playerobj[player]) local model = getObjectModel ( playerobj[player] ) saveObjID(player) local weight = 1-(1/(pieces/2))*math.abs((pieces/2)-i) local radians = (i/pieces)*(2*math.pi)*loops local newx = orx + radi*math.sin(radians)*math.cos(rota)+(offset/2)*math.cos(radians/(2*loops))*-math.sin(rota) local newy = ory +(offset/2)*math.cos(radians/(2*loops))*math.cos(rota)+radi*math.sin(radians)*math.sin(rota) local newz = orz + radi*-math.cos(radians) angle = (((360/pieces)* loops )* newi) if angle <= 359.9999999999999999999999999 then newi = newi + 1 end angle = (((360/pieces)* loops )* newi) if angle >= 360 then newi = -1 angle = (((360/pieces)* loops )* newi) end if rotaxis == "x" then newrotx = angle newroty = ry --+ ((radians)-math.cos(rota)*spiralp*weight) elseif rotaxis == "-x" then newrotx = -angle newroty = ry --+ ((radians)-math.cos(rota)*spiralp*weight) elseif rotaxis == "y" then newrotx = rx --+ ((radians)-math.cos(rota)*spiralp*weight) newroty = angle elseif rotaxis == "-y" then newrotx = rx --+ ((radians)-math.cos(rota)*spiralp*weight) newroty = -angle end playerobj[player] = createObject(model, newx, newy, newz, newrotx, newroty, rz) end end if playerobj[player] then marker[player] = createMarker ( x, y, z, "arrow", 5, 255, 255, 0, 255) attachElementToElement ( marker[player], playerobj[player], 0, 0, 10) else outputChatBox ( "Failed to stack object. Make sure you have one selected.", player ) end
  3. addCommandHandler("removedx", u did not call any function in this command handler
  4. pls anyone help ,me edit:also if i used dxgui i just need it custom
  5. can any one edit my script so he give me example cuz iam very bad customgui
  6. sorry to be rude but the we can uppdate all resource with any prob by typing upgrade all
  7. hi all so i made this kill cam so when some one kill u view him so u need the top bar chat which i uploaded so here u go download link https://www.mediafire.com/?wdesirdnzpdt9ay note : i uploaded it in mediafire cuz mta is not accpeting to upload it is saying invlaid luac
  8. hi all it is a topbarchat i made for my killcam but u can use it for your self download link https://community.multitheftauto.com/index.php?p= ... s&id=11875 eported functions
  9. hi all so i made a veh spawn i made not custom gui cuz idk how so please any could help me cuz i dont know how to make custom gui script client local client = getLocalPlayer() local rootElement = getRootElement() local theMarker = nil vehicle_selector_window = guiCreateWindow(0.3555,0.2318,0.3027,0.4479,"Vehicles Spawner",true) guiWindowSetSizable(vehicle_selector_window,false) guiSetVisible(vehicle_selector_window,false) vehicle_selector_grid = guiCreateGridList(0.029,0.0698,0.9419,0.7762,true,vehicle_selector_window) guiGridListAddColumn(vehicle_selector_grid,"Vehicle name:",0.9) vehicle_selector_select = guiCreateButton(0.1194,0.8779,0.3194,0.0756,"Use",true,vehicle_selector_window) vehicle_selector_close = guiCreateButton(0.5742,0.8808,0.3194,0.0756,"Close",true,vehicle_selector_window) addEventHandler("onClientGUIClick",rootElement, function () if (source == vehicle_selector_close) then guiSetVisible(vehicle_selector_window,false) showCursor(false) elseif (source == vehicle_selector_select) then local row,col = guiGridListGetSelectedItem(vehicle_selector_grid) if row and col and row ~= -1 and col ~= -1 then local vehicleName = guiGridListGetItemText(vehicle_selector_grid, row, col) triggerServerEvent("vehicle_spawn",client,client,getVehicleModelFromName(vehicleName),theMarker) guiSetVisible(vehicle_selector_window,false) showCursor(false) end end end) addEvent("show_vehicle_selector",true) addEventHandler("show_vehicle_selector",rootElement, function (vehiclesTable,marker) theMarker = marker guiSetVisible(vehicle_selector_window,true) showCursor(true) guiGridListClear(vehicle_selector_grid) for i,v in pairs(vehiclesTable) do local row = guiGridListAddRow(vehicle_selector_grid) guiGridListSetItemText(vehicle_selector_grid, row, 1, getVehicleNameFromModel(v), false, false) end end) note i wont put server cuz server does not have gui but if u need it i will put it
  10. hi all so i made very simple script which when u start it it start all resources and show the resource which is started in mta-server but u need to put the resource in admin in acl here u go download link https://community.multitheftauto.com/index.php?p= ... s&id=11874
  11. thx @mr.wizard still working gui and database to be able to store medkit
  12. iam willing to sell u egype skype me jone.cina11 i mean about like cit job and blabla bla not cj clothes saver
  13. hi all i made a medkit with anti cheat when u buy u gte 20% of ur health uncompiled updated download link https://community.multitheftauto.com/index.php?p= ... s&id=11862 some pic http://imgur.com/a/oIHeW future versions i will add gui to buy medkit and store ur medkit in database
  14. do i make new script or put it with the the https://community.multitheftauto.com/index.php?p= ... ils&id=110
  15. soory for double post but pls any one give me working example
  16. ok so if any one could tell how to make script that would block a specfic word like an advertise to server for example if any one wrote CIF it would be ***
  17. do i use it with the old script which u gave me or no?
  18. idk the command Converteviptocash give me 10k and vip is still 1200
  19. idk why but i get money but the hours is stuck 1200 hours
  20. error: attemt to index global donate a nil value
  21. the vip system local sx, sy = guiGetScreenSize() function makeGUI() vipGUI = guiCreateWindow((sx / 2) - (694 / 2), (sy / 2) - (526 / 2), 694, 526, "VIPs", false) guiWindowSetSizable(vipGUI , false) guiSetAlpha(vipGUI , 1.00) guiSetVisible(vipGUI, false) nameEdit = guiCreateEdit(9, 22, 152, 30, "", false, vipGUI) list = guiCreateGridList(9, 61, 670, 408, false, vipGUI) guiSetEnabled(nameEdit, false) guiGridListAddColumn(list, "Account", 0.7) guiGridListAddColumn(list, "Time", 0.1) closeBttn = guiCreateButton(11, 483, 668, 33, "Close This Window", false, vipGUI) addEventHandler("onClientGUIClick", closeBttn, function() guiSetVisible(vipGUI, false) showCursor(false) end, false) end addEventHandler("onClientResourceStart", resourceRoot, makeGUI) function showDonateMembers(d) guiSetVisible(vipGUI, true) showCursor(true) guiGridListClear(list) local online = 0 local online = 0 for ind, data in pairs(d) do online = online + 1 local row = guiGridListAddRow(list) local nTime = data - 1 if (nTime > 1) then data = nTime end guiGridListSetItemText(list, row, 1, tostring(ind), false, false) guiGridListSetItemText(list, row, 2, tostring(data), false, false) end guiSetText(nameEdit, "VIP Online: "..online) end addEvent("donate.showDonateMembers", true) addEventHandler("donate.showDonateMembers", root, showDonateMembers) local donate = {} local allTimeDonate = {} local con = dbConnect("sqlite", "db/donate.db") dbExec(con, "CREATE TABLE IF NOT EXISTS donators (account TEXT, time TEXT)") function loadUsers(query) local data = dbPoll(query, 0) if (data) then for ind, d in ipairs(data) do allTimeDonate[d.account] = d.time if (d.account and getAccount(d.account) and getAccountPlayer(getAccount(d.account))) then donate[d.account] = tonumber(d.time) end end end end dbQuery(loadUsers, con, "SELECT * FROM donators") function isPlayerDonator(player) local account = getAccountName(getPlayerAccount(player)) return donate[account] end function addDonatorToDB(player, cmd, account, hours) if (not (hasObjectPermissionTo(player, "function.banPlayer", false))) then return end if (account and hours) then if (not getAccount(account)) then outputChatBox("No account with "..account.." as username", player, 2500, 0, 0) return end if (not tonumber(hours) or tonumber(hours) < 0) then outputChatBox(tostring(hours).." is an invalid hour specific", player, 2500, 0, 0) return end local plr = getAccountPlayer(getAccount(account)) if (not allTimeDonate[getAccount(account)]) then dbExec(con, "INSERT INTO donators (account, time) VALUES (?, ?)", tostring(account), tostring(hours)) donate[account] = tonumber(hours) if (tonumber(hours) == 0) then hours = "infinite" end outputDebugString(getPlayerName(player).. " added "..hours.." VIP hours to "..account) outputChatBox("Added "..hours.." VIP hours to "..account, player, 255, 150, 0) if (plr) then outputChatBox(getPlayerName(player).." added "..hours.." VIP hours to your account ("..account..")", plr, 0, 2500, 0) end end end end addCommandHandler("addvip", addDonatorToDB) function removeOfflineVIP(player, cmd, account) if (not (hasObjectPermissionTo(player, "function.kickPlayer", false))) then return end if (account) then if (not getAccount(account)) then outputChatBox("No account with "..account.." as username", player, 2500, 0, 0) return end if (donate[account]) then donate[account] = nil end if (allTimeDonate[account]) then allTimeDonate[account] = nil end dbExec(con, "DELETE FROM donators WHERE account=?", tostring(account)) outputDebugString(getPlayerName(player).. " removed account "..account.." from database") end end addCommandHandler("removevip", removeOfflineVIP) function makeDonateTick() for ind, d in pairs(donate) do if (ind and getAccount(ind)) then if (getAccountPlayer(getAccount(ind))) then if (donate[ind] and donate[ind] < 1 and donate[ind] ~= 0) then donate[ind] = nil allTimeDonate[ind] = nil dbExec(con, "DELETE FROM donators WHERE account=?", tostring(ind)) outputDebugString("Remove account "..ind.." from database because time ran out", root, 255, 255, 0) elseif (donate[ind] and donate[ind] > 1 and donate[ind] ~= 0) then donate[ind] = donate[ind] - 1 dbExec(con, "UPDATE donators SET time=? WHERE account=?", tostring(donate[ind]), tostring(ind)) outputDebugString("Account "..ind.." VIP Time set to "..donate[ind].." Hours") elseif (donate[ind]) then outputDebugString("Account "..ind.." has infinite VIP hours") end end end end end setTimer(makeDonateTick, 3600000 , 0) function getVipsTable(player) --if (exports.CEDadmin:doesPlayerHaveAccess(player, "viewVipGUI")) then if (not (hasObjectPermissionTo(player, "function.kickPlayer", false))) then return end triggerClientEvent(player, "donate.showDonateMembers", player, allTimeDonate) end addCommandHandler("showvip", getVipsTable) function donaterLoggedIn() dbQuery(loadUsers, con, "SELECT * FROM donators") end addEventHandler("onPlayerLogin", root, donaterLoggedIn) function getMyVIP(plr) if (not isPlayerDonator(plr)) then return end local hours = isPlayerDonator(plr) local minutes = math.floor(hours / 60) if (tonumber(hours) == 0) then hours = "infinite" minutes = "nil" end outputChatBox("You have "..hours.." VIP Hours ("..minutes.." minutes) remaining on this account ("..getAccountName(getPlayerAccount(plr))..")", plr, 0, 2500, 0) end addCommandHandler("VIP Hours", getMyVIP) function setCorrectVIPData() for ind, plr in pairs(getElementsByType("player")) do setElementData(plr, "VIP Hours", donate[getAccountName(getPlayerAccount(plr))]) end end setTimer(setCorrectVIPData, 1000, 0)
×
×
  • Create New...