Jump to content

Kenix

Retired Staff
  • Posts

    4,121
  • Joined

  • Last visited

  • Days Won

    2

Everything posted by Kenix

  1. На видео маленькое оно , а так нормальное.
  2. Kenix

    Replacement

    You can create it with dx dunctions. https://wiki.multitheftauto.com/wiki/Cli ... _functions
  3. Сделали с Zver-CR небольшой скрипт "Игровой автомат". Приятного просмотра.
  4. Прочти это пожалуйста. viewtopic.php?f=141&t=32458
  5. RAFuLL,Не совсем понял , что ты хочешь..
  6. local spam = { } local uTimers = { } local setting = get( "kick" ) function onChat ( message, messageType ) spam[ source ] = tonumber( spam[ source ] or 0 ) + 1 if spam[ source ] == 1 then outputChatBox( "Warning - Do Not Spam! ",source,255,0,0 ) elseif spam[ source ] > 3 then if setting == "true" then outputChatBox( "Kicking " .. getPlayerName(source) .. " For Flooding The Chat!",root,255,0,0 ) kickPlayer( source,"You Have Been Kicked For Flooding!" ) elseif setting == "false" then setPlayerMuted( source,true ) outputChatBox( getPlayerName(source) .. " Has Been Auto Muted [20 sec]",root,255,0,0 ) if isTimer( uTimers[ source ] ) then killTimer( uTimers[ source ] ) end uTimers[ source ] = setTimer( setPlayerMuted,20000,1,source,false ) end end end addEventHandler ( "onPlayerChat", root, onChat) function quitPlayer( ) spam[ source ] = nil uTimers[ source ] = nil end addEventHandler ( "onPlayerQuit", root, quitPlayer ) Updated. You can not fix yourself?
  7. pressed = false player = localPlayer function resetState( ) pressed = false end ---------------------------- Create --------------------------------------------- myWindow = guiCreateWindow ( 0.20, 0.20, 0.6, 0.6, "Test Window", true ) Label = { guiCreateLabel(15 , 24, 220, 17,"Name: N/A",true,Window), guiCreateLabel(15 , 24 ,220 , 17,"IP: N/A",true,Window), guiCreateLabel(0.03,0.34,0.66,0.0887,"Money: N/A",true,Window), guiCreateLabel(0.03,0.39,0.17,0.0806,"Health: N/A",true,Window), guiCreateLabel(0.20,0.39,0.30,0.0806,"Armour: N/A",true,Window), guiCreateLabel(0.03,0.44,0.17,0.0806,"Skin: N/A",true,Window), guiCreateLabel(0.20,0.44,0.30,0.0806,"Weapon: N/A",true,Window), guiCreateLabel(0.03,0.49,0.66,0.0806,"Faction: N/A",true,Window), guiCreateLabel(0.03,0.27,0.66,0.0806,"Ping: N/A",true,Window), guiCreateLabel(0.03,0.56,0.66,0.0806,"Vehicle: N/A",true,Window), guiCreateLabel(0.03,0.63,0.66,0.0806,"Warns: N/A",true,Window), guiCreateLabel(0.6,0.41,0.4031,0.0766,"Location: N/A",true,Window), guiCreateLabel(0.6,0.12,0.4031,0.0766,"X:",true,Window), guiCreateLabel(0.6,0.17,0.4031,0.0766,"Y: N/A",true,Window), guiCreateLabel(0.6,0.22,0.4031,0.0766,"Z: N/A",true,Window), guiCreateLabel(0.6,0.29,0.2907,0.0806,"Interior: N/A",true,Window), guiCreateLabel(0.6,0.34,0.2907,0.0806,"Dimension: N/A",true,Window), guiCreateLabel(0.03,0.17,0.66,0.0887,"Admin Level: N/A", true,Window), guiCreateLabel(0.03,0.22,0.66,0.0887,"Donator Level: N/A",true,Window), guiCreateLabel(0.6,0.48,0.4093,0.0806,"Hours Ingame: N/A",true,Window), } guiSetVisible( myWindow,false ) for _,v in pairs( Label ) do guiSetVisible( v,false ) end ---------------------------[HELP]-------------------- function F4Uc( key, keyState ) if not (pressed) then pressed = true setTimer(resetState, 200, 1) for _,v in pairs( Label ) do guiSetVisible( v,not guiGetVisible( v ) ) end guiSetVisible( myWindow,not guiGetVisible( myWindow ) ) showCursor( not isCursorShowing( ) ) end end bindKey( "F4", "down", F4Uc ) addEventHandler( "onClientRender", root, function() if isElement( myWindow ) and guiGetVisible( myWindow ) then guiSetText ( Label[1], "Name: " .. getPlayerName(player) .. " (" ..tostring( getElementData( player, "gameaccountusername" ) ) .. ")") local x, y, z = getElementPosition(player) guiSetText ( Label[13], "X: " .. x ) guiSetText ( Label[14], "Y: " .. y ) guiSetText ( Label[15], "Z: " .. z ) guiSetText ( Label[3], "Money: $" .. tostring( exports.global:getMoney( player ) ) .. " (Bank: $" .. tostring( getElementData( player, "bankmoney" ) ) .. ")") guiSetText ( Label[4], "Health: " .. tostring( math.ceil( getElementHealth( player ) ) ) ) guiSetText ( Label[5], "Armour: " .. tostring( math.ceil( getPedArmor( player ) ) ) ) guiSetText ( Label[6], "Skin: " .. tostring( getElementModel( player ) ) ) local weapon = getPedWeapon( player ) if weapon then weapon = getWeaponNameFromID( weapon ) else weapon = "N/A" end guiSetText ( Label[7], "Weapon: " ..tostring( weapon ) ) local team = getPlayerTeam(player) if team then guiSetText ( Label[8], "Faction: " ..tostring( getTeamName( team ) ) ) else guiSetText ( Label[8], "Faction: N/A") end guiSetText ( Label[9], "Ping: " ..tostring( getPlayerPing( player ) ) ) local vehicle = getPedOccupiedVehicle( player ) if vehicle then guiSetText ( Label[10], "Vehicle: " .. getVehicleName( vehicle ) .. " (" ..tostring( getElementData( vehicle, "dbid" ) ) .. ")" ) else guiSetText ( Label[10], "Vehicle: N/A") end guiSetText ( Label[12], "Location: " .. tostring( getZoneName( x, y, z ) ) ) guiSetText ( Label[16], "Interior: " .. tostring( getElementInterior( player ) ) ) guiSetText ( Label[17], "Dimension: " .. tostring( getElementDimension( player ) ) ) guiSetText ( Label[20], "Hours Ingame: " .. tostring( getElementData( player, "hoursplayed" ) or 0 ) ) end end ) Updated.
  8. local team = getPlayerTeam( source ) -- указывай элемент if team then -- Если игрок в команде if getTeamFromName( team ) == 'TeamSome' then -- Если игрок находится в команде 'TeamSome' ( Название команды ) то -- .. дальше код end end
  9. You mean nametag color? https://wiki.multitheftauto.com/wiki/Set ... metagColor
  10. Where this line lol? Show full code.
  11. 1.Условие у тебя не правильное. 2.thePlayer не существует !.Тебе нужно указать источник ( source ) если ты его тригерил. addEvent( "PoliceTeam",true ) function SetPlayerPolice( ) local level = getPlayerWantedLevel ( source ) if ( level == 0 ) then setPlayerTeam ( source, getTeamFromName( "Police" ) ) else outputChatBox( "Ты разыскиваешься!Отсиди в тюрьме!", source ) end end addEventHandler( "PoliceTeam", root, SetPlayerPolice )
  12. Shop = createColSphere( -1658, 1211, 8, 2) function ShopF(theElement) if (theElement ~= localPlayer) then return end -- If the player who hit the colshape isn't the client, cancel the function. setCameraMatrix( -1664, 1210, 22, 0, 0, 0, 0, 0) CarOfTheDay = createVehicle( math.random(400,611), -1655, 1209, 22 ) showCursor(true) if ( getVehicleType( CarOfTheDay ) == "Automobile" ) then setVehicleColor( CarOfTheDay, math.random(0,255), math.random(0,255), math.random(0,255) ) showPlayerHudComponent("all", false) LeftB = guiCreateButton(342,684,176,57,"< Left",false) guiSetFont(LeftB,"default-bold-small") RightB = guiCreateButton(737,684,176,57,"Right >",false) guiSetFont(RightB,"default-bold-small") ExitB = guiCreateButton(539,714,174,26,"Exit",false) guiSetFont(ExitB,"default-bold-small") BuyB = guiCreateButton(539,689,174,26,"Buy",false) guiSetFont(BuyB,"default-bold-small") addEventHandler( "onClientGUIClick",LeftB,LeftFEnter,false ) addEventHandler( "onClientGUIClick",RightB,RightFEnter,false ) addEventHandler( "onClientGUIClick",BuyB,BuyF,false ) addEventHandler( "onClientGUIClick",ExitB,ExitF,false ) else destroyElement(CarOfTheDay) CarOfTheDay = createVehicle( math.random(400,611), -1655, 1209, 22 ) end end addEventHandler("onClientColShapeHit",Shop,ShopF) function ExitF() destroyElement(LeftB) destroyElement(RightB) destroyElement(ExitB) destroyElement(BuyB) destroyElement(CarOfTheDay) showPlayerHudComponent("all", true) setCameraTarget(localPlayer) showCursor(false) end function LeftFEnter() if isElement( CarOfTheDay ) then local RX, RY, RZ = getElementRotation( CarOfTheDay ) setElementRotation(CarOfTheDay, RX, RY, RZ + 10) end end function RightFEnter() if isElement( CarOfTheDay ) then local RX, RY, RZ = getElementRotation( CarOfTheDay ) setElementRotation(CarOfTheDay, RX, RY, RZ - 10) end end function BuyF() CW = guiCreateWindow(470,244,543,180,"Confirmation",false) CL = guiCreateLabel(2,47,545,20,"Are you sure you want to buy this car for $3.000?",false,CW) guiLabelSetColor(CL,0,255,0) guiLabelSetHorizontalAlign(CL,"center",false) guiSetFont(CL,"default-bold-small") YesB = guiCreateButton(59,115,159,39,"Yes",false,CW) NoB = guiCreateButton(322,115,159,39,"No",false,CW) addEventHandler("onClientGUIClick",NoB,NoF,false) addEventHandler("onClientGUIClick",YesB,YesF,false) end function NoF() destroyElement(CW) end function YesF() Model = getElementModel(CarOfTheDay) Up = getVehicleUpgrades ( CarOfTheDay ) triggerServerEvent("spawnCar",getRootElement(),localPlayer, Model) showCursor(false) end Syntax bug in forum. if (getVehicleType" class="kw2">getVehicleType" class="kw2">getVehicleType(CarOfTheDay) == "Automobile") then
  13. myWindow = nil pressed = false player = localPlayer function resetState( ) pressed = false end ---------------------------[HELP]-------------------- function F4Uc( key, keyState ) if not (pressed) then pressed = true setTimer(resetState, 200, 1) if not myWindow then myWindow = guiCreateWindow ( 0.20, 0.20, 0.6, 0.6, "Test Window", true ) Label = { guiCreateLabel(0.20, 0.20, 0.6, 0.6,"Name: N/A",true,Window), guiCreateLabel(0.20, 0.21, 0.6, 0.6,"IP: N/A",true,Window), guiCreateLabel(0.03,0.34,0.66,0.0887,"Money: N/A",true,Window), guiCreateLabel(0.03,0.39,0.17,0.0806,"Health: N/A",true,Window), guiCreateLabel(0.20,0.39,0.30,0.0806,"Armour: N/A",true,Window), guiCreateLabel(0.03,0.44,0.17,0.0806,"Skin: N/A",true,Window), guiCreateLabel(0.20,0.44,0.30,0.0806,"Weapon: N/A",true,Window), guiCreateLabel(0.03,0.49,0.66,0.0806,"Faction: N/A",true,Window), guiCreateLabel(0.03,0.27,0.66,0.0806,"Ping: N/A",true,Window), guiCreateLabel(0.03,0.56,0.66,0.0806,"Vehicle: N/A",true,Window), guiCreateLabel(0.03,0.63,0.66,0.0806,"Warns: N/A",true,Window), guiCreateLabel(0.6,0.41,0.4031,0.0766,"Location: N/A",true,Window), guiCreateLabel(0.6,0.12,0.4031,0.0766,"X:",true,Window), guiCreateLabel(0.6,0.17,0.4031,0.0766,"Y: N/A",true,Window), guiCreateLabel(0.6,0.22,0.4031,0.0766,"Z: N/A",true,Window), guiCreateLabel(0.6,0.29,0.2907,0.0806,"Interior: N/A",true,Window), guiCreateLabel(0.6,0.34,0.2907,0.0806,"Dimension: N/A",true,Window), guiCreateLabel(0.03,0.17,0.66,0.0887,"Admin Level: N/A", true,Window), guiCreateLabel(0.03,0.22,0.66,0.0887,"Donator Level: N/A",true,Window), guiCreateLabel(0.6,0.48,0.4093,0.0806,"Hours Ingame: N/A",true,Window), } end end end bindKey( "F4", "down", F4Uc ) addEventHandler( "onClientRender", root, function() if isElement( myWindow ) and guiGetVisible( myWindow ) then guiSetText ( Label[1], "Name: " .. getPlayerName(player) .. " (" ..tostring( getElementData( player, "gameaccountusername" ) ) .. ")") local x, y, z = getElementPosition(player) guiSetText ( Label[13], "X: " .. x ) guiSetText ( Label[14], "Y: " .. y ) guiSetText ( Label[15], "Z: " .. z ) guiSetText ( Label[3], "Money: $" .. tostring( exports.global:getMoney( player ) ) .. " (Bank: $" .. tostring( getElementData( player, "bankmoney" ) ) .. ")") guiSetText ( Label[4], "Health: " .. tostring( math.ceil( getElementHealth( player ) ) ) ) guiSetText ( Label[5], "Armour: " .. tostring( math.ceil( getPedArmor( player ) ) ) ) guiSetText ( Label[6], "Skin: " .. tostring( getElementModel( player ) ) ) local weapon = getPedWeapon( player ) if weapon then weapon = getWeaponNameFromID( weapon ) else weapon = "N/A" end guiSetText ( Label[7], "Weapon: " ..tostring( weapon ) ) local team = getPlayerTeam(player) if team then guiSetText ( Label[8], "Faction: " ..tostring( getTeamName( team ) ) ) else guiSetText ( Label[8], "Faction: N/A") end guiSetText ( Label[9], "Ping: " ..tostring( getPlayerPing( player ) ) ) local vehicle = getPedOccupiedVehicle( player ) if vehicle then guiSetText ( Label[10], "Vehicle: " .. getVehicleName( vehicle ) .. " (" ..tostring( getElementData( vehicle, "dbid" ) ) .. ")" ) else guiSetText ( Label[10], "Vehicle: N/A") end guiSetText ( Label[12], "Location: " .. tostring( getZoneName( x, y, z ) ) ) guiSetText ( Label[16], "Interior: " .. tostring( getElementInterior( player ) ) ) guiSetText ( Label[17], "Dimension: " .. tostring( getElementDimension( player ) ) ) guiSetText ( Label[20], "Hours Ingame: " .. tostring( getElementData( player, "hoursplayed" ) or 0 ) ) end end ) Almost functions where guiSetText return number value ( not string ) then need convert to string.
  14. Yes it is. Server side type will be defaulted.
  15. Shop = createColSphere( -1658, 1211, 8, 2) function ShopF(theElement) if (theElement ~= localPlayer) then return end -- If the player who hit the colshape isn't the client, cancel the function. setCameraMatrix( -1664, 1210, 22, 0, 0, 0, 0, 0) CarOfTheDay = createVehicle( math.random(400,611), -1655, 1209, 22 ) showCursor(true) if (getVehicleType" class="kw2">getVehicleType(CarOfTheDay) == "Automobile") then setVehicleColor( CarOfTheDay, math.random(0,255), math.random(0,255), math.random(0,255) ) showPlayerHudComponent("all", false) LeftB = guiCreateButton(342,684,176,57,"< Left",false) guiSetFont(LeftB,"default-bold-small") RightB = guiCreateButton(737,684,176,57,"Right >",false) guiSetFont(RightB,"default-bold-small") ExitB = guiCreateButton(539,714,174,26,"Exit",false) guiSetFont(ExitB,"default-bold-small") BuyB = guiCreateButton(539,689,174,26,"Buy",false) guiSetFont(BuyB,"default-bold-small") addEventHandler( "onClientGUIClick",LeftB,LeftFEnter,false ) addEventHandler( "onClientGUIClick",RightB,RightFEnter,false ) addEventHandler( "onClientGUIClick",BuyB,BuyF,false ) addEventHandler( "onClientGUIClick",ExitB,ExitF,false ) else destroyElement(CarOfTheDay) CarOfTheDay = createVehicle( math.random(400,611), -1655, 1209, 22 ) end end addEventHandler("onClientColShapeHit",Shop,ShopF) function ExitF() destroyElement(LeftB) destroyElement(RightB) destroyElement(ExitB) destroyElement(BuyB) destroyElement(CarOfTheDay) showPlayerHudComponent("all", true) setCameraTarget(localPlayer) showCursor(false) end function LeftFEnter() if isElement( CarOfTheDay ) then local RX, RY, RZ = getElementRotation( CarOfTheDay ) setElementRotation(CarOfTheDay, RX, RY, RZ + 10) end end function RightFEnter() if isElement( CarOfTheDay ) then local RX, RY, RZ = getElementRotation( CarOfTheDay ) setElementRotation(CarOfTheDay, RX, RY, RZ - 10) end end function BuyF() CW = guiCreateWindow(470,244,543,180,"Confirmation",false) CL = guiCreateLabel(2,47,545,20,"Are you sure you want to buy this car for $3.000?",false,CW) guiLabelSetColor(CL,0,255,0) guiLabelSetHorizontalAlign(CL,"center",false) guiSetFont(CL,"default-bold-small") YesB = guiCreateButton(59,115,159,39,"Yes",false,CW) NoB = guiCreateButton(322,115,159,39,"No",false,CW) addEventHandler("onClientGUIClick",NoB,NoF,false) addEventHandler("onClientGUIClick",YesB,YesF,false) end function NoF() destroyElement(CW) end function YesF() Model = getElementModel(CarOfTheDay) Up = getVehicleUpgrades ( CarOfTheDay ) triggerServerEvent("spawnCar",getRootElement(),localPlayer, Model) showCursor(false) end
  16. Better create table in index use player element. So add ( spam count ) to table +1 and etc. This very easy check. Tables is very good for all
  17. I tested it. I think you need report in bug tracker. And you can also create colshape and attach events to him.
  18. As another option to marker higher. Just add to the axis of z + 1 and check again. If the marker below the player's position, the event will not be called. local marker_red = createMarker(-840.5, 502, 1358.1999511719, "cylinder", 3 , 255, 0, 0, 255 ) setElementInterior ( marker_red, 1 ) local marker_blue = createMarker(-840.5, 495.60000610352, 1358.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 )
×
×
  • Create New...