Jump to content

Patrick

Moderators
  • Posts

    1,143
  • Joined

  • Last visited

  • Days Won

    43

Everything posted by Patrick

  1. Patrick

    Help on table

    -- render column when panel showing function referee.renderColumns() for i, column in ipairs (referee["Status"].columns) do dxDrawText(column[2], referee.x + textmoveX + moveSide, referee.y + positionY, sizeX, sizeY + column.height,tocolor(255,255,255,255*referee.getPanelAlpha), referee.fontSize, referee.font, "center","top",false) offsetY = offsetY + column.height end end Remove local offsetY = 0
  2. Patrick

    Help on table

    uppercase letter S, I missed
  3. Patrick

    Help on table

    Use like this -- render column when panel showing function referee.renderColumns() local offsetY = 0 for i, column in ipairs (referee["status"].columns) do dxDrawText(column[2], referee.x + textmoveX + moveSide, referee.y + positionY, sizeX, sizeY + column.height,tocolor(255,255,255,255*referee.getPanelAlpha), referee.fontSize, referee.font, "center","top",false) offsetY = offsetY + column.height end end
  4. Patrick

    Help on table

    Where you call renderColumns?
  5. Patrick

    Help on table

    Where you call renderColumns?
  6. I think your hosting disabled it for security reasons. Contact their support.
  7. I have no idea, but it's works: http://skycore.hu/test/index.php Something wrong in your webserver settings.
  8. This is my server... the code don't work with that? Because it's works for me.
  9. Patrick

    Help on table

    I don't know whats the problem because I don't know the full code and I don't really understand what you want to do. Maybe the offsetX, put it inside the for loop, after dxDrawText.
  10. I don't know what is EYE1 but this code works with my server, so I think the problem is in your server settings. Check your $data variable value. Whats is in it? For me: EYE1mta22003(SkyDayZ | MTA DayZ Europe [HUN|ENG|GER]SkyDayZNone1.50060 Whats your MTA server ip and port?
  11. It has to work. Health is probably stored in elementData so getElementHealth() always returns 100
  12. Patrick

    Help on table

    ipairs instead of pairs at line 9.
  13. https://wiki.multitheftauto.com/wiki/IsPedDead if getElementData(pedsz, "zombie") and not isPedDead(pedsz) then ... end
  14. Use this SDK for complex requests: https://wiki.multitheftauto.com/wiki/PHP_SDK And here is your fixed code, for request basic server informations: <?php class CSocketMTA { function CSocketMTA($IP, $PORT = 22003) { if ($socket = fsockopen("udp://$IP", $PORT + 123, $errno, $errstr)) { stream_set_timeout($socket, 1, 0); fwrite($socket, "s"); $data = fread($socket, 16384); fclose($socket); if (substr($data, 0, 4) == "EYE1") { $data = substr($data, 4); for ($i = 0; $data != ""; $i++) { if (substr($data, 0, 2) == chr(1)."?") $data = substr($data, 2); $l = ord(substr($data, 0, 1)); $buffer[$i] = substr($data, 1, $l - 1); $data = substr($data, $l); } $this->ip = $IP; $this->gameshort = $buffer[0]; $this->port = $buffer[1]; $this->name = $buffer[2]; $this->rules['game'] = $buffer[3]; $this->map = $buffer[4]; $this->rules['version'] = $buffer[5]; $this->public = $buffer[6] != "0"; $this->players = $buffer[7]; $this->maxplayers = $buffer[8]; $j = 0; for ($i = 11; $i < sizeof($buffer) - 2; $i += 5) { $this->player[$j]->name = $buffer[$i]; $this->player[$j]->score = $buffer[$i+3]; $this->player[$j]->time = 0; $j++; } } else echo "Data is invalid\n"; } else echo "Can not open socket $IP:$PORT - $errstr\n"; } }; $MTA = new CSocketMTA("dayz.skycore.hu", 22003); echo "Name: " . $MTA->name . "<br>"; echo "IP: " . $MTA->ip . "<br>"; echo "Players: " . $MTA->players."/".$MTA->maxplayers . "<br>";
  15. -- SERVER SIDE addCommandHandler("destroy", function() for _, vehicle in ipairs(getElementsByType("vehicle")) do if (not getVehicleController(vehicle)) then destroyElement(vehicle); end end end)
  16. I don't understand, but if you write in pm I will help.
  17. -- SERVER SIDE local aclSpawns = { ["Police"] = {0, 0, 3}, } addEventHandler("onPlayerLogin", root, function(_, account) for aclname, pos in pairs(aclSpawns) do if isObjectInACLGroup("user."..getAccountName(account), aclGetGroup(aclname)) then setElementPosition(source, pos[1], pos[2], pos[3]) return end end end) something like that
  18. If fetch was success, the 'error' equals 0. So, 'if (error) then' always true. You need to terminate the function and print the error, if 'error' not equals or greater then 0. Hungarian: A visszakapott error változó mindig vesz fel értéket, ha minden rendben volt, akkor nullát. Mivel 'if (error) then' mindig igaz lesz, ezért minden esetben kilépsz a funckcióból a returnal. Correct: -- SERVER SIDE function newCommand(player, cmd, code) fetchRemote('http://domain.tld/index.php?get&code='..code, function(data, error) if (error ~= 0) then return print(error); end print("Result: " .. data); end); end addCommandHandler('cmd', newCommand);
  19. addCommandHandler getElementPosition getDistanceBetweenPoints3D
  20. Patrick

    Discord Python

    Maybe an option. https://wiki.multitheftauto.com/wiki/PHP_SDK
  21. Not exactly what you want, but it might help. https://community.multitheftauto.com/index.php?p=resources&s=details&id=2542
  22. Patrick

    2 Questions

    1: https://wiki.multitheftauto.com/wiki/SetPlayerNametagShowing 2: I don't uderstand.
  23. I think you want to run the code on server side. This is client sided code.
  24. -- SERVER SIDE function onJoin() setPedArmor(source, 100) local playerName = getPlayerName(source) triggerClientEvent(source, "createInfoBox", source, "Sikeresen Bejelentkeztél", "success") end addEventHandler("onPlayerJoin", root, onJoin)
×
×
  • Create New...