-
Posts
1,283 -
Joined
-
Last visited
Everything posted by manve1
-
no i even tryied changing position of the label to center of screen still nope
-
i know it is serverSide, thats why i sayied trigger server side ...
-
hey guys, i need help on triggering server side, and making server side, this time however im trying to make alive player system for race DD servers and i couldn't find on on the community client: function make() label = guiCreateLabel( 0, 0.9525, 1, 1, "ALIVE: " .. getAlivePlayers .. "", true) guiSetFont ( label, "sa-header" ) guiLabelSetColor ( label, 255, 175, 0 ) end no server side thats the problem + trigger server side EDIT: i know this code is gonna be again 100% wrong
-
this is client version, you got server side too? or the createTeam function? we need more of a script, then we can figure stuff why it has bugs
-
TwiX thank you for a try. Ty to TAPL it worked bro, ty
-
sorry guy's but i forgot how to make on same button it shows something, once clicked the same button again it closes it function open() if (source == start_button) then test = guiCreateStaticImage( 0, 0.41, 0.3, 0.55, "pictures/8.png", true, gui ) end end addEventHandler("onClientGUIClick", start_button, open) If you help me, thank you
-
function pedcreation ( player ) local x, y, z = getElementPosition ( player ) local rot = getPedRotation ( player ) peds = createPed (92, x, y, z + 2 , rot ) attachElements ( peds, player ,0.5,2,1.5) setPedAnimation ( peds, "DANCING", "dnce_M_a") end addCommandHandler ( "piepie", pedcreation ) addEvent("onMapStarting") addEventHandler("onMapStarting", getRootElement(), function() destroyElement(peds) end) try this And why are you using command handler? it makes this when you write in the command, only way it will work, so why you using it? just a question
-
thanx, but u made mystake on thia event handler: addEventHandler("onClientDoubleClick", grid, use, false) should be: addEventHandler("onClientDoubleClick", root, use, false) -- should be root, not grid
-
yes https://wiki.multitheftauto.com/wiki/EngineReplaceModel and if u got a good weapon model, it should be changed by maker of the weapon ( i mean hud )
-
I'm making another script for MTA and i can't find and can't make that if there is already a vehicle created by that player, and when he tries to take another vehicle, first one gets destroyed. vehicles = { {"BMX", 481}, {"Bike", 509}, {"Mountain Bike", 510}, {"Faggio", 462}, } grid = guiCreateGridList ( 0.01, 0.2, 0.99, 0.5, true, Wnd ) guiGridListAddColumn( grid, "Vehicles", 0.85 ) for i,veh in ipairs( vehicles ) do row = guiGridListAddRow( grid ) -- guiGridListSetItemText ( grid, row, 1, tostring( veh [ 1 ] ), false, false ) guiGridListSetItemData ( grid, row, 1, tostring( veh [ 2 ] ) ) end function use ( ) local row, col = guiGridListGetSelectedItem ( grid ) if ( row and col and row ~= -1 and col ~= -1 ) then local model = tonumber ( guiGridListGetItemData ( grid, row, 1 ) ) local x, y, z = getElementPosition ( localPlayer ) if ( isElement ( object ) ) then destroyElement ( object ) end createVehicle( model, x + 1, y, z, 0, 0, 0 ) end end addEventHandler ( "onClientDoubleClick", root, use, false )
-
it's because map is made with respawn function, go to maps meta and turn it off
-
It's not your resource, make your own and post it we will help Use functions: createBlip attachElements createMarker onMarkerHit onMarkerLeave givePlayerMoney addEventHandler good luck
-
function armas(player,poli1,poli2) -- here giveWeapon ( poli1, 22, 200 ) giveWeapon ( poli2, 22, 200 ) triggerClientSide ( "Start.Ped", player, poli1, poli2 ) end addEvent( "Start.Arma", true ) addEventHandler( "Start.Arma", root, armas ) try this EDITED.
-
i got a problem, im trying to work out how to get player team so that if a player is on a team, he can only turf, if player doesn't have a team, he can't. addEventHandler( 'onColShapeHit', root, function( p ) -- you should have added player param here if (getPlayerTeam) then if( source == pCuboid ) then outputChatBox("------||~ INFO ~||------", p, 0,255,0) outputChatBox("Turf owners: coming soon!", p, 255,255,0) outputChatBox("Taken time: 10minutes.", p, 255,255,0) outputChatBox("Wait 10min to take turf.", p, 255,255,0) outputChatBox("------||~ END ~||------", p, 255,0,0) setRadarAreaFlashing( pArea, true ) local pTeam = getPlayerTeam( p ) -- source is the col shape, you should use 'p', the player arg local iR, iG, iB = getTeamColor( pTeam ) setTimer( function() setRadarAreaColor (pArea, iR, iG, iB, 100); givePlayerMoney( p, 4000 ); outputChatBox( "Congratulations, #FFFF00 you have taken the turf!", p, 0, 255, 0, true ); setRadarAreaFlashing( pArea, false ) end, 600000, 1 ) end end end )
-
lots of people ask for scripts, don't ask for help if u just need, scripts, help with someone else scripts and that, we are here ONLY to help you with your own scripts
-
we are here to help with your scripts, not to make them for you
-
EDIT: if you can, please tell me how to make it for all teams, so it doesn't need to be re-made everytime new team is added
-
i just started making in, it is still beta version ( beta 0.1 ) so no i don't and im beginner in LUA too EDIT: i'm learning by making complicated script's and i don't get few things still, but i do everything on the script.
-
how can i make that the turf system works only for people that have a group? local pArea = createRadarArea( 2130, 630, 200, 100, 0, 255, 0, 175 ) local pArea2 = createRadarArea( 2488.8793945313, 680.78289794922, 250, 130, 0, 255, 0, 175 ) addEventHandler( 'onColShapeHit', root, function( p ) -- you should have added player param here if( source == pCuboid ) then outputChatBox("------||~ INFO ~||------", p, 0,255,0) outputChatBox("Turf owners: coming soon!", p, 255,255,0) outputChatBox("Taken time: coming soon!", p, 255,255,0) outputChatBox("Wait 10min to take turf!", p, 255,255,0) outputChatBox("------||~ END ~||------", p, 255,0,0) setRadarAreaFlashing( pArea, true ) local pTeam = getPlayerTeam( p ) -- source is the col shape, you should use 'p', the player arg local iR, iG, iB = getTeamColor( pTeam ) setTimer( function() setRadarAreaColor (pArea, iR, iG, iB, 100); givePlayerMoney( p, 4000 ); outputChatBox( "Congratulations, #FFFF00 you have taken the turf!", p, 0, 255, 0, true ); setRadarAreaFlashing( pArea, false ) end, 100000, 1 ) end end ) addEventHandler( 'onColShapeLeave', root, function( ) if( source == pCuboid ) then setRadarAreaFlashing( pArea, false ) end end ) here is script.
-
I am creating turf system for community and when i start it, the radar goes colorful or just stay's one color, i'm not sure if it is MTA bug or anything like that, but it kinda scared me when i created another area PICS: Script: local pArea = createRadarArea( 2130, 728, 200, -100, 0, 255, 0, 175 ) local pArea2 = createRadarArea( 2496.5661621094, 764.83386230469, 300, -150, 0, 255, 0, 175 ) local pCuboid = createColCuboid( 2133.1950683594, 633.66455078125, 10, 197.5, 92, 12 ) addEventHandler("onResourceStart",resourceRoot,function() outputDebugString("Turf system by Enjoy ( manve ) || Has been turned on!") -- Please don't remove this =) end ) addEventHandler( 'onColShapeHit', root, function( p ) -- you should have added player param here if( source == pCuboid ) then setRadarAreaFlashing( pArea, true ) local pTeam = getPlayerTeam( p ) -- source is the col shape, you should use 'p', the player arg local iR, iG, iB = getTeamColor( pTeam ) setTimer( function() setRadarAreaColor (pArea, iR, iG, iB, 100); givePlayerMoney( p, 4000 ); outputChatBox( "Congratulations, #FFFF00 you have taken the turf!", p, 0, 255, 0, true ); setRadarAreaFlashing( pArea, false ) end, 1000, 1 ) end end ) addEventHandler( 'onColShapeLeave', root, function( ) if( source == pCuboid ) then setRadarAreaFlashing( pArea, false ) end end ) P.S. I got scared cuz i though i done something wrong in script
-
I get errors, as i said, I am still learning, and by doing complicated scripts i learn faster, and i don't know whats wrong now, im trying lots of different way's, and getting errors, local pArea = createRadarArea( 2130, 728, 200, -100, 0, 255, 0, 175 ) local pCuboid = createColCuboid( 2133.1950683594, 633.66455078125, 10, 197.5, 92, 12 ) addEventHandler( 'onColShapeHit', root, function( ) if( source == pCuboid ) then setRadarAreaFlashing( pArea, true ) local r, g, b local playerTeam = getPlayerTeam( source ) r, g, b = getTeamColor ( playerTeam ) setRadarAreaColor ( pArea, r, g, b, 175 ) end end ) addEventHandler( 'onColShapeLeave', root, function( ) if( source == pCuboid ) then setRadarAreaFlashing( pArea, false ) end end ) debug:
-
How can i make like if the player team gets the turf, it set the color to it, and when he leaves the turf, it stay's the same color as the player team color? P.S. I'm trying to learn scripting, I'm n00b at it, sorry if i ask something not even serious and very easy scripts.
-
I have on same place the Col shape ( Col cuboid ) and i still get it boolen hillRadar = createRadarArea ( 2130, 728, 200, -100, 0, 255, 0, 175 ) cuboid = createColCuboid( 2133.1950683594, 633.66455078125, 10, 197.5, 92, 12 ) function flash() posX, posY = getElementPosition( ) if isInsideRadarArea ( hillRadar, posX, posY ) then setRadarAreaColor ( hillRadar, 0, 0, 255, 255 ) setRadarAreaFlashing ( hillRadar, true ) end end setTimer ( flash, 1000, 1 ) addEventHandler("onColShapeHit", cuboid, flash) heres the new LUA
-
I'm trying to make a turf system for everyone in this community, as i see that people like turfing and are trying to make it, but they just can't and i just started scripting, and the script gets boolen. hillRadar = createRadarArea ( 2130, 728, 200, -100, 0, 255, 0, 175 ) cuboid = createColCuboid( 2133.1950683594, 633.66455078125, 10, 197.5, 92, 12 ) function flash() local posX, posY = getElementPosition( theElement ) if isInsideRadarArea ( hillRadar, posX, posY ) then setRadarAreaColor ( hillRadar, 0, 0, 255, 255 ) setRadarAreaFlashing ( hillRadar, true ) end end setTimer ( flash, 1000, 1 )
