-
Posts
21,935 -
Joined
-
Last visited
-
Days Won
6
Everything posted by Castillo
-
getElementModel or getVehicleModelFromName
-
iv = { } function toggleInvis ( thePlayer ) local account = getPlayerAccount ( thePlayer ) if ( not account or isGuestAccount ( account ) ) then return end local accountName = getAccountName ( account ) if ( isObjectInACLGroup ( "user.".. accountName, aclGetGroup ( "Nick en Mitchel" ) ) ) then if ( iv [ thePlayer ] == 0 ) then iv [ thePlayer ] = 1 setPlayerNametagShowing ( thePlayer, false ) setElementAlpha ( thePlayer, 0 ) else iv [ thePlayer ] = 0 setPlayerNametagShowing ( thePlayer, true ) setElementAlpha ( thePlayer, 255 ) end end end addCommandHandler ( "invisible", toggleInvis ) Errors: 1: You we're using "thePlayer" insead of "source" @ getPlayerAccount. 2: You had a global variable, you should use a table to check the player invisibility status.
-
By vehicle ID's you mean their vehicle model?
-
addEvent ( "UpdateLocation", true ) function updateLocations ( location ) outputChatBox ( type ( location ) ..": ".. tostring ( location ) ) local amount = guiGridListGetRowCount ( locationsList ) or 1 for row = 1, amount do if ( guiGridListGetItemText ( locationsList, row, 1 ) ~= location ) then local row = guiGridListAddRow ( locationsList ) guiGridListSetItemText ( locationsList, row, 1, location, false, false ) end end end addEventHandler ( "UpdateLocation", localPlayer, updateLocations ) Tell me what does it output in the chat.
-
Que yo sepa ese script es de Valhalla Roleplay, osea que el esta usando uno de los paquetes que tienen los scripts.
-
What is "location" argument? a string?
-
@Soren: Copia mi codigo, le puse algo asi podes agregar cuantos skins quieras.
-
addEvent ( "UpdateLocation", true ) function updateLocations ( location ) local amount = guiGridListGetRowCount ( locationsList ) or 1 for row = 1, amount do if ( guiGridListGetItemText ( locationsList, row, 1 ) ~= location ) then local row = guiGridListAddRow ( locationsList ) guiGridListSetItemText ( locationsList, row, 1, location, false, false ) end end end addEventHandler ( "UpdateLocation", localPlayer, updateLocations )
-
1: La variable "rotation" no esta definida, por eso el ped no rotava. 2: Si te fijas en la wiki, los skins no empiezan de 1, 2, 3, 4, etc: https://wiki.multitheftauto.com/wiki/All_Skins_Page 3: Usa esto: GUIEditor_Button = {} GUIEditor_Edit = {} local rotation = 0 local numero = 1 local skins = { 0, 7, 9, 10, 11 } -- Esos son los primeros skins de la lista. GUIEditor_Button[1] = guiCreateButton(624,753,104,33,"<~~",false) GUIEditor_Button[2] = guiCreateButton(883,753,104,33,"~~>",false) GUIEditor_Button[3] = guiCreateButton(751,796,104,33,"Play!",false) GUIEditor_Edit[1] = guiCreateEdit(751,753,103,29,"",false) for i=1, 3 do guiSetVisible ( GUIEditor_Button[i], false ) end guiSetVisible ( GUIEditor_Edit[1], false ) addEvent("onVisible",true) addEventHandler("onVisible", getLocalPlayer(), function() for i=1, 3 do guiSetVisible ( GUIEditor_Button[i], true ) end guiSetVisible ( GUIEditor_Edit[1], true ) showPlayerHudComponent ("radar",false) showCursor(true) guiSetInputMode("no_binds_when_editing") triggerServerEvent("onCameraMatrix", getLocalPlayer()) ped = createPed( 0, -1586.671875, 1351.53125, 8.2823114395142 ) end ) addEventHandler("onClientGUIClick", root, function() if source == GUIEditor_Button[3] then guiSetVisible(GUIEditor_Button[1],false) guiSetVisible(GUIEditor_Button[2],false) guiSetVisible(GUIEditor_Button[3],false) guiSetVisible(GUIEditor_Edit[1],false) setCameraTarget( localPlayer ) showCursor(false) setElementPosition( localPlayer, 2580.7265625, 2328.77734375, 17.822208404541) local skin = getElementModel( ped ) setElementModel( localPlayer, tonumber(skin) ) destroyElement(ped) showPlayerHudComponent ("radar",true) end end ) function rotateTempPed ( ) if isElement ( ped ) then rotation = rotation + 1 if ( rotation > 359 ) then rotation = 0 end setPedRotation ( ped, rotation ) end end addEventHandler ( "onClientRender", root, rotateTempPed ) function on_pushButton_2_clicked ( button, state ) if ( button == "left" and state == "up" ) then if ( numero == 1 ) then return end numero = numero - 1 setElementModel ( ped, skins [ numero ] ) end end addEventHandler ( "onClientGUIClick", GUIEditor_Button[1], on_pushButton_2_clicked ) function on_pushButton_3_clicked ( button, state ) if ( button == "left" and state == "up" ) then if ( numero >= #skins ) then return end numero = numero + 1 setElementModel ( ped, skins [ numero ] ) end end addEventHandler ( "onClientGUIClick", GUIEditor_Button[2], on_pushButton_3_clicked )
-
for row = 1, guiGridListGetRowCount ( theGridList ) do -- Code here. end
-
for index, value in ipairs ( yourTable ) do --Code end
-
You're welcome.
-
GUIEditor_Button = {} GUIEditor_Edit = {} GUIEditor_Button[1] = guiCreateButton(624,753,104,33,"<~~",false) GUIEditor_Button[2] = guiCreateButton(883,753,104,33,"~~>",false) GUIEditor_Button[3] = guiCreateButton(751,796,104,33,"Play!",false) GUIEditor_Edit[1] = guiCreateEdit(751,753,103,29,"",false) for i=1, 3 do guiSetVisible ( GUIEditor_Button[i], false ) end guiSetVisible ( GUIEditor_Edit[1], false ) addEvent("onVisible",true) addEventHandler("onVisible", getLocalPlayer(), function() for i=1, 3 do guiSetVisible ( GUIEditor_Button[i], true ) end guiSetVisible ( GUIEditor_Edit[1], true ) showPlayerHudComponent ("radar",false) showCursor(true) guiSetInputMode("no_binds_when_editing") triggerServerEvent("onCameraMatrix", getLocalPlayer()) ped = createPed( 0, -1586.671875, 1351.53125, 8.2823114395142 ) end ) addEventHandler("onClientGUIClick", root, function() if source == GUIEditor_Button[3] then guiSetVisible(GUIEditor_Button[1],false) guiSetVisible(GUIEditor_Button[2],false) guiSetVisible(GUIEditor_Button[3],false) guiSetVisible(GUIEditor_Edit[1],false) setCameraTarget( localPlayer ) showCursor(false) setElementPosition( localPlayer, 2580.7265625, 2328.77734375, 17.822208404541) local skin = getElementModel( ped ) setElementModel( localPlayer, tonumber(skin) ) destroyElement(ped) showPlayerHudComponent ("radar",true) end end ) function rotateTempPed ( ) if isElement ( ped ) then rotation = rotation + 1 if ( rotation > 359 ) then rotation = 0 end setPedRotation ( ped, rotation ) end end addEventHandler ( "onClientRender", root, rotateTempPed ) numero = 0 function on_pushButton_2_clicked ( button, state ) if ( button == "left" and state == "up" ) then if ( numero == 1 ) then return end numero = numero - 1 setElementModel ( ped, numero ) end end addEventHandler ( "onClientGUIClick", GUIEditor_Button[1], on_pushButton_2_clicked ) function on_pushButton_3_clicked ( button, state ) if ( button == "left" and state == "up" ) then if ( numero >= 5 ) then return end numero = numero + 1 setElementModel ( ped, numero ) end end addEventHandler ( "onClientGUIClick", GUIEditor_Button[2], on_pushButton_3_clicked )
-
Yo no presumi de nada, aqui tienen toda la conversacion si quieren leerla y opinar.
-
As far as I know it should be: "flags" and "0x000800".
-
Only if you use setWeaponProperty.
-
You're welcome.
-
Oh, I forgot to change something, copy the code again.
-
1: "source" from "onResourceStart" is the resource that got started, you must loop online players. 2: You forgot to define "thePlayer" and "opGUI" function. 3: Use this: function opGUI ( thePlayer ) local accName = getAccountName ( getPlayerAccount ( thePlayer ) ) if isObjectInACLGroup ( "user.".. accName, aclGetGroup ( "Admin" ) ) then triggerClientEvent ( thePlayer, "onVisibleAdmin", thePlayer ) end end addEventHandler ( "onPlayerJoin", root, function ( ) bindKey ( source, "p", "down", opGUI ) end ) addEventHandler ( "onResourceStart", resourceRoot, function ( ) for index, player in ipairs ( getElementsByType ( "player" ) ) do bindKey ( player, "p", "down", opGUI ) end end )
-
By default, is not. But there's a function around the forums, it's name is: guiCreateColorLabel, you can search for it.
-
You must use the function: setVehicleHandling or setModelHandling.
-
Just post here when you don't understand something or want help.