-
Posts
1,056 -
Joined
-
Last visited
Everything posted by Sasu
-
https://community.multitheftauto.com/index.php?p= ... tails&id=6
-
How can I upload an image that I took with takePlayerScreenShot to a web site?
-
The variable "GUIEditor.Grid" change to "GUIEditor.Grid[1]" and add in the script GUIEditor = { Grid = {} } Because the "." is for a subtable in a table. idk how to explain.
-
local msgs = { 'noob', 'murio', 'diee!' } function playerDied ( totalAmmo, killer, killerWeapon, bodypart ) if bodypart then local text = msgs [ math.random ( 1, #msgs ) ] outputChatBox ( getPlayerName ( source ) .." ".. text .." ".. getBodyPartName ( bodypart ).." !", root, 255, 255, 255, true ) end end addEventHandler ( "onPlayerWasted", getRootElement(), playerDied )
-
I sent the XML to the client. Try that and tell me if it's wrong
-
local msgs = { 'noob', 'murio', 'diee!' } function playerDied ( totalAmmo, killer, killerWeapon, bodypart ) local text = msgs [ math.random ( 1, #msgs ) ] outputChatBox ( getPlayerName ( source ) .." ".. text .." ".. getBodyPartName ( bodypart ) or "N/A" .." !", root, 255, 255, 255, true ) end addEventHandler ( "onPlayerWasted", getRootElement(), playerDied )
-
Show us the part of the script where you try to connect to the mysql.
-
Server: addEvent("onResourceStartClient", true) addEventHandler("onResourceStartClient", root, function() triggerClientEvent("passXMLBans", source, banlist) end) addEventHandler("onPlayerJoin", root, function() setElementData(source, "PlayerIP", getPlayerIP(source)) end) Client: addEventHandler("onClientResourceStart", resourceRoot, function() triggerServerEvent("onResourceStartClient", localPlayer) end) addEvent("passXMLBans", true) addEventHandler("passXMLBans", root, function(theXML) banlist = theXML end) function getPlayerBantime( ) assert ( isElement ( localPlayer ) and getElementType ( localPlayer ) == "player", "Bad player element" ) local ip = getElementData( localPlayer, "PlayerIP" ) or "N/A" local serial = getPlayerSerial ( localPlayer ) if ( localPlayer ) then local theBans = xmlNodeGetChildren( banlist ) for i, theNode in ipairs( theBans ) do local theValueSerial = xmlNodeGetAttribute( theNode, "Serial" ) local theValueIP = xmlNodeGetAttribute( theNode, "IP" ) if ( theValueSerial == serial) or ( theValueIP == ip ) then local theValue = xmlNodeGetAttribute( theNode, "Bantime" ) return theValue else return false end end end end addEventHandler( "onClientRender", getRootElement(), function() local btime = getPlayerBantime( ) dxDrawText( btime, sx*0.2, sy*0.1, sx, sy, tocolor(255,0,0,255),(sx/1024)*0.5,"bankgothic","left","top",false,false,false ) end)
-
local marker = createMarker(1573.3645019531, -1878.6141357422 , 12.2, "cylinder", 1.5, 255 ,255, 255, 155) local veh = {} function vehicle(thePlayer) if getElementType(thePlayer) == "player" then if isPedInVehicle(thePlayer) then return end if isElement( veh[thePlayer] ) then destroyElement( veh[thePlayer] ) end local x,y,z = getElementPosition(thePlayer) veh[thePlayer] = createVehicle(411, x,y,z) warpPedIntoVehicle(thePlayer, veh[thePlayer]) end end addEventHandler("onMarkerHit", marker, vehicle)
-
Solo agrega esto: addEventHandler("onClientRender", root, function() guiSetText(L_Ping, "Ping: "..tostring(getPlayerPing(getLocalPlayer()))) end)
-
En la linea 13, puedes cambiarlo a esto si es en el mismo recurso: stopResource(getThisResource())
-
O tal vez se refiera a setVehicleLocked
-
es una useful function... Y yo que dije?
-
Usa la funcion useful setElementSpeed
-
You can use this: local myCars = {} addEventHandler("onVehicleDamage", root, function() if getElementHealth(source) < 300 and not myCars[source] then myCars[source] = true setElementHealth(source, 300) setVehicleDamageProof(source, false) end end) If the car's health has less than 300 then set the vehicle damage proof to false.
-
source is the localPlayer triggerServerEvent("subirPlayer", localPlayer) And in the line 3, I check that the player "source" is correctly.
-
function montar() warpPedIntoVehicle(conductor, carro) outputChatBox(tostring(source)..", "..getPlayerName(source) or "Failed!!", root) try = warpPedIntoVehicle(source, carro, 4) outputChatBox(tostring(try), root) triggerClientEvent("startTravel", root, conductor) end addEvent("subirPlayer", true) addEventHandler("subirPlayer", root, montar) I have this function that is trigger when I press a button. But for any reason the warpPedIntoVehicle in line 4 returns me false. I cant warp the player to the carro who is defined with createVehicle. The warpPedIntoVehicle in line 2 works perfectly. Why the other dont work?
-
Another easy way is using table.concat : local languages = {"English","Dutch","Test"} outputChatBox(table.concat(languages, ", "), player, 255, 0,0, true)
-
Dijo player asi que deberia cancelar el evento onClientPlayerDamage
-
Puedes usar getTickCount
-
In the last update, the scripr was simplified to 150 lines.
