[code][debug] Run time error 4: "Array index out of bounds"
[debug] Attempted to read/write array element at index 20 in array of size 20
[debug] AMX backtrace:
[debug] #0 003c0a00 in public OnPlayerKeyStateChange (playerid=0, newkeys=65536, oldkeys=0) at E:SA-MPPSSgamemodespst.pwn:28779[/code]
Witam, mam problem, wyskakuje mi blad attempt to compare number with string i nie rozumiem o co chodzi (XD)
Tutaj dam czesc kodu ktory jest zwiazany z tym bledem:
setTimer(function()
if not getElementData(localPlayer,'logedin') then return end
if (getElementData(localPlayer, "blood") <= 0) then <-- linijka 708
if not getElementData(localPlayer, "isDead") then
local grunt = getGroundPosition(getElementPosition(localPlayer))
triggerServerEvent("kilLDayZPlayer", localPlayer, false, false,false,grunt);
end
end
if (getElementData(localPlayer, "blood") > 12000) then
setElementData(localPlayer, "blood", 12000);
end
end,50,0)
[/code]
tutaj 361
function math.round(number, decimals, method)
local decimals = decimals or 0;
local factor = 10^decimals;
if (method == "ceil" or method == "floor") then
return math[method](number*factor)/factor;
else
return tonumber(("%."..decimals.."f"):format(number)); <--- linijka 361
end
end
W konsoli wyskakuje mi takie co?:
ERROR: Couldn't parse meta file for resource 'dawaniekasy'
Loading of resource 'dawaniekasy' failed
nie mam poj?cia o co chodzi.
Z G?RY, NIE WIEM CZY NAPISA?EM W DOBRYM DZIALE JAK CO? PROSZ? O PRZENIESIENIE GO, A NIE USUWANIE!
Cze?? napisa?em tutaj oto taki skrypt:
function wyjsciegracza ()
ostatniemiejsce = getElementPosition (source)
end
addEventHandler("onPlayerQuit", root, wyjsciegracza)
function spawngraczy ()
if ostatniemiejsce == nil then
spawnPlayer (source, -289.42081, 1557.35437, 53.55873)
elseif ostatniemiejsce ~= nil then
spawnPlayer (source, getElementPosition)
end
addEventHandler("onPlayerJoin", root, spawngraczy)
Ten kod jest na "respienie graczy" jak gracz jest nowy to respi go w miejscu wyznaczonym coordynatami, a jak juz gral gracz na serwerze to respi go w ostatnim miejscu, mo?e kto? mi pom?c bo wyskakuje mi takie co? w konsoli i nie do ko?ca wime jak to naprawi? z g?ry dzi?ki, stawiam piwko!
[2017-08-12 10] Starting Spawngraczy
[2017-08-12 10] SCRIPT ERROR: Spawngraczys_dolacz.lua:13: 'end' expected (to close 'function' at line 7) near '<eof>'
[2017-08-12 10] ERROR: Loading script failed: Spawngraczys_dolacz.lua:13: 'end' expected (to close 'function' at line 7) near '<eof>'
C:UsersPatrykDesktopelo.pwn(168) : error 017: undefined symbol "foreach"
C:UsersPatrykDesktopelo.pwn(168) : error 029: invalid expression, assumed zero
C:UsersPatrykDesktopelo.pwn(168) : error 017: undefined symbol "i"
C:UsersPatrykDesktopelo.pwn(168) : fatal error 107: too many error messages on one line
Cze?? mam problem poniewaz mam pewien kod o tasmie policyjnej ale mi nie dziala poniewaz tam trzeba duty. Dalo by sie to zrobic bez daty? ze od razu ktos z ACL moze jej uzywac? link: http://www119.zippyshare....police_line.zip
(Mog?em zle nazwac funkcje ;-;) Witajcie! Chcia?bym si? spyta? oco chodzi w create Col Cuboid? a bardziej o : float fWidth, float fDepth, float fHeight
Witajcie. Szuka?em, ale nie znalaz?em poradnika t?umacz?cego oco chodzi
w np. function(plr) Jest to przyk?ad.. plr co to w?a?ciwie jest? Ale wracaj?c
Od czego zale?y argument wpisany pomi?dzy () ? Prosz? o szybk? odpowiedz!
Gdy nak?adam kajdanki, to potem jak jeszcze raz napisze kajdanki to nie zdejmuje tylko ponownie zak?ada kajdanki, jak si? RC zrobi to nie ma si? ju? wiecie jak to naprawi?, Prosze o pomoc bo nie wiem co robi?.
function blokada ( player, seat, jacked )
local kategoria = getElementData(player, "kajdanki")
if kategoria ~= false then
if ( not policeVehicles[getElementModel(source)] ) then
cancelEvent()
outputChatBox("#FF0000Masz kajdanki i nie mo?esz wsi??? do tego pojazdu.",player,255, 0, 0, true)
end
end
end
addEventHandler ("onVehicleStartEnter", getRootElement(), blokada)
function kajdankii ( player, cmd, gracz )
if getElementData(player,'player:duty') and getElementData(player,'player:duty')=='SAPD' then
if not (gracz) then
outputChatBox("B??d! U?yj: /kajdanki <nick/ID> ",player)
return
end
local targetElement=exports['ogrpg-core']:findPlayer(player, gracz)
if targetElement then
local x, y, z = getElementPosition(player)
local tx, ty, tz = getElementPosition(targetElement)
local distance = getDistanceBetweenPoints3D(x, y, z, tx, ty, tz)
if (distance<=10) then
local dokogo=getElementData(targetElement,"kajdanki")
if (not dokogo or not isElement(dokogo)) then
toggleControl(targetElement, "sprin...
Co mam zrobi?? bo nie wiem , Bo chce zrobi? 6 miejsc na tunera, a potem jak to robie i chce zamontowa? cz?s?, nie dzia?a montowanie i taki mi w?asnie problem wyskakuje w konsoli...
[2017-05-24 18:09] ERROR: Client (#FCD307LeFeS) triggered serverside event montazElementu, but event is not added serverside
[lua]--[[
This script was made by Xownage, please do not re-release any part of this script without xownage's permission
--]]
player = getRootElement()
function clickmenupd (mouseButton, buttonState, clickedElement, worldPosX, worldPosY, worldPosZ, screenPosX, screenPosY)
-- outputChatBox ("1")
if ( buttonState == "down" ) then
-- outputChatBox ("2")
local team = getPlayerTeam(source)
if team then
if getTeamName(team) == "DUPA" and isObjectInACLGroup ( "user."..getAccountName(getPlayerAccount(source)), aclGetGroup("RCON")) then
-- outputChatBox ("3")
if ( getElementData ( source, "pdclickopen" ) == false ) then
-- outputChatBox ("4")
if ( getElementData (source, "pdmousebind") == true ) then
-- outputChatBox ("5")
if ( mouseButton == "right" ) then
if ( clickedElement ) then
function MarkerHit2 (hitPlayer, matchingDimension) local playera = hitPlayer if getElementType( playera ) == "player" then
moveObject ( bra2, 2000, 1179.5,-907.40002441406,153.30000305176) end
end
end
addCommandHandler("otwieraj",MarkerHit2 )
local function follow()
local dokogo=getElementData(localPlayer,"kajdanki")
if (not dokogo or not isElement(dokogo)) then
setElementData(localPlayer,"kajdanki", nil)
removeEventHandler("onClientPreRender", root, follow)
triggerServerEvent("setPedAnimation", localPlayer)
return
end
if (getPedOccupiedVehicle(dokogo) or getElementInterior(dokogo)~=getElementInterior(localPlayer) or getElementDimension(dokogo)~=getElementDimension(localPlayer)) then
setElementData(localPlayer,"kajdanki", nil)
removeEventHandler("onClientPreRender", root, follow)
triggerServerEvent("setPedAnimation", localPlayer)
return
end
local x,y,z=getElementPosition(dokogo)
local x2,y2,z2=getElementPosition(localPlayer)
local kat=0
kat=math.deg(math.atan(-1*(x2-x)/(y2-y)))
if (y2-y)<0 then
kat=kat+180.0
end
kat=(kat+180)%360
Witam ! Tworz? serwer do kt?rego naprawd? nie b?dzie trzeba si? logowa? poniewa? to b?dzie serwer race. A skoro nie b?dzie trzeba si? logowa? to jak zrobi? admina? Czy da rad? zrobi? tak, ?e admina wyszukuje po nicku, kt?ry ustawia si? w "Setting". Prosz? o pomoc. Za pomoc
[MySQL] Error (0): Failed to exeute query. You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '[IF NOT EXISTS] `raporty` (`id` INT NOT NULL AUTO_INCREMENT ,`raport` VARCHAR(' at line 1.
[code]C:Documents and SettingsAdministratorMy Documentsdomki.pwn(125) : error 017: undefined symbol "DOF2_Exists"
C:Documents and SettingsAdministratorMy Documentsdomki.pwn(126) : error 017: undefined symbol "DOF2_Create"
C:Documents and SettingsAdministratorMy Documentsdomki.pwn(127) : error 017: undefined symbol "DOF2_Set"
C:Documents and SettingsAdministratorMy Documentsdomki.pwn(128) : error 017: undefined symbol "DOF2_IntSet"
C:Documents and SettingsAdministratorMy Documentsdomki.pwn(129) : error 017: undefined symbol "DOF2_IntSet"
C:Documents and SettingsAdministratorMy Documentsdomki.pwn(130) : error 017: undefined symbol "DOF2_IntSet"
C:Documents and SettingsAdministratorMy Documentsdomki.pwn(131) : error 017: undefined symbol "DOF2_FloatSet"
C:Documents and SettingsAdministratorMy Documentsdomki.pwn(132) : error 017: undefined symbol "DOF2_FloatSet"
C:Documents and SettingsAdministratorMy Documentsdomki.pwn(133) : error 017: undefined symbol "DOF2_FloatSet"
C:Documents and SettingsAdministratorMy Documentsdomki.pwn(134) : error 017: undefined symbol "DOF2_IntSet"
C:Documents and SettingsAdministratorMy Documentsdomki.pwn(135) : error 017: undefined symbol "DOF2_IntSet"[/code]
Chcia?bym zapyta? jak zwi?kszy? p?ynno?? ,aby po wcisnieciu klawisza w tym wypadku (S) za ka?dym razem wy?wietla?o si?,
Tak wygl?da timer oraz ca?a tre?? :