-
Posts
151 -
Joined
-
Last visited
Everything posted by Death
-
Well I changed the script and was so the only problem is that anyone who is outside of this area also firing missile I want only those who are in the area firing missile = / local hillArea = createColRectangle ( -2171.0678710938, 678.17950439453, 100, 100 ) local hillRadar = createRadarArea ( -2183.5678710938, 705.67950439453, 100, -100, 0, 255, 0, 175 ) function hill_Enter ( thePlayer, matchingDimension ) if (getElementType(thePlayer) == "vehicle") then outputChatBox( getPlayerName(thePlayer) .. " Entrou na Zona Fun Seu Carro Pode Atirar Agora!", thePlayer, 255, 255, 109 ) setRadarAreaFlashing ( hillRadar, true ) end end addEventHandler ( "onColShapeHit", hillArea, hill_Enter ) function hill_Exit ( thePlayer, matchingDimension ) unvehicles = getElementsByType("vehicle") for i,v in ipairs(vehicles) do destroyElement(v) if (getElementType(thePlayer) == "vehicle") then if isPedDead ( thePlayer ) ~= true then outputChatBox ( getPlayerName(thePlayer) .. " Saiu da Zona Fun Seu Carro Não Pode Atirar Mais!", thePlayer, 255, 255, 109 ) setRadarAreaFlashing ( hillRadar, false ) end end end end addEventHandler ( "onColShapeLeave", hillArea, hill_Exit ) cLP = getLocalPlayer() screenWidth, screenHeight = guiGetScreenSize() function cRStest() setTimer(resourcesCheck, 10000, 1) end addEventHandler("onClientResourceStart", getRootElement(), cRStest) function resourcesCheck() if check=="hillRadar" then return else setRadioChannel(0) setTimer(cbinds, 1000, 1) textToggle=0 check="hillRadar" end end function cRS() if check=="hillRadar" then return else setRadioChannel(0) setTimer(cbinds, 3333, 1) textToggle=0 check="hillRadar" end end addEventHandler("onColShapeHit", hillArea, cRS) function markers(player) if isPedInVehicle(player) then local vehicle = getPedOccupiedVehicle(player) fixVehicle(vehicle) end end addEventHandler("onClientMarkerHit", getResourceRootElement(getThisResource()), markers) function cbinds() local keys1 = getBoundKeys("vehicle_fire") local keys2 = getBoundKeys("vehicle_secondary_fire") if keys1 then for keyName, state in pairs(keys1) do bindKey(keyName, "down", cdoshoot) end bindKey("F", "down", cdoshoot) cbindsText = "- Press F or the button you use to fire to shoot rockets!\n- You can shoot once every 3 seconds.\n- good luck and have fun!." end if keys2 then for keyName, state in pairs(keys2) do bindKey(keyName, "down", cdoshoot) end end if (not keys1) and (not keys2) then bindKey("F", "down", cdoshoot) bindKey("lctrl", "down", cdoshoot) bindKey("rctrl", "down", cdoshoot) cbindsText = "- Press F or CTRL to shoot rockets!\n- You can shoot once every 3 seconds." end theVehicle = getPedOccupiedVehicle(cLP) allowShoots() bindKey("X", "down", toggleText) outputChatBox("#FF0000Press #00FF95X #FF0000to show/hide instructions! \"{SMILIES_PATH}/icon_biggrin.gif\" alt=\"\" title=\"Very Happy\" />", 255, 255, 255, true) end function toggleText() if textToggle==0 then addEventHandler("onClientRender", getRootElement(), bindsText) textToggle=1 elseif textToggle==1 then removeEventHandler("onClientRender", getRootElement(), bindsText) textToggle=0 end end function allowShoots() bindTrigger = 1 end function cdoshoot() if bindTrigger == 1 then if not isPlayerDead(cLP) then bindTrigger = 0 local x,y,z = getElementPosition(theVehicle) local rX,rY,rZ = getVehicleRotation(theVehicle) local x = x+8*math.cos(math.rad(rZ+100)) local y = y+8*math.sin(math.rad(rZ+100)) createProjectile(theVehicle, 19, x, y, z, 1.0, nil) local x,y,z = getElementPosition(theVehicle) local rX,rY,rZ = getVehicleRotation(theVehicle) local x = x+8*math.cos(math.rad(rZ+80)) local y = y+8*math.sin(math.rad(rZ+80)) createProjectile(theVehicle, 19, x, y, z, 1.0, nil) setTimer(allowShoots, 3000, 1) end end end function bindsText() dxDrawText(cbindsText, screenWidth/15, screenHeight/2.5, screenWidth, screenHeight, tocolor(0, 255, 110, 255), 2, "^ReLoco#") end
-
errors help plis warning: Morte_area\client.lua:51:Bad Argument @ 'getElementHealth' if ((getElementHealth(thePlayer) > 0) and (theVehicle)) then warning: Morte_area\client.lua:27:Bad Argument @ getPlayerName[Expected player at argument 1,got vehicle] outputChatBox(getPlayerName(thePlayer) .. " Entrou na Zona Fun Seu Carro Pode Atirar Agora!", thePlayer, 255, 255, 109, false) Error: Morte_area\client.lua:40: attempt to concatenate a boolean value outputChatBox(getPlayerName(thePlayer) .. " Saiu da Zona Fun Seu Carro Não Pode Atirar Mais!", thePlayer, 255, 255, 109, false) warning: Morte_area\client.lua:23:Bad 'ped' pointer @ getPedOccupiedVehicle(1) theVehicle = getPedOccupiedVehicle(thePlayer)
-
warning: Morte_area\client.lua:51:Bad Argument @ 'getElementHealth' warning: Morte_area\client.lua:27:Bad Argument @ getPlayerName[Expected player at argument 1,got vehicle] Error: Morte_area\client.lua:40: attempt to concatenate a boolean value warning: Morte_area\client.lua:23:Bad 'ped' pointer @ getPedOccupiedVehicle(1)
-
warning: Morte_area\client.lua:40:Bad Argument @ getPlayerName[Expected player at argument 1,got vehicle] warning: Morte_area\client.lua:51:Bad Argument @ 'getElementHealth' Error: Morte_area\client.lua:40: attempt to concatenate a boolean value
-
error the line 51 if (not isPedDead(thePlayer) and theVehicle) then attempt to call global 'isPedDead' (a nil value)
-
not work error [11:13:32] WARNING: Morte_area/client3.lua(Line 52) [Client] getVehicleRotation is deprecated and may not work in future versions. Please replace with getElementRotation. [11:13:32] Some files in 'Morte_area' use deprecated functions. [11:13:32] Use the 'upgrade' command to perform a basic upgrade of resources.
-
This code was for when the player enter the area the vehicle he can shoot missiles and when he left the vehicle to be removed local hillArea = createColRectangle ( -2171.0678710938, 678.17950439453, 100, 100 ) local hillRadar = createRadarArea ( -2183.5678710938, 705.67950439453, 100, -100, 0, 255, 0, 175 ) function hill_Enter ( thePlayer, matchingDimension ) local keys1 = getBoundKeys("vehicle_fire") if keys1 then for keyName, state in pairs(keys1) do bindKey(keyName, "down", cdoshoot) end bindKey("F", "down", cdoshoot) end if (not keys1) then bindKey("F", "down", cdoshoot) bindKey("lctrl", "down", cdoshoot) bindKey("rctrl", "down", cdoshoot) end theVehicle = getPedOccupiedVehicle(thePlayer) allowShoots() if (getElementType(thePlayer) == "vehicle") then outputChatBox( getPlayerName(thePlayer) .. " Entrou na Zona Fun Seu Carro Pode Atirar Agora!", thePlayer, 255, 255, 109 ) setRadarAreaFlashing ( hillRadar, true ) end end addEventHandler ( "onColShapeHit", hillArea, hill_Enter ) function hill_Exit ( thePlayer, matchingDimension ) vehicles = getElementsByType("vehicle") for i,v in ipairs(vehicles) do destroyElement(v) if (getElementType(thePlayer) == "vehicle") then if isPedDead ( thePlayer ) ~= true then outputChatBox ( getPlayerName(thePlayer) .. " Saiu da Zona Fun Seu Carro Não Pode Atirar Mais!", thePlayer, 255, 255, 109 ) setRadarAreaFlashing ( hillRadar, false ) end end end end addEventHandler ( "onColShapeLeave", hillArea, hill_Exit ) function allowShoots() bindTrigger = 1 end function cdoshoot(thePlayer) if bindTrigger == 1 then if not isPlayerDead(thePlayer) then bindTrigger = 0 local x,y,z = getElementPosition(theVehicle) local rX,rY,rZ = getVehicleRotation(theVehicle) local x = x+4*math.cos(math.rad(rZ+90)) local y = y+4*math.sin(math.rad(rZ+90)) createProjectile(theVehicle, 19, x, y, z, 1.0, nil) setTimer(allowShoots, 3000, 1) end end end
-
------------------------------------------------------------------------------------------- -- Resource:GUI Info -- ------------------------------------------------------------------------------------------- local localPlayer = getLocalPlayer() local GUIInfo = { Habilitado = {}, DeGUIMode = {}, GUI_Window = {{}}, GUI_Image = {{}}, GUI_Label = {{}, {}, {}, {}, {}, {}}, GUI_Button = {{}} } local Path_ImgInfo = "resources/GUIInfo/Info.png" ------------------------------------------------------------------------------------------- -- Resource Start -- ------------------------------------------------------------------------------------------- function ClientResourceStart_RESGUIInfo() return true end ------------------------------------------------------------------------------------------- -- Resource Stop -- ------------------------------------------------------------------------------------------- function ClientResourceStop_RESGUIInfo() if GUIInfo.Habilitado[localPlayer] then Desabilitar_RESGUIInfo() end return true end ------------------------------------------------------------------------------------------- -- Habilitar GUI Info -- ------------------------------------------------------------------------------------------- function Habilitar_RESGUIInfo(titulo, texto1, texto2, texto3, texto4, deguimode) if GUIInfo.Habilitado[localPlayer] then Desabilitar_RESGUIInfo() end GUIInfo.Habilitado[localPlayer] = true Habilitar_RESGUIMode() Habilitar_GUI_RESGUIInfo(titulo, texto1, texto2, texto3, texto4, deguimode) return true end ------------------------------------------------------------------------------------------- -- Desabilitar GUI Info -- ------------------------------------------------------------------------------------------- function Desabilitar_RESGUIInfo() if GUIInfo.DeGUIMode[localPlayer] then Desabilitar_RESGUIMode() end Desabilitar_GUI_RESGUIInfo() GUIInfo.Habilitado[localPlayer] = false GUIInfo.DeGUIMode[localPlayer] = false return true end ------------------------------------------------------------------------------------------- -- Habilitar GUI -- ------------------------------------------------------------------------------------------- function Habilitar_GUI_RESGUIInfo(titulo, texto1, texto2, texto3, texto4, deguimode) local Tamanho_Texto1 = 1 local Tamanho_Texto2 = 1 local Tamanho_Texto3 = 1 local Tamanho_Texto4 = 1 local Width_GUI_Window1 = {} local X_GUI_Image1 = {} local X_GUI_Label1 = {} local X_GUI_Button1 = {} if texto1 then Tamanho_Texto1 = string.len(texto1) end if texto2 then Tamanho_Texto2 = string.len(texto2) end if texto3 then Tamanho_Texto3 = string.len(texto3) end if texto4 then Tamanho_Texto4 = string.len(texto4) end if string.len(Tamanho_Texto1) > 120 or string.len(Tamanho_Texto2) > 120 or string.len(Tamanho_Texto3) > 120 or string.len(Tamanho_Texto4) > 120 then Width_GUI_Window1 = 622 X_GUI_Image1 = 0 X_GUI_Label1 = 42 X_GUI_Button1 = 452 elseif string.len(Tamanho_Texto1) > 90 or string.len(Tamanho_Texto2) > 90 or string.len(Tamanho_Texto3) > 90 or string.len(Tamanho_Texto4) > 90 then Width_GUI_Window1 = 572 X_GUI_Image1 = 5 X_GUI_Label1 = 47 X_GUI_Button1 = 502 elseif string.len(Tamanho_Texto1) > 60 or string.len(Tamanho_Texto2) > 60 or string.len(Tamanho_Texto3) > 60 or string.len(Tamanho_Texto4) > 60 then Width_GUI_Window1 = 522 X_GUI_Image1 = 10 X_GUI_Label1 = 52 X_GUI_Button1 = 452 else Width_GUI_Window1 = 472 X_GUI_Image1 = 15 X_GUI_Label1 = 57 X_GUI_Button1 = 402 end GUIInfo.GUI_Window[1][localPlayer] = guiCreateWindow(456, 248, Width_GUI_Window1, 149, "", false) guiWindowSetSizable(GUIInfo.GUI_Window[1][localPlayer], false) GUIInfo.GUI_Image[1][localPlayer] = guiCreateStaticImage(X_GUI_Image1, 27, 32, 32, ':', false, GUIInfo.GUI_Window[1][localPlayer])---- is line 141-- GUIInfo.GUI_Label[1][localPlayer] = guiCreateLabel(X_GUI_Label1, 34, 405, 15, titulo, false, GUIInfo.GUI_Window[1][localPlayer]) guiSetFont(GUIInfo.GUI_Label[1][localPlayer], "default-bold-small") GUIInfo.GUI_Label[2][localPlayer] = guiCreateLabel(10, 73, 552, 15, texto1, false, GUIInfo.GUI_Window[1][localPlayer]) guiSetFont(GUIInfo.GUI_Label[2][localPlayer], "clear-normal") guiLabelSetHorizontalAlign(GUIInfo.GUI_Label[2][localPlayer], "center", false) if texto4 then GUIInfo.GUI_Label[3][localPlayer] = guiCreateLabel(10, 92, 552, 15, texto2, false, GUIInfo.GUI_Window[1][localPlayer]) guiSetFont(GUIInfo.GUI_Label[3][localPlayer], "clear-normal") guiLabelSetHorizontalAlign(GUIInfo.GUI_Label[3][localPlayer], "center", false) GUIInfo.GUI_Label[4][localPlayer] = guiCreateLabel(10, 107, 552, 15, texto3, false, GUIInfo.GUI_Window[1][localPlayer]) guiSetFont(GUIInfo.GUI_Label[4][localPlayer], "clear-normal") guiLabelSetHorizontalAlign(GUIInfo.GUI_Label[4][localPlayer], "center", false) GUIInfo.GUI_Label[5][localPlayer] = guiCreateLabel(10, 118, 552, 15, texto4, false, GUIInfo.GUI_Window[1][localPlayer]) guiSetFont(GUIInfo.GUI_Label[5][localPlayer], "clear-normal") guiLabelSetHorizontalAlign(GUIInfo.GUI_Label[5][localPlayer], "center", false) GUIInfo.GUI_Label[6][localPlayer] = guiCreateLabel(5, 154, 377, 15, Msg_GUI_Creditos, false, GUIInfo.GUI_Window[1][localPlayer]) guiSetAlpha(GUIInfo.GUI_Label[6][localPlayer], 0.20) guiSetFont(GUIInfo.GUI_Label[6][localPlayer], "default-small") elseif texto3 then GUIInfo.GUI_Label[3][localPlayer] = guiCreateLabel(10, 92, 552, 15, texto2, false, GUIInfo.GUI_Window[1][localPlayer]) guiSetFont(GUIInfo.GUI_Label[3][localPlayer], "clear-normal") guiLabelSetHorizontalAlign(GUIInfo.GUI_Label[3][localPlayer], "center", false) GUIInfo.GUI_Label[4][localPlayer] = guiCreateLabel(10, 107, 552, 15, texto3, false, GUIInfo.GUI_Window[1][localPlayer]) guiSetFont(GUIInfo.GUI_Label[4][localPlayer], "clear-normal") guiLabelSetHorizontalAlign(GUIInfo.GUI_Label[4][localPlayer], "center", false) GUIInfo.GUI_Label[5][localPlayer] = guiCreateLabel(5, 154, 377, 15, Msg_GUI_Creditos, false, GUIInfo.GUI_Window[1][localPlayer]) guiSetAlpha(GUIInfo.GUI_Label[5][localPlayer], 0.20) guiSetFont(GUIInfo.GUI_Label[5][localPlayer], "default-small") elseif texto2 then GUIInfo.GUI_Label[3][localPlayer] = guiCreateLabel(10, 92, 552, 15, texto2, false, GUIInfo.GUI_Window[1][localPlayer]) guiSetFont(GUIInfo.GUI_Label[3][localPlayer], "clear-normal") guiLabelSetHorizontalAlign(GUIInfo.GUI_Label[3][localPlayer], "center", false) GUIInfo.GUI_Label[4][localPlayer] = guiCreateLabel(5, 139, 377, 15, Msg_GUI_Creditos, false, GUIInfo.GUI_Window[1][localPlayer]) guiSetAlpha(GUIInfo.GUI_Label[4][localPlayer], 0.20) guiSetFont(GUIInfo.GUI_Label[4][localPlayer], "default-small") else GUIInfo.GUI_Label[3][localPlayer] = guiCreateLabel(5, 124, 377, 15, Msg_GUI_Creditos, false, GUIInfo.GUI_Window[1][localPlayer]) guiSetAlpha(GUIInfo.GUI_Label[3][localPlayer], 0.20) guiSetFont(GUIInfo.GUI_Label[3][localPlayer], "default-small") end GUIInfo.GUI_Button[1][localPlayer] = guiCreateButton(X_GUI_Button1, 133, 60, 21, "Fechar", false, GUIInfo.GUI_Window[1][localPlayer]) GUIInfo.DeGUIMode[localPlayer] = deguimode addEventHandler("onClientGUIClick", GUIInfo.GUI_Button[1][localPlayer], Desabilitar_RESGUIInfo, false) return true end ------------------------------------------------------------------------------------------- -- Desabilitar GUI -- ------------------------------------------------------------------------------------------- function Desabilitar_GUI_RESGUIInfo() if isElement(GUIInfo.GUI_Window[1][localPlayer]) then destroyElement(GUIInfo.GUI_Window[1][localPlayer]) end if isElement(GUIInfo.GUI_Image[1][localPlayer]) then destroyElement(GUIInfo.GUI_Image[1][localPlayer]) end if isElement(GUIInfo.GUI_Label[1][localPlayer]) then destroyElement(GUIInfo.GUI_Label[1][localPlayer]) end if isElement(GUIInfo.GUI_Label[2][localPlayer]) then destroyElement(GUIInfo.GUI_Label[2][localPlayer]) end if isElement(GUIInfo.GUI_Label[3][localPlayer]) then destroyElement(GUIInfo.GUI_Label[3][localPlayer]) end if isElement(GUIInfo.GUI_Label[4][localPlayer]) then destroyElement(GUIInfo.GUI_Label[4][localPlayer]) end if isElement(GUIInfo.GUI_Label[5][localPlayer]) then destroyElement(GUIInfo.GUI_Label[5][localPlayer]) end if isElement(GUIInfo.GUI_Button[1][localPlayer]) then destroyElement(GUIInfo.GUI_Button[1][localPlayer]) end return true end ------------------------------------------------------------------------------------------- -- Eventos para chamada exterior -- ------------------------------------------------------------------------------------------- addEvent("Habilitar_RESGUIInfo", true) addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()), ClientResourceStart_RESGUIInfo) addEventHandler("onClientResourceStop", getResourceRootElement(getThisResource()), ClientResourceStop_RESGUIInfo) addEventHandler("Habilitar_RESGUIInfo", getRootElement(), Habilitar_RESGUIInfo) ------------------------------------------------------------------------------------------- my script is error
-
ok ta more now giving these errors here 'end' expected (to close 'function' at line 96) near 'elseif' 'end' expected (to close 'if' at line 317) near 'else' '' expected near 'else'
-
resourceRoot = getResourceRootElement ( getThisResource ( ) ) Niveis = { [ '1 ' ] = 'Convidado' , [ '2 ' ] = 'Membro' , [ '3 ' ] = 'Comandante' , [ '4 ' ] = 'Sub-Lider ' , [ '5 ' ] = 'Lider' } permissoes = { [ 'Convidado' ] = { } , [ ' ] = { } , ['Comandante'] = {}, ['Sub-Lider'] = {}, ['Lider'] = {} } xLevels = { ['Convidado'] = '1', ['Membro'] = '2', ['Comandante'] = '3', ['Sub-Lider'] = '4', ['Lider'] = '5' } local gangs = {} local members = {} local rootNode = xmlLoadFile("gangs.xml") local children = xmlNodeGetChildren(rootNode) if children == false then return end for _,node in pairs(children) do local attributes = xmlNodeGetAttributes(node) if attributes.name and attributes.colorR then local name = attributes.name local colorRed = attributes.colorR local colgangreen = attributes.colgang local colorBlue = attributes.colorB local gangTag = attributes.tag local sublider = attributes.sublider local skin = attributes.skin local baseName = attributes.baseName gangs[name] = {} gangs[name]['name'] = tostring(name) gangs[name]['baseName'] = tostring(baseName) gangs[name]['tag'] = tostring(gangTag) gangs[name]['subLider'] = tostring(subLider) gangs[name]['skin'] = skin gangs[name]['color'] = {} gangs[name]['color']['r'] = tostring(colorRed) gangs[name]['color']['g'] = tostring(colgangreen) gangs[name]['color']['b'] = tostring(colorBlue) --createTeam(name, tonumber(col[1]), tonumber(col[2]), tonumber(col[3])) end end local rootNodem = xmlLoadFile("members.xml") local childrenm = xmlNodeGetChildren(rootNodem) if childrenm == false then return end for _m,nodem in pairs(childrenm) do local attributesm = xmlNodeGetAttributes(nodem) if attributesm.gangName and attributesm.accName and attributesm.level then local accName = attributesm.accName local gangName = attributesm.gangName local accLevel = attributesm.level members[accName] = {} members[accName]['gangName'] = gangName members[accName]['level'] = accLevel members[accName]['accName'] = accName end end function getPlayerFromID(id) return call(getResourceFromName("gameid"), "getPlayerFromID", tonumber(id)) end function getPlayerID(player) return getElementData(player,"id") end function onStart() call(getResourceFromName("scoreboard"), "addScoreboardColumn", "Level",5,5,0.10) end addEventHandler("onResourceStart",resourceRoot,onStart) function gang (thePlayer,commandName,mode,playerid,...) if mode == "convidar" then if getPlayerTeam(thePlayer) then if playerid and getPlayerFromID(playerid) ~= thePlayer then CONVITE = getElementData(getPlayerFromID(playerid),"CONVITE") if CONVITE == false then outputChatBox("Convite Enviado.",thePlayer) outputChatBox("#A020F0[GANG] #ffffffVocê recebeu um convite para entrar na Gang "..getTeamName(getPlayerTeam(thePlayer)).."#00ff00! Digite /gang aceitar ou /gang recusar.",getPlayerFromID(playerid),255,255,255,true) setElementData(getPlayerFromID(playerid),"CONVITE",true) setElementData(getPlayerFromID(playerid),"GANGCONVITE",getPlayerTeam(thePlayer)) setElementData(getPlayerFromID(playerid),"PLAYERSENDCONVITE",thePlayer) Timer = setTimer(function() setElementData(thePlayer,"CONVITE",false) removeElementData(getPlayerFromID(playerid),"GANGCONVITE") removeElementData(getPlayerFromID(playerid),"PLAYERSENDCONVITE") outputChatBox("#A020F0[GANG] #ffffffSeu Convite Expirou.",getPlayerFromID(playerid)) end,120000,1) elseif CONVITE == true then outputChatBox("#A020F0[GANG] #ffffffEsse jogador já recebeu um convite para juntar-se a Gang",thePlayer,255,255,255,true) end end else outputChatBox('#A020F0[GANG] #ffffffVocê não possui uma Gang!',thePlayer,255,255,255,true) end elseif mode == "aceitar" then gang = getElementData(thePlayer,"GANGCONVITE") if gang then outputChatBox("#A020F0[GANG] #ffffffBem vindo a Gang "..getTeamName(gang),thePlayer,255,255,255,true) setPlayerTeam(thePlayer,gang) setElementData(thePlayer,"CONVITE",false) setElementData(thePlayer,"Level","Convidado") r,g,b = getTeamColor(gang) setPlayerNametagColor ( thePlayer, r, g, b ) removeElementData(thePlayer,"GANGCONVITE") killTimer(Timer) for i,v in ipairs(getPlayersInTeam ( gang )) do outputChatBox("#A020F0[GANG] #ffffff"..getPlayerName(thePlayer).." entrou em sua Gang: ("..Levels['1']..")",v,255,255,255,true) end else outputChatBox("#A020F0[GANG] #ffffffVocê não foi convidado para nenhuma Gang.",thePlayer,255,255,255,true) end elseif mode == "recusar" then gang = getElementData(thePlayer,"GANGCONVITE") if gang then playersend = getElementData(thePlayer,"PLAYERSENDCONVITE") outputChatBox("#A020F0[GANG] #ffffffVocê recusou o convite da Gang "..getTeamName(gang),thePlayer,255,255,255,true) outputChatBox("#A020F0[GANG] #ffffff"..getPlayerName(thePlayer).." recusou o seu convite para juntar-se a Gang",playersend,255,255,255,true) setElementData(thePlayer,"CONVITE",false) removeElementData(thePlayer,"GANGCONVITE") removeElementData(thePlayer,"PLAYERSENDCONVITE") else outputChatBox("#A020F0[GANG] #ffffffVocê não foi convidado para nenhuma Gang.",thePlayer,255,255,255,true) end elseif mode == "level" then if getPlayerTeam(thePlayer) then if playerid then level = ... if level then setPlayerLevel(thePlayer,getPlayerFromID(playerid),level) end end else outputChatBox('#A020F0[GANG] #ffffffVocê não possui uma Gang!',thePlayer,255,255,255,true) end elseif mode == "tag" then if getPlayerTeam(thePlayer) then if tonumber(xLevels[getAccountLevel(thePlayer)]) >= 3 then if playerid then tag = playerid if tag:len() <= 4 then setgangTag(thePlayer,getPlayerTeam(thePlayer),tag) for i,v in ipairs(getPlayersInTeam ( getPlayerTeam(thePlayer) )) do outputChatBox("#A020F0[GANG] #ffffffTag da gang setada para ["..tag.."] por "..getPlayerName(thePlayer),v,255,255,255,true) setElementData(thePlayer,"gang.tag","["..tag.."]") end else outputChatBox("#A020F0[GANG] #ffffff O Máximo permitido de letras são 4!",thePlayer,255,255,255,true) return end else outputChatBox("#A020F0[GANG] #ffffffUso correto. /gang tag [tag]",thePlayer,255,255,255,true) end else outputChatBox("#A020F0[GANG] #ffffffSomente o Lider,Sub-Lider ou Comandante pode alterar a tag da Gang.",thePlayer,255,255,255,true) end else outputChatBox('#A020F0[GANG] #ffffffVocê não possui uma Gang!',thePlayer,255,255,255,true)setgangColor(gang,r,g,b) end elseif mode == "skin" then if getPlayerTeam(thePlayer) then if getPlayerMoney(thePlayer) >= 10000 then if tonumber(xLevels[getAccountLevel(thePlayer)]) >= 3 then if playerid then skin = playerid setgangSkin(getPlayerTeam(thePlayer),skin) takeMoney(thePlayer,10000) for i,v in ipairs(getPlayersInTeam ( getPlayerTeam(thePlayer) )) do outputChatBox("#A020F0[GANG] #ffffffSkin da Gang setada para "..skin.." por "..getPlayerName(thePlayer),v,255,255,255,true) end else outputChatBox("#A020F0[GANG] #ffffffUso correto. /gang skin [skin]",thePlayer,255,255,255,true) end else outputChatBox("#A020F0[GANG] #ffffffSomente o Lider,Sub-Lider ou Comandante pode alterar a skin da Gang.",thePlayer,255,255,255,true) end else outputChatBox("#A020F0[GANG] #ffffffÉ necessario $10k para mudar a cor da Gang.",thePlayer,255,255,255,true) end else outputChatBox('#A020F0[GANG] #ffffffVocê não possui uma Gang!',thePlayer,255,255,255,true)setgangColor(gang,r,g,b) end elseif mode == "cor" then if getPlayerTeam(thePlayer) then if getPlayerMoney(thePlayer) >= 20000 then if tonumber(xLevels[getAccountLevel(thePlayer)]) >= 3 then if playerid then cor1 = playerid color = { ... } if color[1] and color[2] then setgangColor(getPlayerTeam(thePlayer),cor1,color[1],color[2]) takeMoney(thePlayer,20000) else outputChatBox("#A020F0[GANG] #ffffffUso correto. /gang cor [r] [g] [b] | Exemplo /gang cor 255 0 0 = #ff0000Vermelho.",thePlayer,255,255,255,true) end for i,v in ipairs(getPlayersInTeam ( getPlayerTeam(thePlayer) )) do outputChatBox("[GANG] Cor da Gang setada por "..getPlayerName(thePlayer),v,cor1,color[1],color[2],true) end else outputChatBox("#A020F0[GANG] #ffffffUso correto. /gang cor [r] [g] [b] | Exemplo /gang cor 255 0 0 = #ff0000Vermelho.",thePlayer,255,255,255,true) end else outputChatBox("#A020F0[GANG] #ffffffSomente o Lider,Sub-Lider ou Comandante pode alterar a cor da Gang.",thePlayer,255,255,255,true) end else outputChatBox("#A020F0[GANG] #ffffffÉ necessario $20k para mudar a cor da Gang.",thePlayer,255,255,255,true) end else outputChatBox('#A020F0[GANG] #ffffffVocê não possui uma Gang!',thePlayer,255,255,255,true)setgangColor(gang,r,g,b) end elseif mode == "kick" then if getPlayerTeam(thePlayer) then if playerid and ... and reason then reason = table.concat({...}, " ") if gangKickPlayer(thePlayer,getPlayerFromID(playerid)) then for i,v in ipairs(getPlayersInTeam ( getPlayerTeam(thePlayer) )) do outputChatBox(getPlayerName(getPlayerFromID(playerid)).." saiu da Gang. [KIKADO] (Motvio: "..reason..")",v,255,255,255,true) end outputChatBox("#A020F0[GANG] #ffffffVocê chutou o jogador "..getPlayerName(getPlayerFromID(playerid)).." da Gang.",thePlayer,255,255,255,true) setElementData(getPlayerFromID(playerid),"ingangBought","false")
-
gave error on line 318 also if self:getTimeRemaining() - (respawnTime or 10000) > 3000 then Countdown.create(respawnTime/1000, restorePlayer, 'You will respawn in:', 255, 255, 255, 0.25, 2.5, true, self.id, player):start(player)---------- error line =/ [2013-07-16 14:19:05] ERROR: [gamemodes]\[race]\race\modes\base.lua:318: attempt to perform arithmetic on local 'respawnTime' (a boolean value)
-
gave another error in gamemode ss race_server.lua g_Root = getRootElement() g_ResRoot = getResourceRootElement(getThisResource()) allowRPC('setElementPosition') g_MotorBikeIDs = table.create({ 448, 461, 462, 463, 468, 471, 521, 522, 523, 581, 586 }, true) g_ArmedVehicleIDs = table.create({ 425, 447, 520, 430, 464, 432 }, true) g_AircraftIDs = table.create({ 592, 577, 511, 548, 512, 593, 425, 520, 417, 487, 553, 488, 497, 563, 476, 447, 519, 460, 469, 513 }, true) g_RCVehicleIDs = table.create({ 441, 464, 465, 501, 564, 594 }, true) g_VehicleClothes = { [{ 490, 523, 598, 596, 597, 599}] = { [16] = false, [17] = 4 } } g_CurrentRaceMode = nil g_Spawnpoints = {} -- { i = { position={x, y, z}, rotation=rotation, vehicle=vehicleID, paintjob=paintjob, upgrades={...} } } g_Checkpoints = {} -- { i = { position={x, y, z}, size=size, color={r, g, b}, type=type, vehicle=vehicleID, paintjob=paintjob, upgrades={...} } } g_Objects = {} -- { i = { position={x, y, z}, rotation={x, y, z}, model=modelID } } g_Pickups = {} -- { i = { position={x, y, z}, type=type, vehicle=vehicleID, paintjob=paintjob, upgrades={...} } g_Players = {} -- { i = player } g_Vehicles = {} -- { player = vehicle } local unloadedPickups = {} addEventHandler('onPlayerJoin', g_Root, -- On player Join... function() outputConsole ( 'Race version ' .. getBuildString(), source, 255, 127, 0 ) for _,line in ipairs(Addons.report) do outputConsole ( 'Race addon: ' .. line, source ) end end ) addEventHandler('onGamemodeMapStart', g_Root, -- On gamemode map stars ... function(mapres) -- the map resource that we are talking about (mapres) outputDebugString('onGamemodeMapStart(' .. getResourceName(mapres) .. ')') if getTotalPlayerCount() == 0 then -- if theres no player... --playSound("audio/loadingmap.wav") --g_RaceStartCountdown:addClientHook(0, 'playSound','audio/countgo.wav', 44) outputDebugString('Stopping map') triggerEvent('onGamemodeMapStop', g_Root) -- just stop the map. return end gotoState('LoadingMap') -- set up all players as not ready for i,player in ipairs(getElementsByType('player')) do setPlayerNotReady(player) end -- tell clients new map is loading clientCall(g_Root, 'notifyLoadingMap', getResourceInfo(mapres, "name") or getResourceName(mapres), g_GameOptions.showauthorname and getResourceInfo( mapres , "author") ) -- send to clients information of new map that is loading. if g_CurrentRaceMode then -- If has somemap playing... outputDebugString('Unloading previous map') unloadAll() -- Unload all map stuff. end TimerManager.createTimerFor("raceresource","loadmap"):setTimer( doLoadMap, 50, 1 ,mapres ) end ) -- continue loading map after onGamemodeMapStart has completed function doLoadMap(mapres) if not loadMap(mapres) then -- if the mapresource dosent exists anymore... -- Select another map on load error problemChangingMap() return end g_CurrentRaceMode = RaceMode.getApplicableMode():create() g_MapInfo.modename = g_CurrentRaceMode:getName() outputDebugString('Loaded race mode ' .. g_MapInfo.modename) startRace() end -- Called from the admin panel when a setting is changed there addEvent ( "onSettingChange" ) addEventHandler('onSettingChange', g_ResRoot, -- if some map settings change... just update it for server and all clients. function(name, oldvalue, value, player) outputDebug( 'MISC', 'Setting changed: ' .. tostring(name) .. ' value:' .. tostring(value) .. ' value:' .. tostring(oldvalue).. ' by:' .. tostring(player and getPlayerName(player) or 'n/a') ) cacheGameOptions() if g_SavedMapSettings then cacheMapOptions(g_SavedMapSettings) clientCall(g_Root,'updateOptions', g_GameOptions, g_MapOptions) updateGhostmode() end end ) function cacheGameOptions() g_GameOptions = {} g_GameOptions.timeafterfirstfinish = getNumber('race.timeafterfirstfinish',30) * 1000 g_GameOptions.hurrytime = getNumber('race.hurrytime',15) * 1000 g_GameOptions.defaultrespawnmode = getString('race.respawnmode','none') g_GameOptions.defaultrespawntime = getNumber('race.respawntime',5) * 1000 g_GameOptions.defaultduration = getNumber('race.duration',6000) * 1000 g_GameOptions.ghostmode = getBool('race.ghostmode',false) g_GameOptions.ghostalpha = getBool('race.ghostalpha',false) g_GameOptions.randommaps = getBool('race.randommaps',false) g_GameOptions.statskey = getString('race.statskey','name') g_GameOptions.vehiclecolors = getString('race.vehiclecolors','file') g_GameOptions.skins = getString('race.skins','cj') g_GameOptions.autopimp = getBool('race.autopimp',true) g_GameOptions.vehicleweapons = getBool('race.vehicleweapons',true) g_GameOptions.firewater = getBool('race.firewater',false) g_GameOptions.classicchangez = getBool('race.classicchangez',false) g_GameOptions.admingroup = getString('race.admingroup','Admin') g_GameOptions.blurlevel = getNumber('race.blur',36) g_GameOptions.cloudsenable = getBool('race.clouds',true) g_GameOptions.joinspectating = getBool('race.joinspectating',true) g_GameOptions.stealthspectate = getBool('race.stealthspectate',true) g_GameOptions.countdowneffect = getBool('race.countdowneffect',true) g_GameOptions.showmapname = getBool('race.showmapname',true) g_GameOptions.hunterminigun = getBool('race.hunterminigun',true) g_GameOptions.securitylevel = getNumber('race.securitylevel',2) g_GameOptions.anyonecanspec = getBool('race.anyonecanspec',true) g_GameOptions.norsadminspectate = getBool('race.norsadminspectate',false) g_GameOptions.racerespawn = getBool('race.racerespawn',true) g_GameOptions.joinrandomvote = getBool('race.joinrandomvote',true) g_GameOptions.asyncloading = getBool('race.asyncloading',true) g_GameOptions.showauthorname = getBool('race.showauthorname',true) g_GameOptions.ghostmode_map_can_override = getBool('race.ghostmode_map_can_override',true) g_GameOptions.skins_map_can_override = getBool('race.skins_map_can_override',true) g_GameOptions.vehicleweapons_map_can_override = getBool('race.vehicleweapons_map_can_override',true) g_GameOptions.autopimp_map_can_override = getBool('race.autopimp_map_can_override',true) g_GameOptions.firewater_map_can_override = getBool('race.firewater_map_can_override',true) g_GameOptions.classicchangez_map_can_override = getBool('race.classicchangez_map_can_override',true) g_GameOptions.ghostmode_warning_if_map_override = getBool('race.ghostmode_warning_if_map_override',true) g_GameOptions.vehicleweapons_warning_if_map_override = getBool('race.vehicleweapons_warning_if_map_override',true) g_GameOptions.hunterminigun_map_can_override = getBool('race.hunterminigun_map_can_override',true) if g_GameOptions.statskey ~= 'name' and g_GameOptions.statskey ~= 'serial' then outputWarning( "statskey is not set to 'name' or 'serial'" ) g_GameOptions.statskey = 'name' end end function cacheMapOptions(map) g_MapOptions = {} g_MapOptions.duration = map.duration and tonumber(map.duration) > 0 and map.duration*1000 or g_GameOptions.defaultduration if g_MapOptions.duration > 86400000 then g_MapOptions.duration = 86400000 end g_MapOptions.respawn = map.respawn or g_GameOptions.defaultrespawnmode if g_MapOptions.respawn ~= 'timelimit' and g_MapOptions.respawn ~= 'none' then g_MapOptions.respawn = 'timelimit' end g_MapOptions.respawntime = g_MapOptions.respawn == 'tt' and (map.respawntime and map.respawntime*1000 or g_GameOptions.defaultrespawntime) g_MapOptions.time = map.time or '12:00' g_MapOptions.weather = map.weather or 0 g_MapOptions.skins = map.skins or 'cj' g_MapOptions.vehicleweapons = map.vehicleweapons == 'true' g_MapOptions.ghostmode = map.ghostmode == 'true' g_MapOptions.autopimp = map.autopimp == 'true' g_MapOptions.firewater = map.firewater == 'true' g_MapOptions.classicchangez = map.classicchangez == 'true' g_MapOptions.hunterminigun = map.hunterminigun == 'true' outputDebug("MISC", "duration = "..g_MapOptions.duration.." respawn = "..g_MapOptions.respawn.." respawntime = "..tostring(g_MapOptions.respawntime).." time = "..g_MapOptions.time.." weather = "..g_MapOptions.weather) if g_MapOptions.time then setTime(g_MapOptions.time:match('(%d+)%d+)')) end if g_MapOptions.weather then setWeather(g_MapOptions.weather) end -- Set ghostmode from g_GameOptions if not defined in the map, or map override not allowed if not map.ghostmode or not g_GameOptions.ghostmode_map_can_override then g_MapOptions.ghostmode = g_GameOptions.ghostmode elseif g_GameOptions.ghostmode_warning_if_map_override and g_MapOptions.ghostmode ~= g_GameOptions.ghostmode then if g_MapOptions.ghostmode then --outputChatBox( 'Not: Ghost Mode aktif degil' ) else --outputChatBox( 'Not: Ghost mode aktif edilmistir' ) end end -- Set skins from g_GameOptions if not defined in the map, or map override not allowed if not map.skins or not g_GameOptions.skins_map_can_override then g_MapOptions.skins = g_GameOptions.skins end -- Set vehicleweapons from g_GameOptions if not defined in the map, or map override not allowed if not map.vehicleweapons or not g_GameOptions.vehicleweapons_map_can_override then g_MapOptions.vehicleweapons = g_GameOptions.vehicleweapons elseif g_GameOptions.vehicleweapons_warning_if_map_override and g_MapOptions.vehicleweapons ~= g_GameOptions.vehicleweapons then if g_MapOptions.vehicleweapons then --outputChatBox( 'Notice: Silahlar Aktif' ) else --outputChatBox( 'Not: Silahlar kapali' ) end end -- Set autopimp from g_GameOptions if not defined in the map, or map override not allowed if not map.autopimp or not g_GameOptions.autopimp_map_can_override then g_MapOptions.autopimp = g_GameOptions.autopimp end -- Set firewater from g_GameOptions if not defined in the map, or map override not allowed if not map.firewater or not g_GameOptions.firewater_map_can_override then g_MapOptions.firewater = g_GameOptions.firewater end -- Set classicchangez from g_GameOptions if not defined in the map, or map override not allowed if not map.classicchangez or not g_GameOptions.classicchangez_map_can_override then g_MapOptions.classicchangez = g_GameOptions.classicchangez end -- Set hunterminigun from g_GameOptions if not defined in the map, or map override not allowed if not map.hunterminigun or not g_GameOptions.hunterminigun_map_can_override then g_MapOptions.hunterminigun = g_GameOptions.hunterminigun end end -- Called from: -- onGamemodeMapStart function loadMap(res) local map = RaceMap.load(res) if not map then outputDebugString( 'Error loading map ' .. tostring(getResourceName(res)) ) outputChatBox( 'Error loading map ' .. tostring(getResourceName(res)) ) return false end -- set options g_MapInfo = getMapInfo(res) g_MapInfo.name = map.info['name'] or 'unnamed' g_MapInfo.author = map.info['author'] g_MapInfo.resname = map.info['resname'] or getResourceName(res) g_SavedMapSettings = {} g_SavedMapSettings.duration = map.duration g_SavedMapSettings.respawn = map.respawn g_SavedMapSettings.respawntime = map.respawntime g_SavedMapSettings.time = map.time g_SavedMapSettings.weather = map.weather g_SavedMapSettings.skins = map.skins g_SavedMapSettings.vehicleweapons = map.vehicleweapons g_SavedMapSettings.ghostmode = map.ghostmode g_SavedMapSettings.autopimp = map.autopimp g_SavedMapSettings.firewater = map.firewater g_SavedMapSettings.classicchangez = map.classicchangez g_SavedMapSettings.firewater = map.firewater g_SavedMapSettings.hunterminigun = map.hunterminigun cacheMapOptions(g_SavedMapSettings) -- If no checkpoints and ghostmode no defined in the map, turn ghostmode off for this map if #map:getAll('checkpoint') == 0 and not map.ghostmode and g_MapOptions.ghostmode then g_MapOptions.ghostmode =
-
if self:getTimeRemaining() - respawnTime > 3000 then -------line 317 error
-
My race gamemode is giving an error looks can help me fix code function RaceMode:onPlayerWasted(player) if not self.checkpointBackups[player] then return end TimerManager.destroyTimersFor("checkpointBackup",player) if RaceMode.getMapOption('respawn') == 'timelimit' and not RaceMode.isPlayerFinished(source) then -- See if its worth doing a respawn local respawnTime = RaceMode.getMapOption('respawntime') if self:getTimeRemaining() - respawnTime > 3000 then -------line 317 error Countdown.create(respawnTime/1000, restorePlayer, 'You will respawn in:', 255, 255, 255, 0.25, 2.5, true, self.id, player):start(player) end if RaceMode.getMapOption('respawntime') >= 5000 then TimerManager.createTimerFor("map",player):setTimer(clientCall, 2000, 1, player, 'Spectate.start', 'auto') end end if g_MapOptions.respawn == 'none' then removeActivePlayer( player ) if getActivePlayerCount() < 1 and g_CurrentRaceMode.running then RaceMode.endMap() end end end
