-
Posts
4,121 -
Joined
-
Last visited
-
Days Won
2
Everything posted by Kenix
-
Мы не телепаты. Что именно не работает? Дебаг? Вручную как сапёр проверь каждую строку ( хоть это и звучит глупо, но это действено ) через функции outputChatBox/outputDebugString и т.п. Ты уже сам поймёшь где у тебя чё не сходится.
-
Try this debug. local marker_red = createMarker(-840.5, 502, 1357.1999511719, "cylinder", 3 , 255, 0, 0, 255 ) setElementInterior ( marker_red, 1 ) local marker_blue = createMarker(-840.5, 495.60000610352, 1357.1999511719, "cylinder", 3, 0, 0, 255, 255 ) setElementInterior ( marker_blue, 1 ) outputChatBox 'Debug:markers' function rvbstart( thePlayer, hitElement ) outputChatBox 'Debug:hit' if source == marker_red then setElementPosition ( thePlayer, 697.5, -2677.8000488281, 8.8000001907349, true ) setElementInterior ( thePlayer, 0 ) outputChatBox 'Debug:warped --> marker_red' elseif source == marker_blue then setElementPosition ( thePlayer, 534.70001220703, -2694.1000976563, 8.8000001907349, true ) setElementInterior ( thePlayer, 0 ) outputChatBox 'Debug:warped --> marker_blue' end end addEventHandler ( "onMarkerHit",root,rvbstart )
-
local robmarker = createMarker ( 2485.31210327148, -1667.29792785645, 13.382812, "cylinder", 4.5, 255, 0, 0, 128 ) function robb ( thePlayer ) givePlayerMoney ( thePlayer, math.random(50000, 100000) ) setPlayerWantedLevel ( thePlayer, 6 ) end function death() if isTimer( robbank ) then killTimer( robbank ) end end function bankrob ( hitPlayer, matchingDimension ) if getElementType( hitPlayer ) == 'player' then if source == robmarker then if isTimer( robbank ) then -- cancelEvent() это событие нельзя отменить outputChatBox( "Банк уже ограблен", hitPlayer, 255, 255, 0) end else outputChatBox ( "****Система Банк Роба(Скоро в GUI)Нажмите n чтобы ограбить банк.****", hitPlayer, 255, 0, 0, false ) bindKey ( hitPlayer,"n", "down", function( player ) if isTimer( robbank ) then outputChatBox ( "ERROR", player, 255, 0, 0, false ) else outputChatBox ( "-", root, 255, 0, 0, false ) setPlayerWantedLevel ( player, 4 ) robbank = setTimer( robb, 10000, 1, player ) end end ) end end end addEventHandler( "onMarkerHit", root, bankrob ) addEventHandler ( "onPlayerWasted", root, death ) Обновил.
-
Покажи полный код. И покажи, как ты вызываешь событие robstart из клиента. P.S Желательно всё покажи сервер/клиент.
-
Ok dude. Good luck.
-
Show full code.
-
Именно тут? В функции обработчика события не орёт? Лучше напиши лог всех ошибок.
-
You need rotate vehicle ( not set position ).
-
Hmm,your interior is 1 right?
-
You need find what destroy guis , if player logout.
-
1.onResourceStart --> trigger Client event onLoginLoad. 2.if player logout you destroy guis?
-
Покажи код. Тогда узнаем.
-
Взрыв будет виден, урона не будет если задать в аргументах. Если высоко сделать над головой игрока , то не будет видно.
-
Show full code .
-
Show meta.xml
-
Please read all comments. local timer = { } function flood (msg, msgType) -- where is source ? or maybe you use event?If you use event then you not needed add source to argument function. elseif timer = {3} then -- this is syntax error. Delete this row. if ( hasObjectPermissionTo ( getThisResource (), "function.kickPlayer", true ) ) then if isObjectInACLGroup ( "user." .. accountname, aclGetGroup ( "admin" ) ) then -- accountname is nil outputChatBox("Please Dont Repate more then 3 Times or You Well Be Kicked. 1/0",source,255,255,0) outputChatBox("Please Dont Repate more then 3 Times or You Well Be Kicked. 2/2",source,255,255,0) outputChatBox("Please Dont Repate more then 3 Times or You Well Be Kicked. 3/3",source,255,255,0) outputChatBox(getPlayerName(source) .."Has Been Kicked For Flooding the Chat 3/3",255,0,255) kickPlayer ( source, "You Have Been Kicked For Flooding The Chat !") end -- missing end Updated.
-
Client HospitalSF = createColSphere(-2654, 639, 15, 1) HospitalLV = createColSphere(1608, 1817, 11, 1) HospitalFC = createColSphere(-320, 1051, 21, 1) HospitalM = createColSphere(1243, 329, 20, 1) HospitalLS1 = createColSphere(2035, -1404, 18, 1) HospitalLS2 = createColSphere(1174, -1323, 16, 1) function Heal() if (Money < fee) then outputChatBox("You aint got the greens") else local fee = guiScrollBarGetScrollPosition(Bar) triggerServerEvent("takeMoney",getRootElement(),fee) setElementHealth(localPlayer, getElementHealth(localPlayer) + fee) outputChatBox("Recovered ".. fee .."% of HP!") end end function Exit() destroyElement(HospitalW) setTimer(fadeCamera,1000,1,false,1,0,0,0) end addEventHandler("onClientColShapeHit",root, function() if source == HospitalSF or HospitalLV or HospitalFC or HospitalM or HospitalLS1 or HospitalLS2 then if theElement == localPlayer then setTimer(fadeCamera,1000,1,true,1) Name = getPlayerName(localPlayer) Money = getPlayerMoney(localPlayer) Skin = getElementModel(localPlayer) HospitalW = guiCreateWindow(291,266,551,269,"Hospital",false) Name = guiCreateLabel(24,28,128,18,"Name: "..Name.."",false,HospitalW) Currency = guiCreateLabel(24,52,121,18,"Currency: "..Money.."",false,HospitalW) Skin = guiCreateLabel(24,75,113,18,"Skin(ID): "..Skin.."",false,HospitalW) Bar = guiCreateScrollBar(74,146,361,22,true,false,HospitalW) HPL = guiCreateLabel(91,123,85,18,"HP: "..tostring( getElementHealth( localPlayer ) ) .."",false,HospitalW) ExitB = guiCreateButton(237,219,81,35,"Exit",false,HospitalW) HealB = guiCreateButton(441,144,101,26,"Heal",false,HospitalW) Img = guiCreateStaticImage(148,33,251,93,"Hospilogo.png",false,HospitalW) addEventHandler("onClientGUIClick",HealB,Heal,false) addEventHandler("onClientGUIClick",ExitB,Exit,false) end end end ) function getBarPos() if Bar and isElement( HPL ) then local fee = guiScrollBarGetScrollPosition(Bar) guiSetText( HPL,"Fee: ".. tostring( fee ) ) end end addEventHandler( "onClientRender",root,getBarPos )
-
Server function isNumber( value ) if type( value ) == 'string' then if value:find( '^[0-9]' ) then return true end return false end return false end function findPlayer(namepart) local player = getPlayerFromName(namepart) if player then return player end for _,player in ipairs(getElementsByType("player")) do if string.find(string.gsub(getPlayerName(player):lower(),"#%x%x%x%x%x%x", ""), namepart:lower(), 1, true) then return player end end return false end addCommandHandler( "setphp", function( player,_,arg1,arg2 ) local playerTeam = getPlayerTeam ( player ) if playerTeam then local name = getTeamName ( playerTeam ) if name == "Owner" or name == "Admin" then local health,find if isNumber( arg1 ) and not arg2 then health = tonumber( arg1 ) find = player elseif arg1 and isNumber( arg2 ) then health = tonumber( arg2 ) local finded = findPlayer( arg1 ) if finded then find = finded else find = false end end if find then setElementHealth( find, health ) else outputChatBox( 'Player not found use: /setphp [amount] or /setphp [player name][amount]',player,255,0,0 ) end end end end ) Full code. Tested. cmd /setphp
-
function isNumber( value ) if type( value ) == 'string' then if tonumber( value ) then return true end return false end return false end addCommandHandler( "setphp", function( player,_,arg1,arg2 ) local playerTeam = getPlayerTeam ( player ) if playerTeam then local name = getTeamName ( playerTeam ) if name == "Owner" or name == "Admin" then local health,find if isNumber( arg1 ) and not arg2 then health = tonumber( arg1 ) find = player elseif arg1 and isNumber( arg2 ) then health = tonumber( arg2 ) local finded = findPlayer( arg1 ) if finded then find = finded else find = false end end if find then setElementHealth( find, health ) else outputChatBox( 'Player not found use: /setphp [amount] or /setphp [player name][amount]',player,255,0,0 ) end end end end ) Updated.
-
Server addCommandHandler( "setphp", function( player,_,thePlayer,theHealth ) if thePlayer and theHealth then local theHealth = tonumber( theHealth ) local playerTeam = getPlayerTeam ( player ) if playerTeam then local name = getTeamName ( playerTeam ) if name == "Owner" or name == "Admin" then local find = findPlayer( thePlayer ) if not find then find = player end if theHealth then setElementHealth( find, theHealth ) end end end else outputChatBox( '/setphp [player name][amount]',player,255,0,0 ) end end ) So if player not found then set health you.
-
local BodyguardMarker = createMarker( -2765.46118, 368.87973, 5.17000, 'cylinder', 2.0, 255, 0, 0, 150) local BodyguardTeam = createTeam ( "Bodyguard", 47, 79, 79 ) function MarkerHit( hitElement, matchingDimension ) if getElementType( hitElement ) == 'player' and not isPedInVehicle( BodyguardMarker ) then setPlayerTeam( hitElement, BodyguardTeam ) end end addEventHandler( "onMarkerHit", BodyguardMarker, MarkerHit ) 1.So you attach not defined variable to 2 argument in function addEventHandler. 2.Your code setPlayerTeam(BodyguardMarker, BodyguardTeam) So you trying to set marker in team.
-
Araab Muzik Момент на 5:55 улыбнул.