Axel Posted February 27, 2012 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
Kenix Posted February 27, 2012 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 )
Axel Posted February 27, 2012 Author Posted February 27, 2012 U know a way to save it?Also there were meant to be radar and radar2
Kenix Posted February 27, 2012 Posted February 27, 2012 getRadarAreaColor setRadarAreaColor isRadarAreaFlashing setRadarAreaFlashing getPlayerName https://wiki.multitheftauto.com/wiki/Ser ... _functions
Axel Posted February 27, 2012 Author Posted February 27, 2012 And if i want to make more turfs for teams?
Kenix Posted February 27, 2012 Posted February 27, 2012 Not understand. I give you links functions. Do.
Castillo Posted February 27, 2012 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.
Axel Posted February 28, 2012 Author Posted February 28, 2012 Wich it's better? Is there a chance if i use XML to make lag?
Castillo Posted February 28, 2012 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.
Kenix Posted March 11, 2012 Posted March 11, 2012 https://wiki.multitheftauto.com/wiki/Gui ... rogressBar or https://wiki.multitheftauto.com/wiki/DxDrawRectangle And update it in event onClientRender.
Axel Posted March 11, 2012 Author 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 ...
Kenix Posted March 11, 2012 Posted March 11, 2012 I not understand you. 1/10 - 10 is all zones? - 1 zone id? or you mean common captured zones?
Axel Posted March 11, 2012 Author 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)
Jokeℝ1472771893 Posted August 4, 2012 Posted August 4, 2012 he mean for example every 1 min it will show you what is climbing progress
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