Axel Posted February 27, 2012 Share Posted February 27, 2012 So i made this crappy turfs system: ingeriimortii=createRadarArea( 1165, -933,400,200,0,0,255,50) dragoniirosi=createRadarArea( 2611, -2053,200,160,255,0,0,50) dcol = createColRectangle ( 2611, -2053, 200, 160 ) icol = createColRectangle ( 1165, -933,400,200 ) function radar (source) setRadarAreaColor ( dragoniirosi, 0,0,255, 50 ) setRadarAreaFlashing ( dragoniirosi, false ) exports.global:giveMoney(source, 5) end function radar2 (source) setRadarAreaFlashing ( dragoniirosi, false ) setRadarAreaColor ( dragoniirosi, 255,0,0, 50 ) exports.global:giveMoney(source, 5) end function enter( source ) if getPlayerTeam(source) == getTeamFromName("Dragonii Rosii") then outputChatBox("Bine ai revenit Membru al Dragoniilor Rosii!",source,255,0,0) setRadarAreaFlashing ( dragoniirosi, true ) setTimer ( radar2, 5000, 5000) elseif getPlayerTeam(source) == getTeamFromName("Ingerii Mortii") then outputChatBox("Ai atacat teritoriul Dragoniilor Rosii!",source,255,0,0) setTimer ( radar, 5000, 5000) setRadarAreaFlashing ( dragoniirosi, true ) else outputChatBox("Ai intrat pe teriroruil unu-i gang ai grija sa nu fi atacat!",source,255,0,0) end end addEventHandler ( "onColShapeHit", dcol, enter ) function enter2( source ) if getPlayerTeam(source) == getTeamFromName("Ingerii Mortii") then outputChatBox("Bine ai revenit Membru al Ingerii Mortii!",source,0,0,255) setRadarAreaFlashing ( ingeriimortii, false ) setTimer ( radar4, 5000, 5000) elseif getPlayerTeam(source) == getTeamFromName("Dragonii Rosii") then outputChatBox("Ai atacat teritoriul Ingerilor Mortii!",source,0,0,255) setTimer ( radar5, 5000, 5000) setRadarAreaFlashing ( ingeriimortii, true ) else outputChatBox("Ai intrat pe teriroruil unu-i gang ai grija sa nu fi atacat!",source,255,0,0) end end addEventHandler ( "onColShapeHit", icol, enter2 ) I need some help in better way of creating turfs, a way to check if the player is inside it and if he exits the attacking stops.. and maybe some advice how to make it better Link to comment
Kenix Posted February 27, 2012 Share Posted February 27, 2012 ingeriimortii = createRadarArea( 1165, -933,400,200,0,0,255,50) dragoniirosi = createRadarArea( 2611, -2053,200,160,255,0,0,50) dcol = createColRectangle ( 2611, -2053, 200, 160 ) icol = createColRectangle ( 1165, -933,400,200 ) local uTimers = { } function radar ( source ) setRadarAreaColor ( dragoniirosi, 0,0,255, 50 ) setRadarAreaFlashing ( dragoniirosi, false ) exports.global:giveMoney( source, 5 ) end function radar2 ( source ) setRadarAreaFlashing ( dragoniirosi, false ) setRadarAreaColor ( dragoniirosi, 255,0,0, 50 ) exports.global:giveMoney( source, 5 ) end function onColShapeHit( hitElement ) if getElementType( hitElement ) == 'player' then if getPlayerTeam( hitElement ) == getTeamFromName( "Ingerii Mortii" ) then outputChatBox( "Bine ai revenit Membru al Ingerii Mortii!",hitElement,0,0,255 ) setRadarAreaFlashing ( ingeriimortii, false ) --setTimer ( radar4, 5000, 5000 ) -- radar4 is nil uTimers[ hitElement ] = setTimer( radar,5000,5000,hitElement ) -- maybe it? elseif getPlayerTeam( hitElement ) == getTeamFromName( "Dragonii Rosii" ) then outputChatBox( "Ai atacat teritoriul Ingerilor Mortii!",hitElement,0,0,255 ) --setTimer ( radar5, 5000, 5000) -- radar5 is nil uTimers[ hitElement ] = setTimer( radar2,5000,5000,hitElement ) -- maybe it? setRadarAreaFlashing ( ingeriimortii, true ) else outputChatBox("Ai intrat pe teriroruil unu-i gang ai grija sa nu fi atacat!",hitElement,255,0,0) end end end addEventHandler ( "onColShapeHit", icol, onColShapeHit ) addEventHandler ( "onColShapeHit", dcol, onColShapeHit ) addEventHandler( 'onPlayerQuit',root, function( ) uTimers[ source ] = nil end ) Link to comment
Axel Posted February 27, 2012 Author Share Posted February 27, 2012 U know a way to save it?Also there were meant to be radar and radar2 Link to comment
Kenix Posted February 27, 2012 Share Posted February 27, 2012 What save? Color? Flashing? Link to comment
Axel Posted February 27, 2012 Author Share Posted February 27, 2012 Ye color and owner.. Link to comment
Kenix Posted February 27, 2012 Share Posted February 27, 2012 getRadarAreaColor setRadarAreaColor isRadarAreaFlashing setRadarAreaFlashing getPlayerName https://wiki.multitheftauto.com/wiki/Ser ... _functions Link to comment
Axel Posted February 27, 2012 Author Share Posted February 27, 2012 And if i want to make more turfs for teams? Link to comment
Kenix Posted February 27, 2012 Share Posted February 27, 2012 Not understand. I give you links functions. Do. Link to comment
Castillo Posted February 27, 2012 Share Posted February 27, 2012 And if i want to make more turfs for teams? I would suggest you to either use (My)SQL or XML to store turfs, then load them when resource starts. Link to comment
Axel Posted February 28, 2012 Author Share Posted February 28, 2012 Wich it's better? Is there a chance if i use XML to make lag? Link to comment
Castillo Posted February 28, 2012 Share Posted February 28, 2012 Wich it's better? Is there a chance if i use XML to make lag? The more turfs you create, the bigger the XML file is, that'll start causing lag, I would suggest to either use: SQLITE or MySQL. P.S: In my opinion SQLITE is easier than XML. Link to comment
Axel Posted March 11, 2012 Author Share Posted March 11, 2012 How can i make the proggres of taking turfs? Link to comment
Kenix Posted March 11, 2012 Share Posted March 11, 2012 https://wiki.multitheftauto.com/wiki/Gui ... rogressBar or https://wiki.multitheftauto.com/wiki/DxDrawRectangle And update it in event onClientRender. Link to comment
Axel Posted March 11, 2012 Author Share Posted March 11, 2012 Well, your understood me wrong.. i don't want a progress bar, i want like a progress chatbox showing: Progress of taking turf: 1/10 Progress of taking turf: 2/10 ... Link to comment
Kenix Posted March 11, 2012 Share Posted March 11, 2012 I not understand you. 1/10 - 10 is all zones? - 1 zone id? or you mean common captured zones? Link to comment
Axel Posted March 11, 2012 Author Share Posted March 11, 2012 outputChatBox("Progres 1/10 from taking "..gang2.."'s turf.",source) outputChatBox("Progres 2/10 from taking "..gang2.."'s turf.",source) outputChatBox("Progres 3/10 from taking "..gang2.."'s turf.",source) Link to comment
Jokeℝ1472771893 Posted August 4, 2012 Share Posted August 4, 2012 he mean for example every 1 min it will show you what is climbing progress Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now