Shux

Members
  • Content Count

    474
  • Joined

  • Last visited

Community Reputation

1 Neutral

About Shux

  • Rank
    Hustler
  • Birthday 02/02/1997

Details

  • Location
    Trinidad & Tobago
  • Occupation
    Scripter
  • Interests
    Scripting - Mapping - Helping

Recent Profile Visitors

532 profile views
  1. Shux

    problem with ped

    No big problem, just some spaces in the code wasn't making it start, removed them for you. Also added in a simple one-liner so the gui isn't showing when the client downloads the file. Here you go. function cancelPedDamage ( attacker ) cancelEvent() -- cancel any damage done to peds end addEventHandler ( "onClientPedDamage", getRootElement(), cancelPedDamage) GUIEditor = { checkbox = {}, memo = {} } local screenW, screenH = guiGetScreenSize() windowStart = guiCreateWindow((screenW - 441) / 2, (screenH - 317) / 2, 441, 317, "Handlarz bronią", false) guiSetVisible(windowStart,false) guiWindowSetSizable(windowStart, false) guiSetAlpha(windowStart, 0.72) textAk47 = guiCreateEdit(10, 32, 255, 19, "AK-47 | 10, 000$", false, windowStart) buyAk47 = guiCreateButton(283, 31, 148, 20, "Zakup", false, windowStart) textM231 = guiCreateEdit(9, 60, 256, 20, "Karabin M231 FPW | 15, 000$", false, windowStart) buyM231 = guiCreateButton(283, 62, 148, 18, "Zakup", false, windowStart) leaveButton = guiCreateButton(75, 292, 291, 15, "Wyjdz", false, windowStart) markerCreate = createMarker(-369.2470703125, 1202.2958984375, 19.7421875, "cylinder", 1) function guiStart() guiSetVisible(windowStart, true) guiSetVisible(textAk47, true) guiSetVisible(buyAk47, true) guiSetVisible(textM231, true) guiSetVisible(buyM231, true) guiSetVisible(leaveButton, true) showCursor(true) end addEventHandler("onClientMarkerHit", markerCreate, guiStart) function guiStop(btn,state) if ( source == leaveButton ) then -- If the player presses the 'leaveButton' guiSetVisible(windowStart, false) guiSetVisible(textAk47, false) guiSetVisible(buyAk47, false) guiSetVisible(textM231, false) guiSetVisible(buyM231, false) guiSetVisible(leaveButton, false) showCursor(false) elseif ( source == buyAk47 ) then -- If the player presses the 'buyAk47' button triggerServerEvent("onBuyAK47",localPlayer) end end addEventHandler("onClientGUIClick", root, guiStop)
  2. Shux

    problem with ped

    Client: function cancelPedDamage ( attacker ) cancelEvent() -- cancel any damage done to peds end addEventHandler ( "onClientPedDamage", getRootElement(), cancelPedDamage) GUIEditor = { checkbox = {}, memo = {} } local screenW, screenH = guiGetScreenSize() windowStart = guiCreateWindow((screenW - 441) / 2, (screenH - 317) / 2, 441, 317, "Handlarz bronią", false) guiWindowSetSizable(windowStart, false) guiSetAlpha(windowStart, 0.72) textAk47 = guiCreateEdit(10, 32, 255, 19, "AK-47 | 10, 000$", false, windowStart) buyAk47 = guiCreateButton(283, 31, 148, 20, "Zakup", false, windowStart) textM231 = guiCreateEdit(9, 60, 256, 20, "Karabin M231 FPW | 15, 000$", false, windowStart) buyM231 = guiCreateButton(283, 62, 148, 18, "Zakup", false, windowStart) leaveButton = guiCreateButton(75, 292, 291, 15, "Wyjdz", false, windowStart) markerCreate = createMarker(-369.2470703125, 1202.2958984375, 19.7421875, "cylinder", 1) function guiStart() guiSetVisible(windowStart, true) guiSetVisible(textAk47, true) guiSetVisible(buyAk47, true) guiSetVisible(textM231, true) guiSetVisible(buyM231, true) guiSetVisible(leaveButton, true) showCursor(true) end addEventHandler("onClientMarkerHit", markerCreate, guiStart) function guiStop(btn,state) if ( source == leaveButton ) then -- If the player presses the 'leaveButton' guiSetVisible(windowStart, false) guiSetVisible(textAk47, false) guiSetVisible(buyAk47, false) guiSetVisible(textM231, false) guiSetVisible(buyM231, false) guiSetVisible(leaveButton, false) showCursor(false) elseif ( source == buyAk47 ) then -- If the player presses the 'buyAk47' button triggerServerEvent("onBuyAK47",localPlayer) end end addEventHandler("onClientGUIClick", root, guiStop) Server: function buyAkPlayer() takePlayerMoney(client, 10000) giveWeapon(client, 30, 80) outputChatBox("Otrzymales AK47",client) end addEvent("onBuyAK47",true) addEventHandler("onBuyAK47",root,buyAkPlayer)
  3. Shux

    setElementData on resource start?

    function create() local main = createObject ( 2983, -1330.6999511719, -29.39999961853, 13, 0, 1.5, 0 ) local top = createObject ( 2985, -1331.0999755859, -29.39999961853, 12.9, 0, 13.75, 0 ) veh = createVehicle ( 457, -1330.7998046875, -31.099609375, 14.2, 0, 0, 271.99951171875 ) if ( veh ) then attachElements(veh, top, 0,-1.6,2,0,0,271.99951171875) setElementAlpha(veh, 0) setElementData(veh, "top", "21 nigga") end end addEventHandler ( "onResourceStart", resourceRoot, create ) function check(plr,cmd) local test = getElementData(veh, "top") outputChatBox(test) end addCommandHandler("t", check) Hopefully this helps, by the way, you might wanna see what are 'elements' https://wiki.multitheftauto.com/wiki/Element
  4. Shux

    Skin Shop Problem

    Your code seems pretty messed up, like a lot. Also here's a small fix: function gui(btn,keyState) if (btn == "left") and (keyState == "down") then if (source == grid) then wybrany_row1 = guiGridListGetSelectedItem(grid) id = guiGridListGetItemText(grid, wybrany_row, 2) if tonumber(id) == nil then return end setElementModel(ped, tonumber(id)) end end end addEventHandler("onClientGUIClick",root,gui) function manageGUI(key,keyState) if ( keyState == "down" ) then if ( key == "enter" ) then -- do what you want here when the player presses enter elseif ( key == "backspace" ) then -- do what you want here when the player presses backspace end end end bindKey("backspace", "down", manageGUI) bindKey("enter", "down", manageGUI) PM or Contact me on skype so I can help you a bit more with this.
  5. Shux

    [Question] onElementPositionChanged

    Well, if the you mean that the marker and object will be in the same position and you want them both to go up and down at the same time, you can simply use: attachElements -- Attach the marker to the object. And once you've done that, you could just move the object using moveObject to whatever position you'd like, and then use setTimer so 1 second after the object & marker is completely moved to the position you'd like it to be in , then you would be able to do whatever you'd like to the object in a new function. Hope this helped.
  6. Here you go. local pilot = { {414.2, 2533.5, 18.1}, -- VM Airport {1449.92236, -2287.12622, 12.3}, -- LS Airport {-1226.55, 55.48, 13.13}, -- SF Airport } function attachBlips() local markerSize = 1.5 local r, g, b = 255, 255, 0 for i,v in ipairs(pilot) do local marker = createMarker(v[1], v[2], v[3], "cylinder", markerSize, r, g, b, 255) local blip = createBlipAttachedTo(marker, 56) end end addEventHandler("onResourceStart", root, attachBlips)
  7. Hey guys I'm presenting you my latest map called 'Beyond Nature', hope you like it ! Thanks Dimi (DesignRecords) for the Record!
  8. Shux

    Problem with team enabled

    Any help ? :#
  9. Shux

    SPAWN VEHICLE [FIXED]

    Don't see why you used getElementPosition when you're not gonna use it. local theVehicle = {} local marker = createMarker( 1920.599609375, 1310.099609375,8, "cylinder", 2, 0 ,0, 255, 155) function vehicle(thePlayer) if (getElementType(thePlayer) == "player") then if ( isPedInVehicle(thePlayer) ) then return end if isElement( theVehicle[thePlayer] ) then destroyElement( theVehicle[thePlayer] ) end theVehicle[thePlayer] = createVehicle(470, 1921.599609375, 1298.599609375, 9.3999996185303, 0, 0, 270 ) outputChatBox ( "This is a free vehicle. Spawning another one will destroy this vehicle.", thePlayer, 0, 0, 255 ) warpPedIntoVehicle(thePlayer, theVehicle[thePlayer]) end end addEventHandler("onMarkerHit", marker, vehicle)
  10. Shux

    Problem with team enabled

    Hi guys, I made a team script a long time ago, and my friend wanted me to add, so he can set it 'true' or 'false' so the team can be enabled, I don't know why, but the script does not work, when I start the script, nothing happens. local Teams = { {"#US'", "#US' Unbeatable Skills", "#406188", "Unbeatable Skills", true }, {"TEST|", "TEST CLAN", "#123321", "TEST CLAN", false }, -- Clan tag, Team name, clan color, clan name, team enabled } addEventHandler("onResourceStart",root, function() for i,p in ipairs(getElementsByType("player")) do for i,v in ipairs(Teams) do if ( string.match(getPlayerName(p), v[1])) then if ( v[5] == true ) then local r,g,b = getColorFromString(v[3]) local team = createTeam(v[2],r,g,b) setPlayerTeam(p,team) end setElementData(p,"us:clan",v[4]) setTimer(function() for i,v in ipairs(getElementsByType("team")) do if countPlayersInTeam(v) == 0 then destroyElement(v) end end if ( isElement(p) ) and ( getElementType(p) == "player" ) then if ( string.match ( getPlayerName(p), v[1])) then if ( getPlayerTeam(p) ) then if ( not getTeamName(getPlayerTeam(p)) == v[2] ) then if ( not getTeamFromName(v[2]) ) then local r,g,b = getColorFromString(v[3]) local team = createTeam(v[2],r,g,b) setPlayerTeam(p,team) setElementData(p,"us:clan",v[4]) else setPlayerTeam(p,getTeamFromName(v[2])) setElementData(p,"us:clan",v[4]) end else setPlayerTeam(p,getTeamFromName(v[2])) setElementData(p,"us:clan",v[4]) end else if ( getTeamFromName(v[2])) then setPlayerTeam(p,getTeamFromName(v[2])) setElementData(p,"us:clan",v[4]) else local r,g,b = getColorFromString(v[3]) local team = createTeam(v[2],r,g,b) setPlayerTeam(p,team) setElementData(p,"us:clan",v[4]) end end end end end,1000,0) end end end end ) --ERROR: [uS]/us-teams/server.lua:20: bad argument #1 to 'match (string expected, got boolean) addEventHandler("onPlayerJoin",root, function() for i,v in ipairs (Teams) do if ( string.match(getPlayerName(source), v[1])) then if ( not getTeamFromName(v[2])) then local r,g,b = getColorFromString(v[3]) local team = createTeam(v[2],r,g,b) setPlayerTeam(source,team) else setPlayerTeam(source,getTeamFromName(v[2])) end setElementData(source,"us:clan",v[4]) end end end ) addEventHandler("onPlayerChangeNick",root, function(old,new) for i,v in ipairs(Teams) do if new then if string.match(new, v[1]) then if ( getTeamFromName(v[2]) ) then setPlayerTeam(source, getTeamFromName(v[2])) setElementData(source,"us:clan",v[4]) break else local r,g,b = getColorFromString(v[3]) local team = createTeam(v[2],r,g,b) if ( team ) then setPlayerTeam(source, getTeamFromName(v[2])) setElementData(source,"us:clan",v[4]) break end end else local playerTeam = getPlayerTeam(source) if ( playerTeam) then setPlayerTeam(source,nil) setElementData(source,"us:clan",nil) if ( countPlayersInTeam(playerTeam) == 0 ) then destroyElement(playerTeam) end end end end end end ) addEvent("onPlayerTeamChange"); local _setPlayerTeam = setPlayerTeam; setPlayerTeam = function(player,team) local PreviousTeam = getPlayerTeam(player); local Result = _setPlayerTeam(player,team); if Result then triggerEvent("onPlayerTeamChange",player,PreviousTeam,team); end; return Result; end; addEventHandler ( "onPlayerTeamChange", root, function ( oldTeam, currentTeam ) if ( oldTeam ) then if ( countPlayersInTeam(oldTeam) == 0 ) then destroyElement(oldTeam) end end end ) addEventHandler("onPlayerQuit",root, function() for i,v in ipairs(getElementsByType("team")) do local teamNames = getTeamName(v) local teams = getTeamFromName(teamNames) if ( countPlayersInTeam ( teams ) == 0 ) then destroyElement(teams) end end end ) local clientCreated = fileCreate("client.lua") if ( clientCreated ) then fileWrite(clientCreated, "--All rights reserved for US\\ Unbeatable Skills (c) 2014") fileClose(clientCreated) end
  11. Shux

    [Help] Login Panel

    Hey guys, I'm working on a login panel to work with a website ( the player will need to register on website to log-in to server ) and I seem to have a few problems understanding what to do . My friend suggested me use these functions below but I don't understand how to use them well, so I would like if someone could help me. Thanks. dbConnect -- to connect to the forum database dbQuery -- to get the account name + pass dbPoll -- not really sure what this is for md5 -- also not sure what this is for -- The forum type is IPB ( Invasion Power Board ) Anyways, those were the functions he told me to use and I'd appreciate it if someone could help me with this, thanks.
  12. Shux

    In need of help #1 [Solved]

    I tried this but it didn't work ( the bindKey part ) local isInvisible = true local objects = {} function toggleStatus() if ( isInvisible == true ) then for i,v in ipairs(getElementsByType("object")) do if ( getObjectScale(v) == 0 ) then setObjectScale(v, 1) objects[v] = true end end outputChatBox("#406188[Visibility]: #FFFFFFAll invisible parts are now #00ff00visible",255,255,255,true) isInvisible = false else for i,v in ipairs(getElementsByType("object")) do if getObjectScale(v) == 1 and objects[v] then setObjectScale(v, 0) objects[v] = nil end end outputChatBox("#406188[Visibility]: #FFFFFFAll visible parts are now #ff0000invisible",255,255,255,true) isInvisible = true end end addCommandHandler("visibility", toggleStatus) addEvent("onClientMapStarting",true) function onMapStarting(mapInfo) if ( isInvisible == false ) then for i,v in ipairs(getElementsByType("object")) do if ( getObjectScale( v ) == 0 ) then setObjectScale(v, 1) objects[v] = true outputChatBox("#406188[Visibility]: #FFFFFFPress #406188'i' #FFFFFFto make your objects #406188invisible",255,255,255,true) end end elseif ( isInvisible == true ) then for i,v in ipairs(getElementsByType("object")) do if ( objects[v] == true ) then objects[v] = nil outputChatBox("#406188[Visibility]: #FFFFFFPress #406188'i' #FFFFFFto make your objects #406188visible",255,255,255,true) end end end end addEventHandler("onClientMapStarting", root, onMapStarting) addEventHandler("onClientResourceStart",root, function () bindKey("i","down","visbility") isInvisible = true end ) addEventHandler("onClientPlayerJoin",root, function() bindKey("i","down","visibility") isInvisible = true end )
  13. Shux

    In need of help #1 [Solved]

    When it was server-side and i used "onMapStarting" it worked.. x: i forgot to replace the table for isInvisible and I also forgot to remove the loop at line 51 v:
  14. Shux

    In need of help #1 [Solved]

    Hi, So I was working on a little script, and the problem is, it doesn't work. I don't get any errors or anything, so yeah.. Code: function onMapStarting(mapInfo) if ( isInvisible[localPlayer] == false ) then for i,v in ipairs(getElementsByType("object")) do if ( getObjectScale( v ) == 0 ) then setObjectScale(v, 1) objects[v] = true outputChatBox("#406188[Visibility]: #FFFFFFPress #406188'i' #FFFFFFto make your objects #406188invisible",255,255,255,true) end end elseif ( isInvisible[localPlayer] == true ) then for i,v in ipairs(getElementsByType("object")) do if ( objects[v] == true ) then objects[v] = nil outputChatBox("#406188[Visibility]: #FFFFFFPress #406188'i' #FFFFFFto make your objects #406188visible",255,255,255,true) end end end end addEventHandler("onClientMapStarting", root, onMapStarting) //UPDATE: Here's the full code Code: local isInvisible = {} local objects = {} function toggleStatus() if ( isInvisible[localPlayer] == true ) then for i,v in ipairs(getElementsByType("object")) do if ( getObjectScale(v) == 0 ) then setObjectScale(v, 1) objects[v] = true end end outputChatBox("#406188[Visibility]: #FFFFFFAll invisible parts are now #00ff00visible",255,255,255,true) isInvisible[localPlayer] = false else for i,v in ipairs(getElementsByType("object")) do if getObjectScale(v) == 1 and objects[v] then setObjectScale(v, 0) objects[v] = nil end end outputChatBox("#406188[Visibility]: #FFFFFFAll visible parts are now #ff0000invisible",255,255,255,true) isInvisible[localPlayer] = true end end addCommandHandler("visibility", toggleStatus) function onMapStarting(mapInfo) if ( isInvisible[localPlayer] == false ) then for i,v in ipairs(getElementsByType("object")) do if ( getObjectScale( v ) == 0 ) then setObjectScale(v, 1) objects[v] = true outputChatBox("#406188[Visibility]: #FFFFFFPress #406188'i' #FFFFFFto make your objects #406188invisible",255,255,255,true) end end elseif ( isInvisible[localPlayer] == true ) then for i,v in ipairs(getElementsByType("object")) do if ( objects[v] == true ) then objects[v] = nil outputChatBox("#406188[Visibility]: #FFFFFFPress #406188'i' #FFFFFFto make your objects #406188visible",255,255,255,true) end end end end addEventHandler("onClientMapStarting", root, onMapStarting) addEventHandler("onClientResourceStart", root, function() for i,v in ipairs(getElementsByType("player")) do bindKey("i","down","visibility") isInvisible[v] = true end end ) addEventHandler("onClientPlayerJoin",root, function() isInvisible[localPlayer] = true end )
  15. Shux

    use all weapons

    You can't use them all at once.