Jump to content

synskidz

Members
  • Posts

    22
  • Joined

  • Last visited

Everything posted by synskidz

  1. The original table script from client.Lua is skins = { { "Skin 1", 124 }, { "Skin 2", 73 }, { "Skin 3", 253 }, { "Skin 4", 220 }, { "Skin 5", 240 }, } i want to change from database name = getAccountName(account) skins = executeSQLQuery("SELECT * FROM `bklist` WHERE PlayerName = ?",name") -- get skin table by account
  2. no, its not save resource. this resource means many skins on 1 account
  3. this is the code from resource called skins_panel write by @MR.GRAND server addEvent( 'ChangeSkin', true ) addEventHandler( 'ChangeSkin', root, function( Data ) if ( getElementType(source) == "player" ) then if (Data == 0) or not Data then cancelEvent() outputChatBox( 'Please Select a skin to change it !', source, 255,0,0, true) else setElementModel(source,tonumber(Data)) outputChatBox( 'Skin Changed seccessfully !', source, 0,255,0, true) end end end ) client skins = { { "Skin 1", 124 }, { "Skin 2", 73 }, { "Skin 3", 253 }, { "Skin 4", 220 }, { "Skin 5", 240 }, } Skin_changer = guiCreateButton(0.54, 0.28, 0.10, 0.04, "# Change skin", true) guiSetVisible( Skin_changer, false) guiSetFont(Skin_changer, "default-bold-small") guiSetProperty(Skin_changer, "NormalTextColour", "FF00C9FC") Skins_close = guiCreateButton(0.54, 0.74, 0.10, 0.04, "# Close panel", true) guiSetVisible( Skins_close, false) guiSetFont(Skins_close, "default-bold-small") guiSetProperty(Skins_close, "NormalTextColour", "FFFC00AB") Skins_grid = guiCreateGridList(0.36, 0.27, 0.17, 0.53, true) guiSetVisible( Skins_grid, false) guiGridListAddColumn(Skins_grid, "# Skins ", 0.5) guiGridListAddColumn(Skins_grid, "# ID ", 0.5) local screenW, screenH = guiGetScreenSize() function Skins_panel() dxDrawLine((screenW * 0.3543) - 1, (screenH * 0.2005) - 1, (screenW * 0.3543) - 1, screenH * 0.8008, tocolor(0, 253, 11, 255), 1, false) dxDrawLine(screenW * 0.6457, (screenH * 0.2005) - 1, (screenW * 0.3543) - 1, (screenH * 0.2005) - 1, tocolor(0, 253, 11, 255), 1, false) dxDrawLine((screenW * 0.3543) - 1, screenH * 0.8008, screenW * 0.6457, screenH * 0.8008, tocolor(0, 253, 11, 255), 1, false) dxDrawLine(screenW * 0.6457, screenH * 0.8008, screenW * 0.6457, (screenH * 0.2005) - 1, tocolor(0, 253, 11, 255), 1, false) dxDrawRectangle(screenW * 0.3543, screenH * 0.2005, screenW * 0.2914, screenH * 0.6003, tocolor(250, 4, 207, 194), false) dxDrawText("*|- Skins panel v.1.0 -|*", (screenW * 0.3543) - 1, (screenH * 0.2005) - 1, (screenW * 0.6457) - 1, (screenH * 0.2604) - 1, tocolor(0, 0, 0, 255), 1.00, "bankgothic", "center", "center", false, false, false, false, false) dxDrawText("*|- Skins panel v.1.0 -|*", (screenW * 0.3543) + 1, (screenH * 0.2005) - 1, (screenW * 0.6457) + 1, (screenH * 0.2604) - 1, tocolor(0, 0, 0, 255), 1.00, "bankgothic", "center", "center", false, false, false, false, false) dxDrawText("*|- Skins panel v.1.0 -|*", (screenW * 0.3543) - 1, (screenH * 0.2005) + 1, (screenW * 0.6457) - 1, (screenH * 0.2604) + 1, tocolor(0, 0, 0, 255), 1.00, "bankgothic", "center", "center", false, false, false, false, false) dxDrawText("*|- Skins panel v.1.0 -|*", (screenW * 0.3543) + 1, (screenH * 0.2005) + 1, (screenW * 0.6457) + 1, (screenH * 0.2604) + 1, tocolor(0, 0, 0, 255), 1.00, "bankgothic", "center", "center", false, false, false, false, false) dxDrawText("*|- Skins panel v.1.0 -|*", screenW * 0.3543, screenH * 0.2005, screenW * 0.6457, screenH * 0.2604, tocolor(47, 252, 0, 255), 1.00, "bankgothic", "center", "center", false, false, false, false, false) dxDrawLine(screenW * 0.3543, screenH * 0.2604, screenW * 0.6457, screenH * 0.2604, tocolor(47, 252, 0, 255), 2, false) dxDrawText("* *\n* *\n* *", (screenW * 0.5322) - 1, (screenH * 0.3411) - 1, (screenW * 0.5842) - 1, (screenH * 0.5130) - 1, tocolor(0, 0, 0, 255), 1.50, "beckett", "center", "top", false, false, false, false, false) dxDrawText("* *\n* *\n* *", (screenW * 0.5322) + 1, (screenH * 0.3411) - 1, (screenW * 0.5842) + 1, (screenH * 0.5130) - 1, tocolor(0, 0, 0, 255), 1.50, "beckett", "center", "top", false, false, false, false, false) dxDrawText("* *\n* *\n* *", (screenW * 0.5322) - 1, (screenH * 0.3411) + 1, (screenW * 0.5842) - 1, (screenH * 0.5130) + 1, tocolor(0, 0, 0, 255), 1.50, "beckett", "center", "top", false, false, false, false, false) dxDrawText("* *\n* *\n* *", (screenW * 0.5322) + 1, (screenH * 0.3411) + 1, (screenW * 0.5842) + 1, (screenH * 0.5130) + 1, tocolor(0, 0, 0, 255), 1.50, "beckett", "center", "top", false, false, false, false, false) dxDrawText("* *\n* *\n* *", screenW * 0.5322, screenH * 0.3411, screenW * 0.5842, screenH * 0.5130, tocolor(41, 252, 0, 255), 1.50, "beckett", "center", "top", false, false, false, false, false) dxDrawText("* *\n* *\n* *", (screenW * 0.5864) - 1, (screenH * 0.5586) - 1, (screenW * 0.6384) - 1, (screenH * 0.7305) - 1, tocolor(0, 0, 0, 255), 1.50, "beckett", "center", "top", false, false, false, false, false) dxDrawText("* *\n* *\n* *", (screenW * 0.5864) + 1, (screenH * 0.5586) - 1, (screenW * 0.6384) + 1, (screenH * 0.7305) - 1, tocolor(0, 0, 0, 255), 1.50, "beckett", "center", "top", false, false, false, false, false) dxDrawText("* *\n* *\n* *", (screenW * 0.5864) - 1, (screenH * 0.5586) + 1, (screenW * 0.6384) - 1, (screenH * 0.7305) + 1, tocolor(0, 0, 0, 255), 1.50, "beckett", "center", "top", false, false, false, false, false) dxDrawText("* *\n* *\n* *", (screenW * 0.5864) + 1, (screenH * 0.5586) + 1, (screenW * 0.6384) + 1, (screenH * 0.7305) + 1, tocolor(0, 0, 0, 255), 1.50, "beckett", "center", "top", false, false, false, false, false) dxDrawText("* *\n* *\n* *", screenW * 0.5864, screenH * 0.5586, screenW * 0.6384, screenH * 0.7305, tocolor(41, 252, 0, 255), 1.50, "beckett", "center", "top", false, false, false, false, false) dxDrawText("# #\n# #\n# #\n", (screenW * 0.5864) - 1, (screenH * 0.3411) - 1, (screenW * 0.6384) - 1, (screenH * 0.5130) - 1, tocolor(0, 0, 0, 255), 1.50, "beckett", "center", "top", false, false, false, false, false) dxDrawText("# #\n# #\n# #\n", (screenW * 0.5864) + 1, (screenH * 0.3411) - 1, (screenW * 0.6384) + 1, (screenH * 0.5130) - 1, tocolor(0, 0, 0, 255), 1.50, "beckett", "center", "top", false, false, false, false, false) dxDrawText("# #\n# #\n# #\n", (screenW * 0.5864) - 1, (screenH * 0.3411) + 1, (screenW * 0.6384) - 1, (screenH * 0.5130) + 1, tocolor(0, 0, 0, 255), 1.50, "beckett", "center", "top", false, false, false, false, false) dxDrawText("# #\n# #\n# #\n", (screenW * 0.5864) + 1, (screenH * 0.3411) + 1, (screenW * 0.6384) + 1, (screenH * 0.5130) + 1, tocolor(0, 0, 0, 255), 1.50, "beckett", "center", "top", false, false, false, false, false) dxDrawText("# #\n# #\n# #\n", screenW * 0.5864, screenH * 0.3411, screenW * 0.6384, screenH * 0.5130, tocolor(0, 252, 237, 255), 1.50, "beckett", "center", "top", false, false, false, false, false) dxDrawText("# #\n# #\n# #\n", (screenW * 0.5344) - 1, (screenH * 0.5586) - 1, (screenW * 0.5864) - 1, (screenH * 0.7305) - 1, tocolor(0, 0, 0, 255), 1.50, "beckett", "center", "top", false, false, false, false, false) dxDrawText("# #\n# #\n# #\n", (screenW * 0.5344) + 1, (screenH * 0.5586) - 1, (screenW * 0.5864) + 1, (screenH * 0.7305) - 1, tocolor(0, 0, 0, 255), 1.50, "beckett", "center", "top", false, false, false, false, false) dxDrawText("# #\n# #\n# #\n", (screenW * 0.5344) - 1, (screenH * 0.5586) + 1, (screenW * 0.5864) - 1, (screenH * 0.7305) + 1, tocolor(0, 0, 0, 255), 1.50, "beckett", "center", "top", false, false, false, false, false) dxDrawText("# #\n# #\n# #\n", (screenW * 0.5344) + 1, (screenH * 0.5586) + 1, (screenW * 0.5864) + 1, (screenH * 0.7305) + 1, tocolor(0, 0, 0, 255), 1.50, "beckett", "center", "top", false, false, false, false, false) dxDrawText("# #\n# #\n# #\n", screenW * 0.5344, screenH * 0.5586, screenW * 0.5864, screenH * 0.7305, tocolor(252, 249, 0, 255), 1.50, "beckett", "center", "top", false, false, false, false, false) dxDrawLine(screenW * 0.5322, screenH * 0.5339, screenW * 0.6457, screenH * 0.5339, tocolor(47, 252, 0, 255), 5, false) end function OPEN() if removeEventHandler('onClientRender', root, Skins_panel) then removeEventHandler('onClientRender', root, Skins_panel) guiSetVisible(Skins_grid,false) guiSetVisible(Skin_changer,false) guiSetVisible(Skins_close,false) showCursor(false) else addEventHandler('onClientRender', root, Skins_panel) guiSetVisible(Skins_grid,true) guiSetVisible(Skin_changer,true) guiSetVisible(Skins_close,true) showCursor(true) end end bindKey( "F2", "down", OPEN) for i,v in ipairs( skins ) do row = guiGridListAddRow(Skins_grid) guiGridListSetItemText( Skins_grid, row, 1, tostring(v[1]), false, false ) guiGridListSetItemText( Skins_grid, row, 2, tonumber(v[2]), false, false ) guiGridListSetItemData( Skins_grid, row, 1, tonumber(v[2]) ) guiGridListSetItemColor( Skins_grid, row, 1, math.random(255),math.random(255),math.random(255) ) guiGridListSetItemColor( Skins_grid, row, 2, math.random(255),math.random(255),math.random(255) ) end addEventHandler('onClientGUIClick', root, function() if (source == Skins_close) then removeEventHandler('onClientRender', root, Skins_panel) guiSetVisible(Skins_grid,false) guiSetVisible(Skin_changer,false) guiSetVisible(Skins_close,false) showCursor(false) elseif (source == Skin_changer) then local Data = guiGridListGetItemData( Skins_grid, guiGridListGetSelectedItem ( Skins_grid ), 1 ) triggerServerEvent( 'ChangeSkin', localPlayer, Data ) end end ) I want to replace the skin with the database depend on each account i already made the database called skinslot with 2 column "name" and "skinid" somebody please help me
  4. I edit it from resource called "Freeroam". There is a bookmark option for save player location but i want to change it to save player skin. What's wrong with my code. This is the client-side Lua local bookmarkList local bookmarks function initBookmarks () bookmarkList = wndBookmarks.controls[1].element if bookmarks then return end loadBookmarks () addEventHandler("onClientGUIDoubleClick",bookmarkList,gotoBookmark) end function loadBookmarks () bookmarks = {} local xml = xmlLoadFile("bookmarks.xml") if not xml then xml = xmlCreateFile("bookmarks.xml","catalog") end guiGridListClear(bookmarkList) for i,child in ipairs (xmlNodeGetChildren(xml) or {}) do local row = guiGridListAddRow(bookmarkList) guiGridListSetItemText(bookmarkList,row,1,tostring(xmlNodeGetAttribute(child,"name")),false,false) guiGridListSetItemText(bookmarkList,row,2,tostring(xmlNodeGetAttribute(child,"zone")),false,false) bookmarks[row+1] = {tonumber(xmlNodeGetAttribute(child,"x"))} end end function saveBookmarks () if fileExists("bookmarks.xml") then fileDelete("bookmarks.xml") end local xml = xmlCreateFile("bookmarks.xml","catalog") for row=0,(guiGridListGetRowCount(bookmarkList)-1) do local child = xmlCreateChild(xml,"bookmark") xmlNodeSetAttribute(child,"name",guiGridListGetItemText(bookmarkList,row,1)) xmlNodeSetAttribute(child,"zone",guiGridListGetItemText(bookmarkList,row,2)) xmlNodeSetAttribute(child,"x",tostring(bookmarks[row+1][1])) --xmlNodeSetAttribute(child,"y",tostring(bookmarks[row+1][2])) --xmlNodeSetAttribute(child,"z",tostring(bookmarks[row+1][3])) end xmlSaveFile(xml) xmlUnloadFile(xml) end function saveLocation () local name = getControlText(wndBookmarks,"bookmarkname") if name ~= "" then local x = getElementModel(g_Me) local zone = getZoneName(x,y,z,false) if x and y and z then local row = guiGridListAddRow(bookmarkList) guiGridListSetItemText(bookmarkList,row,1,name,false,false) guiGridListSetItemText(bookmarkList,row,2,zone,false,false) bookmarks[row+1] = {x} setControlText(wndBookmarks,"bookmarkname","") saveBookmarks() end else outputChatBox("Please enter a name for the bookmark") end end function deleteLocation () local row,column = guiGridListGetSelectedItem(bookmarkList) if row and row ~= -1 then table.remove(bookmarks,row+1) guiGridListRemoveRow(bookmarkList,row) saveBookmarks() end end function gotoBookmark () local row,column = guiGridListGetSelectedItem(bookmarkList) if row and row ~= -1 then fadeCamera(false) if isPedDead(g_Me) then setTimer(server.spawnMe,1000,1,unpack(bookmarks[row+1])) else setTimer(setElementModel,1000,1,g_Me,unpack(bookmarks[row+1])) --setElementModel(player, skin) --setTimer(setElementPosition,1000,1,g_Me,unpack(bookmarks[row+1])) end setTimer(function () fadeCamera(true) setCameraTarget(g_Me) end,2000,1) end end wndBookmarks = { 'wnd', text = 'Bookmarks', width = 400, x = -300, y = 0.2, controls = { { 'lst', id='bookmarklist', width=400, columns={ {text='Name', attr='name', width=0.3}, {text='Zone', attr='zone', width=0.6} } }, {'txt', id='bookmarkname', text='', width=225}, {'btn', id='save current location', onclick=saveLocation, width=150}, {'btn', id='delete selected location', onclick=deleteLocation, width=225}, {'btn', id='close', closeswindow=true, width=150} }, oncreate = initBookmarks }
  5. @fist bro, how i add more skin? if (getElementData (getLocalPlayer (), "zombie") ~= true) and ( isPedDead ( getLocalPlayer () ) == false ) and ((getElementModel(getLocalPlayer()) ~= 293 or (getElementModel(getLocalPlayer()) ~= 294 )) then its not working, i add local skin = ( 293,294) and subtitute it. but still not work. any suggest?
  6. thanks dude, i surprised its so simple
  7. help, i want zombies not chasing local player with the skin id = 293 --THIS CHECKS ALL ZOMBIES EVERY SECOND TO SEE IF THEY ARE IN SIGHT function zombie_check () if (getElementData (getLocalPlayer (), "zombie") ~= true) and ( isPedDead ( getLocalPlayer () ) == false ) then local zombies = getElementsByType ( "ped",getRootElement(),true ) local id = getElementModel (localPlayer) local Px,Py,Pz = getElementPosition( getLocalPlayer () ) if isPedDucked ( getLocalPlayer ()) then local Pz = Pz-1 end for theKey,theZomb in ipairs(zombies) do if (isElement(theZomb)) then local Zx,Zy,Zz = getElementPosition( theZomb ) if (getDistanceBetweenPoints3D(Px, Py, Pz, Zx, Zy, Zz) < 45 ) then if (getElementData (theZomb, "zombie") == true) then if ( getElementData ( theZomb, "status" ) == "idle" ) then --CHECKS IF AN IDLE ZOMBIE IS IN SIGHT local isclear = isLineOfSightClear (Px, Py, Pz+1, Zx, Zy, Zz +1, true, false, false, true, false, false, false) if (isclear == true) then setElementData ( theZomb, "status", "chasing" ) setElementData ( theZomb, "target", getLocalPlayer() ) table.insert( myZombies, theZomb ) --ADDS ZOMBIE TO PLAYERS COLLECTION table.remove( zombies, theKey) zombieradiusalert (theZomb) end elseif (getElementData(theZomb,"status") == "chasing") and (getElementData(theZomb,"target") == nil) then --CHECKS IF AN AGGRESSIVE LOST ZOMBIE IS IN SIGHT local isclear = isLineOfSightClear (Px, Py, Pz+1, Zx, Zy, Zz +1, true, false, false, true, false, false, false) if (isclear == true) then setElementData ( theZomb, "target", getLocalPlayer() ) isthere = "no" for k, ped in pairs( myZombies ) do if ped == theZomb then isthere = "yes" end end if isthere == "no" then table.insert( myZombies, theZomb ) --ADDS THE WAYWARD ZOMBIE TO THE PLAYERS COLLECTION if id = 293 then table.insert( myZombies, id ) end table.remove( zombies, theKey) end end elseif ( getElementData ( theZomb, "target" ) == getLocalPlayer() ) then --CHECKS IF AN ALREADY AGGRESSIVE ZOMBIE IS IN SIGHT local isclear = isLineOfSightClear (Px, Py, Pz+1, Zx, Zy, Zz +1, true, false, false, true, false, false, false) if (isclear == false) then --IF YOUR ZOMBIE LOST YOU, MAKES IT REMEMBER YOUR LAST COORDS setElementData ( theZomb, "target", nil ) triggerServerEvent ("onZombieLostPlayer", theZomb, oldPx, oldPy, oldPz) end end end end end end --this second half is for checking peds and zombies local nonzombies = getElementsByType ( "ped",getRootElement(),true ) local id = getElementModel (localPlayer) for theKey,theZomb in ipairs(zombies) do if (isElement(theZomb)) then if (getElementData (theZomb, "zombie") == true) then local Zx,Zy,Zz = getElementPosition( theZomb ) for theKey,theNonZomb in ipairs(nonzombies) do if (getElementData (theNonZomb, "zombie") ~= true) and (id ~= 293) then -- if the ped isnt a zombie local Px,Py,Pz = getElementPosition( theNonZomb ) if (getDistanceBetweenPoints3D(Px, Py, Pz, Zx, Zy, Zz) < 45 ) then local isclear = isLineOfSightClear (Px, Py, Pz+1, Zx, Zy, Zz +1, true, false, false, true, false, false, false ) if (isclear == true) and ( getElementHealth ( theNonZomb ) > 0) then if ( getElementData ( theZomb, "status" ) == "idle" ) then --CHECKS IF AN IDLE ZOMBIE IS IN SIGHT triggerServerEvent ("onZombieLostPlayer", theZomb, Px, Py, Pz) setElementData ( theZomb, "status", "chasing" ) setElementData ( theZomb, "target", theNonZomb ) zombieradiusalert (theZomb) elseif ( getElementData ( theZomb, "status" ) == "chasing" ) and ( getElementData ( theZomb, "target" ) == nil) then triggerServerEvent ("onZombieLostPlayer", theZomb, Px, Py, Pz) setElementData ( theZomb, "target", theNonZomb ) end end end if ( getElementData ( theZomb, "target" ) == theNonZomb ) then --CHECKS IF AN ALREADY AGGRESSIVE ZOMBIE IS IN SIGHT OF THE PED local Px,Py,Pz = getElementPosition( theNonZomb ) if (getDistanceBetweenPoints3D(Px, Py, Pz, Zx, Zy, Zz) < 45 ) then local isclear = isLineOfSightClear (Px, Py, Pz+1, Zx, Zy, Zz+1, true, false, false, true, false, false, false) if (isclear == false) then --IF YOUR ZOMBIE LOST THE PED, MAKES IT REMEMBER the peds LAST COORDS triggerServerEvent ("onZombieLostPlayer", theZomb, Px, Py, Pz) setElementData ( theZomb, "target", nil ) end end end end end end end end end for k, ped in pairs( myZombies ) do if (isElement(ped) == false) then table.remove( myZombies, k) end end oldPx,oldPy,oldPz = getElementPosition( getLocalPlayer () ) end i ve insert the id on table array, but the zombies still chase me
  8. thanks dude, so far so good. if any error, would u help me again? hehehe. big thanks btw
  9. it got no error report but still not get the reward and the outputChatBox not displayed. thanks for replying
  10. player_account = getPlayerAccount(source) function RewardLevel ( ) local wonge = source local UP = tonumber ( getAccountData ( player_account, "level" ) ) or 0 if ( UP == 1 ) then outputChatBox( "test") elseif ( UP == 2 ) then givePlayerMoney ( wonge, 50000 ) outputChatBox( "Reward Level 2 : get $50,000!") elseif ( UP == 3 ) then setPedStat(wonge, 24, 585) outputChatBox( "Reward Level 3 : increase Max HP!" ) end end addEvent("onPlayerChangeLevel", true) addEvent("onPlayerLevelUP", true) addEventHandler("onPlayerChangeLevel", getRootElement(), RewardLevel) addEventHandler("onPlayerLevelUP", getRootElement(), RewardLevel) it got error : Bad argument @ 'getAccountData' [Expected account at argument 1, got boolean] and not get the reward. HELP!
  11. i want to disable /login or /logout on console command but i cant find the resource that add the command. i use 'play' gamemode... i need help. sorry if this not the right fourm
  12. thanks for ur advice dude, i'll find another way
  13. Big Thanks Bro, u r genius. it work thanks
  14. function onregenstart() setTimer( healthup, 7000, 0, getElementsByType( "player" )) end addEventHandler( "onResourceStart", getResourceRootElement(getThisResource()), onregenstart ) function healthup(thePlayer) for k, players in ipairs(getElementsByType( "player" )) do if(getAccountData(players, "regen") == true) then local phealth = getElementHealth( players ) setElementHealth( players, phealth + 5 ) end end end it says "WARNING: remek\remek.lua:8: Bad argument @ 'getAccountData' [Expected account at argument 1, got player]" i want to all player with the account data named "regen" that have "true" value can regen health. and player data with false value on the account cant regen the health
  15. -- i cant display the killer name, whatswrong? addEventHandler("onPedWasted", getRootElement(), function(ammo, killer) if isElement(Musuh) then if source == Musuh then givePlayerMoney(killer,10000) triggerClientEvent ( "mandeg", root ) triggerClientEvent ( "menang", root ) destroyElement(Realtzank) destroyElement(blip[2]) outputChatBox( getPlayerName(killer) " get 10000", killer) end end end )
  16. where to find script that can make boss / ped invincible?
  17. yeah but its not working, where's the mistake?
  18. -- i want to know about michael99's resource known "m-nickname". i really need help function setPlayerName (thePlayer) acc = getPlayerAccount(thePlayer) user = getAccountName(acc) if user then setPlayerName(thePlayer,user) end end addEventHandler("onPlayerLogin",getRootElement(),setPlayerName)
×
×
  • Create New...