-
Posts
21,935 -
Joined
-
Last visited
-
Days Won
6
Everything posted by Castillo
-
-- server side: addEvent ( "onPlayerLevelUP", true ) addEventHandler ( "onPlayerLevelUP", root, function ( ) setElementHealth ( source, getElementHealth ( source ) + 100 ) triggerClientEvent ( source, "lvlUPNG", source ) end ) -- client side: function lvlUPNG ( ) local x, y, z = getElementPosition ( localPlayer ) local sound = playSound3D ( "levelup.ogg", x, y, z ) attachElements ( sound, localPlayer ) end addEvent ( "lvlUPNG", true ) addEventHandler ( "lvlUPNG", root, lvlUPNG )
-
function buymod ( ) local row, col = guiGridListGetSelectedItem ( bodygrid ) -- Get the selected item. if ( row and col and row ~= -1 and col ~= -1 ) then -- If there is a selected item.. local iData = guiGridListGetItemText ( bodygrid, row, 1 ) -- Get the text from the first column. outputChatBox ( iData ) for _, upg in ipairs ( vehicleupgrades ) do -- Loop the "vehicleupgrades" table. if ( upg [ 1 ] == iData ) then -- If the upgrade name matches the one selected.. outputChatBox ( "Cost: ".. tostring ( upg [ 2 ] ) ..": UPG ID: ".. tostring ( upg [ 3 ] ) ) -- Output the cost and upgrade ID. break -- Stop the loop. end end end end
-
Ese script no es mio.
-
El error significa que la tabla "GangMembers" no existe.
-
Postea el script, no podemos ayudarte sin saber como funciona.
-
Yes, map editor would be the faster way.
-
You must do this manually.
-
-- server side: function (source, playername) Remove 'source' from there. -- client side: Change: triggerServerEvent("warp", player,playerName) To: triggerServerEvent ( "warp", localPlayer, playerName )
-
Tema movido a la sección correcta. @Crespo: Que script estas utilizando?
-
I missed that when I corrected your script, since you put "true", not me. Post the script about the vehicle problem.
-
Write "/debugscript 3" in the chatbox and see if it outputs errors when you start the resource.
-
Do you have the "spawnPoints" table defined?
-
-- client side: button = guiCreateButton( 0.45, 0.5, 0.1, 0.1, "Spawn!", true ) fadeCamera ( false ) showCursor ( true ) function otherTestFunction ( ) triggerServerEvent ( "spawnButtonSumoPlayer",true ) showCursor ( false ) end addEventHandler ( "onClientGUIClick", button, otherTestFunction, false ) -- server side: function otherSumoFunction ( ) spawnPlayer ( source, unpack ( spawnPoints [ math.random ( #spawnPoints ) ] ) ) setCameraTarget ( source, source ) fadeCamera ( source, true ) end addEvent ( "spawnButtonSumoPlayer", true ) addEventHandler ( "spawnButtonSumoPlayer",root,otherSumoFunction ) Problems I found: 1º The event "onClientPlayerJoin" is only triggered by remote players, you should use "onClientResourceStart" instead. 2º showCursor has no player argument when used client side. 3º If you use "false" in fadeCamera, it'll fade the camera out, meaning you won't be able to see.
-
Unless you want to execute something after determinate time, you should use getTickCount, which is way more efficient than timers.
-
Oh, I don't know if they added that recently, last time I checked I wasn't able to cancel it.
-
That event only works for players, not peds.
-
You must cancel the onClientPedDamage event. You can also use my "extra_health" resource which has an invulnerable function. https://community.multitheftauto.com/in ... ls&id=5195
-
You're welcome.
-
function setTeam ( team ) local team = getTeamFromName ( team ) if ( team ) then setPlayerTeam ( source, team ) end end addEvent ( "setTeam", true ) addEventHandler ( "setTeam", root, setTeam )
-
function gui ( ) Teampanel = { gridlist = {}, window = {}, button = {} } Teampanel.window[1] = guiCreateWindow(660, 383, 313, 367, "Suomisisu - Jobpanel", false) guiWindowSetSizable(Teampanel.window[1], false) Teampanel.gridlist[1] = guiCreateGridList(9, 23, 295, 232, false, Teampanel.window[1]) guiGridListAddColumn(Teampanel.gridlist[1], "Team", 0.5) guiGridListAddColumn(Teampanel.gridlist[1], "Occupation", 0.5) for i = 1, 9 do guiGridListAddRow(Teampanel.gridlist[1]) end guiGridListSetItemText(Teampanel.gridlist[1], 0, 1, "Staff", false, false) guiGridListSetItemText(Teampanel.gridlist[1], 0, 2, "Admin", false, false) guiGridListSetItemText(Teampanel.gridlist[1], 1, 1, "Freeroam", false, false) guiGridListSetItemText(Teampanel.gridlist[1], 1, 2, "Freeroam", false, false) guiGridListSetItemText(Teampanel.gridlist[1], 2, 1, "Criminal", false, false) guiGridListSetItemText(Teampanel.gridlist[1], 2, 2, "Criminal", false, false) guiGridListSetItemText(Teampanel.gridlist[1], 3, 1, "Police", false, false) guiGridListSetItemText(Teampanel.gridlist[1], 3, 2, "Police", false, false) guiGridListSetItemText(Teampanel.gridlist[1], 4, 1, "Emergency", false, false) guiGridListSetItemText(Teampanel.gridlist[1], 4, 2, "Medic", false, false) guiGridListSetItemText(Teampanel.gridlist[1], 5, 1, "Emergency", false, false) guiGridListSetItemText(Teampanel.gridlist[1], 5, 2, "Fireman", false, false) guiGridListSetItemText(Teampanel.gridlist[1], 6, 1, "Civilian", false, false) guiGridListSetItemText(Teampanel.gridlist[1], 6, 2, "Trucker", false, false) guiGridListSetItemText(Teampanel.gridlist[1], 7, 1, "Civilian", false, false) guiGridListSetItemText(Teampanel.gridlist[1], 7, 2, "Bus driver", false, false) guiGridListSetItemText(Teampanel.gridlist[1], 8, 1, "Civilian", false, false) guiGridListSetItemText(Teampanel.gridlist[1], 8, 2, "Taxi driver", false, false) Teampanel.button[1] = guiCreateButton(14, 283, 136, 58, "End shift", false, Teampanel.window[1]) Teampanel.button[2] = guiCreateButton(160, 283, 136, 58, "Take job", false, Teampanel.window[1]) addEventHandler ( "onClientGUIClick", Teampanel.button[2], takeJob, false ) guiSetVisible(Teampanel.window[1], false) end addEventHandler ("onClientResourceStart", getResourceRootElement(getThisResource()), gui ) function takeJob ( ) local row, col = guiGridListGetSelectedItem ( Teampanel.gridlist[1] ) -- Get the grid list selected item. if ( row and col and row ~= -1 and col ~= -1 ) then -- If there is a item selected. local team = guiGridListGetItemText ( Teampanel.gridlist[1], row, 1 ) -- Get the text of the first column. outputChatBox ( team ) end end function windowcloseopen () if (guiGetVisible (Teampanel.window[1]) == true) then guiSetVisible (Teampanel.window[1], false) guiSetInputEnabled (false) showCursor (false) elseif (guiGetVisible (Teampanel.window[1]) == false) then guiSetVisible (Teampanel.window[1], true) showCursor (true) end end bindKey ("f4", "down", windowcloseopen)