TheIceman1 Posted February 22, 2013 Posted February 22, 2013 (edited) When i enter the turf, nothing happens.(Using castillos gang system.) local beachTurfA = createRadarArea( 352.93, -2025.23, 100, -90, 255, 255, 255, 125 ) local beachTurfC = createColRectangle ( 352.93, -2025.23, 100, -90 ) function beachTurf(player) if (getElementData( player, "gang" )) then local gang = getElementData( player, "gang" ) local r, g, b = exports [ "gang_system" ]:getGangColor ( gang ) setRadarAreaFlashing ( beachTurfA, true ) exports ["guimessages"] : outputServer ( player, "You entered the turf!" , 255, 0, 0 ) beachturfTimer = setTimer ( function(player) setRadarAreaColor ( beachTurfA, r, g, b, 100 ) exports ["guimessages"] : outputServer ( player, "Congratulations,your gang take this turf!" , 255, 0, 0 ) givePlayerMoney ( player, 2000 ) setRadarAreaFlashing ( beachTurfA, false ) end, 10000, 1 ) end end addEventHandler ( "onColShapeHit", beachTurfC, beachTurf ) Edited February 22, 2013 by Guest Need paid scripter just pm me i will accept every job!
manve1 Posted February 22, 2013 Posted February 22, 2013 Event handler say's you made it when you leave it, not when you enter it Looking for tutorials or information? check out: www.simpleask.co.uk
TheIceman1 Posted February 22, 2013 Author Posted February 22, 2013 (edited) Ahh,i didnt see. Edited February 22, 2013 by Guest Need paid scripter just pm me i will accept every job!
manve1 Posted February 22, 2013 Posted February 22, 2013 Mistakes happen Looking for tutorials or information? check out: www.simpleask.co.uk
TheIceman1 Posted February 22, 2013 Author Posted February 22, 2013 I fix it,but still nothing happens Need paid scripter just pm me i will accept every job!
manve1 Posted February 22, 2013 Posted February 22, 2013 you sure exports are correct? and is there any debug error? Looking for tutorials or information? check out: www.simpleask.co.uk
TheIceman1 Posted February 22, 2013 Author Posted February 22, 2013 Yes. No errors. Need paid scripter just pm me i will accept every job!
manve1 Posted February 22, 2013 Posted February 22, 2013 try changing 'player' to 'p' without ' ' Looking for tutorials or information? check out: www.simpleask.co.uk
TheIceman1 Posted February 22, 2013 Author Posted February 22, 2013 Nothing. Need paid scripter just pm me i will accept every job!
manve1 Posted February 22, 2013 Posted February 22, 2013 try this and tell me what output's in the chat: function beachTurf(player) if (getElementData( player, "gang" )) then local playerGang = getElementData( player, "gang" ) if (playerGang) then outputChatBox('executed', player, 255, 255, 255) else outputChatBox('failed',player,255,255,255) end local r, g, b = exports [ "gang_system" ]:getGangColor ( playerGang ) setRadarAreaFlashing ( beachTurfA, true ) exports ["guimessages"] : outputServer ( player, "You entered the turf!" , 255, 0, 0 ) beachturfTimer = setTimer ( function(player) setRadarAreaColor ( beachTurfA, r, g, b, 100 ) exports ["guimessages"] : outputServer ( player, "Congratulations,your gang take this turf!" , 255, 0, 0 ) givePlayerMoney ( player, 2000 ) setRadarAreaFlashing ( beachTurfA, false ) end, 10000, 1 ) end end addEventHandler ( "onColShapeHit", beachTurfC, beachTurf ) Looking for tutorials or information? check out: www.simpleask.co.uk
TheIceman1 Posted February 22, 2013 Author Posted February 22, 2013 I got the message in chat "executed," and I got the message("guimessages") "You entered the turf!" and "You left the turf!",but in debug script says "Bad argument @ setRadarAreaColor [ Expected number at argument 2, got table] Bad argument @ "givePlayerMoney". Need paid scripter just pm me i will accept every job!
manve1 Posted February 22, 2013 Posted February 22, 2013 try unpacking r, g, b or tonumber them Looking for tutorials or information? check out: www.simpleask.co.uk
TheIceman1 Posted February 22, 2013 Author Posted February 22, 2013 I got the message in chat "executed," and I got the message("guimessages") "You entered the turf!" and "You left the turf!",but in debug script says "Bad argument @ setRadarAreaColor [ Expected number at argument 2, got table] Bad argument @ "givePlayerMoney". And it happens only when i left turf. Need paid scripter just pm me i will accept every job!
TheIceman1 Posted February 22, 2013 Author Posted February 22, 2013 function beachTurf(player) if (getElementData( player, "gang" )) then local playerGang = getElementData( player, "gang" ) if (playerGang) then outputChatBox('executed', player, 255, 255, 255) else outputChatBox('failed',player,255,255,255) end local r, g, b = exports [ "gang_system" ]:getGangColor ( playerGang ) setRadarAreaFlashing ( beachTurfA, true ) exports ["guimessages"] : outputServer ( player, "You entered the turf!" , 255, 0, 0 ) beachturfTimer = setTimer ( function(player) setRadarAreaColor ( beachTurfA, tonumber(r), tonumber(g), tonumber(b), 100 ) exports ["guimessages"] : outputServer ( player, "Congratulations,your gang take this turf!" , 255, 0, 0 ) givePlayerMoney ( player, 2000 ) setRadarAreaFlashing ( beachTurfA, false ) end, 10000, 1 ) end end addEventHandler ( "onColShapeHit", beachTurfC, beachTurf ) Nothing happens. Need paid scripter just pm me i will accept every job!
Castillo Posted February 22, 2013 Posted February 22, 2013 getGangColor returns a table, you must unpack it. function beachTurf(player) if (getElementData( player, "gang" )) then local playerGang = getElementData( player, "gang" ) if (playerGang) then outputChatBox('executed', player, 255, 255, 255) else outputChatBox('failed',player,255,255,255) end local r, g, b = unpack ( exports [ "gang_system" ]:getGangColor ( playerGang ) ) setRadarAreaFlashing ( beachTurfA, true ) exports ["guimessages"] : outputServer ( player, "You entered the turf!" , 255, 0, 0 ) beachturfTimer = setTimer ( function(player) setRadarAreaColor ( beachTurfA, tonumber(r), tonumber(g), tonumber(b), 100 ) exports ["guimessages"] : outputServer ( player, "Congratulations,your gang take this turf!" , 255, 0, 0 ) givePlayerMoney ( player, 2000 ) setRadarAreaFlashing ( beachTurfA, false ) end, 10000, 1 ) end end addEventHandler ( "onColShapeHit", beachTurfC, beachTurf ) San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
TheIceman1 Posted February 22, 2013 Author Posted February 22, 2013 Why this dont work?Nothing happens when i enter the turf. function beachTurf(player) if (getElementData( player, "gang" )) then local playerGang = getElementData( player, "gang" ) if (playerGang) then local r, g, b = unpack ( exports [ "gang_system" ]:getGangColor ( playerGang ) ) setRadarAreaFlashing ( beachTurfA, true ) exports ["guimessages"] : outputServer ( player, "You entered the turf!" , 255, 0, 0 ) beachturfTimer = setTimer ( function(player) setRadarAreaColor ( beachTurfA, tonumber(r), tonumber(g), tonumber(b), 100 ) exports ["guimessages"] : outputServer ( player, "Congratulations,your gang take this turf!" , 255, 0, 0 ) givePlayerMoney ( player, 2000 ) setRadarAreaFlashing ( beachTurfA, false ) end, 10000, 1 ) end end end addEventHandler ( "onColShapeHit", beachTurfC, beachTurf ) Need paid scripter just pm me i will accept every job!
Castillo Posted February 22, 2013 Posted February 22, 2013 Do you get any errors? San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
TheIceman1 Posted February 22, 2013 Author Posted February 22, 2013 No Need paid scripter just pm me i will accept every job!
Castillo Posted February 22, 2013 Posted February 22, 2013 function beachTurf ( player ) local playerGang = getElementData ( player, "gang" ) if ( playerGang ) then local r, g, b = unpack ( exports [ "gang_system" ]:getGangColor ( playerGang ) ) setRadarAreaFlashing ( beachTurfA, true ) exports ["guimessages"] : outputServer ( player, "You entered the turf!" , 255, 0, 0 ) beachturfTimer = setTimer ( function ( player ) setRadarAreaColor ( beachTurfA, tonumber(r), tonumber(g), tonumber(b), 100 ) exports ["guimessages"] : outputServer ( player, "Congratulations,your gang take this turf!" , 255, 0, 0 ) givePlayerMoney ( player, 2000 ) setRadarAreaFlashing ( beachTurfA, false ) end ,10000, 1 ) else outputChatBox ( "YOU ARE NOT IN A GANG!" ) end end addEventHandler ( "onColShapeHit", beachTurfC, beachTurf ) Try that and see what it outputs. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
TheIceman1 Posted February 22, 2013 Author Posted February 22, 2013 function beachTurf ( player ) local playerGang = getElementData ( player, "gang" ) if ( playerGang ) then local r, g, b = unpack ( exports [ "gang_system" ]:getGangColor ( playerGang ) ) setRadarAreaFlashing ( beachTurfA, true ) exports ["guimessages"] : outputServer ( player, "You entered the turf!" , 255, 0, 0 ) beachturfTimer = setTimer ( function ( player ) setRadarAreaColor ( beachTurfA, tonumber(r), tonumber(g), tonumber(b), 100 ) exports ["guimessages"] : outputServer ( player, "Congratulations,your gang take this turf!" , 255, 0, 0 ) givePlayerMoney ( player, 2000 ) setRadarAreaFlashing ( beachTurfA, false ) end ,10000, 1 ) else outputChatBox ( "YOU ARE NOT IN A GANG!" ) end end addEventHandler ( "onColShapeHit", beachTurfC, beachTurf ) Try that and see what it outputs. Dont work,no errors. Need paid scripter just pm me i will accept every job!
Castillo Posted February 22, 2013 Posted February 22, 2013 And it doesn't say anything on chat box either? San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
TheIceman1 Posted February 22, 2013 Author Posted February 22, 2013 Doesnt say anything. Need paid scripter just pm me i will accept every job!
TheIceman1 Posted February 22, 2013 Author Posted February 22, 2013 Maybe is the problem here? local beachTurfA = createRadarArea( 352.93, -2025.23, 58, -65, 255, 255, 255, 125 ) local beachTurfC = createColRectangle ( 352.93, -2025.23, 58, -65 ) Need paid scripter just pm me i will accept every job!
Castillo Posted February 22, 2013 Posted February 22, 2013 The problem is on the colshape, you set negative size, that made the colshape to create wrong. local beachTurfA = createRadarArea( 352.93, -2025.23, 58, 65, 255, 255, 255, 125 ) local beachTurfC = createColRectangle ( 352.93, -2025.23, 58, 65 ) function beachTurf ( player ) local playerGang = getElementData ( player, "gang" ) if ( playerGang ) then local r, g, b = unpack ( exports [ "gang_system" ]:getGangColor ( playerGang ) ) setRadarAreaFlashing ( beachTurfA, true ) exports ["guimessages"] : outputServer ( player, "You entered the turf!" , 255, 0, 0 ) beachturfTimer = setTimer ( function ( player ) setRadarAreaColor ( beachTurfA, tonumber(r), tonumber(g), tonumber(b), 100 ) exports ["guimessages"] : outputServer ( player, "Congratulations,your gang take this turf!" , 255, 0, 0 ) givePlayerMoney ( player, 2000 ) setRadarAreaFlashing ( beachTurfA, false ) end ,10000, 1 ) end end addEventHandler ( "onColShapeHit", beachTurfC, beachTurf ) San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
TheIceman1 Posted February 22, 2013 Author Posted February 22, 2013 (edited) The problem is on the colshape, you set negative size, that made the colshape to create wrong. local beachTurfA = createRadarArea( 352.93, -2025.23, 58, 65, 255, 255, 255, 125 ) local beachTurfC = createColRectangle ( 352.93, -2025.23, 58, 65 ) function beachTurf ( player ) local playerGang = getElementData ( player, "gang" ) if ( playerGang ) then local r, g, b = unpack ( exports [ "gang_system" ]:getGangColor ( playerGang ) ) setRadarAreaFlashing ( beachTurfA, true ) exports ["guimessages"] : outputServer ( player, "You entered the turf!" , 255, 0, 0 ) beachturfTimer = setTimer ( function ( player ) setRadarAreaColor ( beachTurfA, tonumber(r), tonumber(g), tonumber(b), 100 ) exports ["guimessages"] : outputServer ( player, "Congratulations,your gang take this turf!" , 255, 0, 0 ) givePlayerMoney ( player, 2000 ) setRadarAreaFlashing ( beachTurfA, false ) end ,10000, 1 ) end end addEventHandler ( "onColShapeHit", beachTurfC, beachTurf ) Working,but I have not got the money.And i have not got message "Congratulations,your gang take this turf!" Debug says: Bad argument @"givePlayerMoney" Edited February 22, 2013 by Guest Need paid scripter just pm me i will accept every job!
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