SDK
Members-
Posts
635 -
Joined
-
Last visited
Everything posted by SDK
-
What? That's only working on the player who typed the command ... This has an extra check for you typing the right name: function push1 (thePlayer, commandName, who) player = getPlayerFromName(who) if not player then outputChatBox("* /push: player not found", thePlayer) elseif isPedInVehicle(player) then local vehicle = getPedOccupiedVehicle(player) x,y,z = getElementVelocity(vehicle) setElementVelocity ( vehicle, x, y, z+0.20) outputChatBox("* You have been pushed by ".. getPlayerName(thePlayer),player,0,255,0) end end addCommandHandler("push", push1)
-
you're free to look here https://community.multitheftauto.com/index.php?p=resources But I don't think there will be many scripts that meet your requirements
-
Like that kid says: viewtopic.php?f=91&t=27027 And is this an edited version of a resource?
-
https://wiki.multitheftauto.com/wiki/SetVehicleColor https://wiki.multitheftauto.com/wiki/GetVehicleColor have new syntaxes in 1.1 Suggestion: maybe you could update/convert these libraries for n++ too?
-
No, you use a scrollPane instead of a scrollbar. If I'm right, scrollbar's are used for inputting values, like sound volume or other settings in GUI's. Everything inside a scrollPane that's bigger then the scrollPane itself will make the scrollbars itself. GUIEditor_Window = {} GUIEditor_TabPanel = {} GUIEditor_Tab = {} GUIEditor_Label = {} Window= guiCreateWindow(171,158,452,337,"Help Menu",false) tabPanel = guiCreateTabPanel(19,34,411,287,false,Window) scrollTab = guiCreateTab("FAQ",tabPanel) scrollPane = guiCreateScrollPane(5,5,200,200,false,scrollTab) info = guiCreateLabel(17,13,361,243,"A BUNCH OF TEXTTTT(enough to need the scrolling becuase it gets cut off",false,scrollPane )
-
then add "if killer == getLocalPlayer()" Maybe you should try to learn it anyway, this is very basic
-
you need guiCreateScrollPane put the label's parent the scrollpane
-
addEventHandler("onClientPlayerWasted", getRootElement(), kill) 1. learn to script 2. go fight somewhere else
-
To make sure the client resource is start, use onClientResourceStart instead of onPlayerJoin
-
How do you want to create the marker for teleporting? Should it be on resource start or when a player types /createmarker?
-
-snip- I should look better Edit: btw, this is a modified example from the wiki you're using, are you still trying to make that teleport?
-
You're messing up, don't try modifying code that doesnt have to do with the sounds, only replace the sounds code. This should work for nitro's and repairs. function handleHitPickup(pickup) if pickup.type == 'vehiclechange' then if pickup.vehicle == getElementModel(g_Vehicle) then return end g_PrevVehicleHeight = getElementDistanceFromCentreOfMassToBaseOfModel(g_Vehicle) end triggerServerEvent('onPlayerPickUpRacePickupInternal', g_Me, pickup.id, pickup.respawn) -- new sounds if pickup.type == 'vehiclechange' then playSoundFrontEnd(46) else playSound("sfx/repair.wav") end end
-
For only nitro's and repairs, you could do if pickup.type == 'vehiclechange' then playSoundFrontEnd(46) else playSound("file.wav")
-
yes, tonumber(gettok( guiGetText(GUIEditor_Edit[1]), 1, string.byte(',') ))
-
1) use tonumber() 2) remove the wrong arguments ... now it is: client sends getLocalPlayer(),R,G,B,PVeh,P server receives R,G,B,PVeh,P
-
look for this function in race_client.lua (line ~447) function handleHitPickup(pickup) if pickup.type == 'vehiclechange' then if pickup.vehicle == getElementModel(g_Vehicle) then return end g_PrevVehicleHeight = getElementDistanceFromCentreOfMassToBaseOfModel(g_Vehicle) end triggerServerEvent('onPlayerPickUpRacePickupInternal', g_Me, pickup.id, pickup.respawn) playSoundFrontEnd(46) end You should replace the playSoundFrontEnd
-
quick script addEventHandler("onPlayerLogin", root, function(prev, new) local acc_name = getAccountName ( new ) if isObjectInACLGroup("user." .. acc_name, aclGetGroup ( "Admin" ) ) then setPlayerTeam(source, getTeamFromName("Admin")) end end)
-
You should add more info, , what do you want the script to do, what doesn't work, what errors does /debugscript 3 give ... For now, these remarks: 1) gettok returns a string 2) you're sending the local player 3 times using that server event: source, 1st arg and last arg
-
Use /debugscript 3 to detect errors. I don't know what your code does, but the setElementData parts are wrong. Should be this way: setElementData(getLocalPlayer(), "Rank", "Level 10")
-
Why do you have the variable counter in there? And why are you using it as your money local starttick, currenttick local player = getLocalPlayer() addEventHandler("onClientRender",getRootElement(), function() if not starttick then starttick = getTickCount() end currenttick = getTickCount() if currenttick - starttick >= 1000 then setElementData(player,"money",getPlayerMoney( player ) ) starttick = getTickCount() end end ) Btw, it would be easier to use a serverside timer for this, there's no need to do it clientside in onClientRender function updateMoney() for k, v in ipairs(getElementsByType('player')) do local money = getPlayerMoney(v) setElementData(v,"money",money ) end end setTimer(updateMoney, 1000, 0)
-
Seems like ad_base_c.lua has the positions for the rockets, and ad_base_s.lua has the positions for the area (createColRectangle - first line) Syntax for createColRectangle = https://wiki.multitheftauto.com/wiki/CreateColRectangle
-
This isn't a request forum, try copying some function from another resource that doesn't need full names (like the admin resource). Then try to integrate it in your script and come back if it doesn't work.
-
split was an example function https://wiki.multitheftauto.com/wiki/Split os. functions are not supported, you can get the time and do file stuff with these: https://wiki.multitheftauto.com/wiki/GetRealTime https://wiki.multitheftauto.com/wiki/FileCreate
-
two ways: 1) using runcode (first start runcode resource), this can be done on the server console (example: "run split") or in the server when you're admin ("/run split") 2) using the admin panel ingame, at the resources tab (just "split" should do)
