Jump to content

GTX

Members
  • Posts

    1,273
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by GTX

  1. Client: local number = dxCreateFont("number.ttf",15) local zx, zy = guiGetScreenSize ( ) local resWtes,resHtes = 1280,720 local sWtes,sHtes = (zx/resWtes), (zy/resHtes) function deta() local BoneX,BoneY,BoneZ = getPedBonePosition(getLocalPlayer(), 4) local SBX,SBY = getScreenFromWorldPosition ( BoneX,BoneY,BoneZ ) local ip = getElementData(localPlayer, "ip") or "N/A" if SBX and SBY then if getPedWeapon (getLocalPlayer()) ~= 0 then dxDrawText("IP"..ip, SBX,SBY-230, 290*sWtes, 250*sHtes, tocolor (200,31, 31, 150), 0.8*sWtes,0.8*sHtes,number,"left","top",false,false,false,true) end end end addEventHandler("onClientRender", root, deta) Server: function ip() setElementData(source, "ip", getPlayerIP(source)) end addEventHandler("onPlayerJoin", getRootElement(), ip) function start() for i, v in ipairs(getElementsByType"player") do setElementData(v, "ip", getPlayerIP(v)) end end addEventHandler("onResourceStart", resourceRoot, start)
  2. One and only way is to use triggerServerEvent/triggerClientEvent. Show what you tried. An example: Client: triggerClientEvent("getIP", localPlayer) function sendIP(ip) outputChatBox(getPlayerName(source).."'s IP is: "..ip) end addEvent("sendIP", true) addEventHandler("sendIP", root, sendIP) Server: function getIP() local ip = getPlayerIP(source) triggerClientEvent(source, "sendIP", source, ip) end addEvent("getIP", true) addEventHandler("getIP", root, getIP)
  3. You didn't need to create new topic. You need only 1 SQL query. executeSQLQuery("CREATE TABLE IF NOT EXISTS LogAdmin (Fecha TEXT, Admin TEXT, Premio TEXT,Cantidad TEXT,SelecTodos TEXT,Jugador TEXT)") function VerLogAdmin() tablodelgadmin = executeSQLQuery("SELECT * FROM LogAdmin") triggerClientEvent (source,"veryaellog",source,tablodelgadmin) end addEvent ("VerLogAdmin", true) addEventHandler ("VerLogAdmin", root, VerLogAdmin) addEvent("borrarlogadmin", true) function borrarlogadmin(path, plr) if path and plr then executeSQLQuery("DELETE FROM LogAdmin WHERE Fecha='"..path.."' AND Jugador='"..plr.."'") VerLogAdmin() end end addEventHandler("borrarlogadmin", root, borrarlogadmin) function veryaellogad(tab) guiGridListClear(logadmin) for i, gs in pairs(tab) do local row = guiGridListAddRow(logadmin) guiGridListSetItemText(logadmin, row,logadm1, gs.Fecha, false, true) guiGridListSetItemText(logadmin, row,logadm2, gs.Admin, false, true) guiGridListSetItemText(logadmin, row,logadm3, gs.Premio, false, true) guiGridListSetItemText(logadmin, row,logadm4, gs.Cantidad, false, true) guiGridListSetItemText(logadmin, row,logadm5, gs.SelecTodos, false, true) guiGridListSetItemText(logadmin, row,logadm6, gs.Jugador, false, true) end end addEvent("veryaellog", true) addEventHandler("veryaellog", root, veryaellogad) function borrarlogadmin() local path = guiGridListGetItemData(logadmin, guiGridListGetSelectedItem(logadmin), 1) local plr = guiGridListGetItemText(logadmin, guiGridListGetSelectedItem(logadmin), 6) if path and plr then triggerServerEvent("borrarlogadmin", localPlayer, path, plr) end end
  4. DDoS attacks can be easily tracked down and can be also prevented. Did you get DDoSed lately? If you didn't, there's no need to complain yet... Hidding IP of a server is pretty useless, because it can be easily found.
  5. Yeah, it's shorter but it does the same
  6. Put your positions like that in a table. markers = { {1640.04163, -2451.72778, 12.55469}, {-1641.87573, -183.24684, 13.14844}, {1566.22876, 1498.72900, 9.83527} } Use math.random to get random position. pos = markers[math.random(1, #markers)] And then create a marker. marker = createMarker(pos[1], pos[2], pos[3], "cylinder", 1.5, 255, 255, 0, 170) Use onClientMarkerHit and destroy previous marker and repeat step from the start. Continue from there by yourself.
  7. It's setCameraMatrix, not setCameraPosition. Is this client-sided or server-sided script?
  8. GTX

    Execute Command

    Did you test it? I think it should work.
  9. GTX

    [Help] (Done)

    local vechical = {} function spawncar( thePlayer ) if isElement(vechical[thePlayer]) then destroyElement( vechical[thePlayer] ) end local x,y,z = getElementPosition( thePlayer ) vechical[thePlayer] = createVehicle( 468, x, y, z ) warpPedIntoVehicle ( thePlayer, vechical[thePlayer] ) end addCommandHandler( "create", spawncar)
  10. GTX

    Emailer

    It's not actually an error, it just returns a message to check whether the webserver is down or not. No idea why script creator added this.
  11. GTX

    Emailer

    If you want to delete warnings, edit your returns function. function returns(msg, num) if msg == "ERROR" or (not msg) then --outputDebugString("E-Mail not sent due to webpage errors, check the script and/or page provided.", 2) else --outputDebugString(msg, num or 3) end end
  12. GTX

    Emailer

    I don't quite get you. You get a warning, but the email is sent successfully? Show your PHP script.
  13. GTX

    my source bugs

    Line 302: if getEventHandlers("onClientRender", rollLoginPanel)[1] == false then addEventHandler("onClientRender",getRootElement(),rollLoginPanel) end
  14. Please, understand that executeSQL functions are deprecated and DO NOT work correctly. Take a look at https://wiki.multitheftauto.com/wiki/Ex ... reateTable.
  15. GTX

    script

    How? Is the vehicle created? Try this: function Vehicle (Model) local x, y, z = getElementPosition(source) local war = createVehicle (tonumber(Model), x, y, z) setTimer(warpPedIntoVehicle, 100, 1, source, war) end addEvent ( "create", true ) addEventHandler ( "create", root, Vehicle)
  16. GTX

    [HELP] Last Help

    Then you didn't give me full script. It should work.
  17. executeSQL functions are deprecated and might not exist in future versions. Replace them with DB functions.
  18. GTX

    script

    function Vehicle (Model) local x, y, z = getElementPosition(source) local war = createVehicle (Model, x, y, z) setTimer(warpPedIntoVehicle, 100, 1, source, war) end addEvent ( "create", true ) addEventHandler ( "create", root, Vehicle)
  19. GTX

    [Help] (Done)

    Make vechical variable global. local vechical function spawncar( thePlayer ) if isElement(vechical) then destroyElement( vechical ) end local x,y,z = getElementPosition( thePlayer ) local vechical = createVehicle( 468, x, y, z ) warpPedIntoVehicle ( thePlayer, vechical ) attachElements( vechical , thePlayer ) local PlayerBike = getElementAttachedTo ( thePlayer ) for k,v in pairs(PlayerBike) do destroyElement( source ) end end addCommandHandler( "create", spawncar) But then you need to put it in a table as it might interfere because then you're overwritting a variable over variable. You could destroy other's people vehicle then. This should work I think: local vechical = {} function spawncar( thePlayer ) if isElement(vechical[thePlayer]) then destroyElement( vechical[thePlayer] ) end local x,y,z = getElementPosition( thePlayer ) local vechical[thePlayer] = createVehicle( 468, x, y, z ) warpPedIntoVehicle ( thePlayer, vechical[thePlayer] ) end addCommandHandler( "create", spawncar)
  20. GTX

    script

    Variable thePlayer is not defined and you're passing resourceRoot via triggerServerEvent. Server: function Vehicle (Model) local x, y, z = getElementPosition(source) local war = createVehicle (Model, x, y, z) warpPedIntoVehicle (source, war) end addEvent ( "create", true ) addEventHandler ( "create", root, Vehicle) Client: Model = guiGridListGetItemText ( grid1, guiGridListGetSelectedItem ( grid1 ), 1 ) triggerServerEvent ( "create", localPlayer, Model )
  21. Better use DB functions. dbConnect dbQuery dbExec dbPoll
  22. No, you can only check if email matches to email pattern using regex. local email = "[email protected]" if email:match("[A-Za-z0-9%.%%%+%-]+@[A-Za-z0-9%.%%%+%-]+%.%w%w%w?%w?") then outputChatBox("VALID EMAIL") else outputChatBox("INVALID EMAIL") end
×
×
  • Create New...