spoty Posted April 23, 2014 Share Posted April 23, 2014 (edited) hi there i downloaded a area51 protection script and it was first like it shoot rocket on players without army skin and now i have edited it to it only shoots on players that arent in army acl but i dont have any error and it dont shoot and it is running ingame and i realy dont know what i did wrong here is the script g_base_col = createColCuboid ( 97.3376, 1800.0384, -32.0937, 250, 280, 120 ) createBlip ( 193.248, 1890.01, 17.234, 47 ) g_root = getRootElement () --rocketOne = createMarker ( -2931.5136, 454.4492, 17.3671, "corona", 1.5, 255, 0, 0, 150 ) --test marker --rocketTwo = createMarker ( -2931.5932, 487.1994, 17.3671, "corona", 1.5, 255, 0, 0, 150 ) --test marker function hit ( acc, dim ) if getElementType ( acc ) == "account" then local vehicle = getaccountOccupiedVehicle ( acc ) if vehicle or not vehicle then if isObjectInACLGroup("user."..getAccountName(getaccountname(source)), aclGetGroup("Army")) then outputChatBox ( "Welcome Sir, "..getAccountName(acc).."!", acc, 0, 150, 0 ) else setElementData ( acc, "inRestrictedArea", "true" ) triggerClientEvent ( acc, "destroyTrepassor", g_root, acc ) outputChatBox ( "***Restricted Area***", acc, 255, 0, 0 ) outputChatBox ( "* "..getAccountName(acc).." has entered Restricted Area!", g_root, 255, 0, 0 ) end end end end addEventHandler ( "onColShapeHit", g_base_col, hit ) function leave ( acc, dim ) if getElementType ( acc ) == "account" then local vehicle = getaccountOccupiedVehicle ( acc ) if vehicle or not vehicle then if isObjectInACLGroup("user."..getAccountName(getaccountname(source)), aclGetGroup("Army")) then outputChatBox ( "Good Bye Sir!", acc, 0, 100, 0 ) else setElementData ( acc, "inRestrictedArea", "false" ) triggerClientEvent ( acc, "destroyTimers", g_root, acc ) outputDebugString ( "*"..getAccountName(acc).." has left col shape" ) end end end end addEventHandler ( "onColShapeLeave", g_base_col, leave ) Edited April 23, 2014 by Guest Link to comment
xXMADEXx Posted April 23, 2014 Share Posted April 23, 2014 Ready debugscript 3 and tell us the error. Link to comment
spoty Posted April 23, 2014 Author Share Posted April 23, 2014 its says this WARNING: 1\area51\ad_base_c:44: Bad argument @ 'killtimer' [Expected lua-timer at argument 1,got nil] WARNING: 1\area51\ad_base_c:45: Bad argument @ 'killtimer' [Expected lua-timer at argument 1,got nil] WARNING: 1\area51\ad_base_c:46: Bad argument @ 'killtimer' [Expected lua-timer at argument 1,got nil] WARNING: 1\area51\ad_base_c:47: Bad argument @ 'killtimer' [Expected lua-timer at argument 1,got nil] here is the client part g_loc_pla = getLocalPlayer () g_loc_root = getRootElement () addEvent ( "destroyTrepassor", true ) addEventHandler ( "destroyTrepassor", g_loc_root, function () posX = 15.7054 posY = 1719.3632 posZ = 50.123 posX2 = 237.7176 posY2 = 1696.5727 posZ2 = 50.1087 posX3 = 354.6243 posY3 = 2028.3897 posZ3 = 50.1217 posX4 = 188.241 posY4 = 2081.3469 posZ4 = 50.1422 local isInResArea = getElementData ( g_loc_pla, "inRestrictedArea" ) rotZ = getPedRotation ( g_loc_pla ) if isInResArea == "true" then timer1 = setTimer ( createProjectile, 2000, 0, g_loc_pla, 20, posX, posY, posZ, 1.0, g_loc_pla, 0, 0, rotZ, 0.1, 0.1, 0.1 ) timer2 = setTimer ( createProjectile, 2000, 0, g_loc_pla, 20, posX2, posY2, posZ2, 1.0, g_loc_pla, 0, 0, rotZ, 0.1, 0.1, 0.1 ) timer3 = setTimer ( createProjectile, 2000, 0, g_loc_pla, 20, posX3, posY3, posZ3, 1.0, g_loc_pla, 0, 0, rotZ, 0.1, 0.1, 0.1 ) timer4 = setTimer ( createProjectile, 2000, 0, g_loc_pla, 20, posX4, posY4, posZ4, 1.0, g_loc_pla, 0, 0, rotZ, 0.1, 0.1, 0.1 ) end end ) addEvent ( "destroyTimers", true ) addEventHandler ( "destroyTimers", g_loc_root, function () local isInResArea = getElementData ( g_loc_pla, "inRestrictedArea" ) if isInResArea == "false" then killTimer ( timer1 ) killTimer ( timer2 ) killTimer ( timer3 ) killTimer ( timer4 ) end end ) Link to comment
xXMADEXx Posted April 23, 2014 Share Posted April 23, 2014 Try this ((not tested)): g_loc_pla = getLocalPlayer () g_loc_root = getRootElement () addEvent ( "destroyTrepassor", true ) addEventHandler ( "destroyTrepassor", g_loc_root, function () posX = 15.7054 posY = 1719.3632 posZ = 50.123 posX2 = 237.7176 posY2 = 1696.5727 posZ2 = 50.1087 posX3 = 354.6243 posY3 = 2028.3897 posZ3 = 50.1217 posX4 = 188.241 posY4 = 2081.3469 posZ4 = 50.1422 local isInResArea = getElementData ( g_loc_pla, "inRestrictedArea" ) rotZ = getPedRotation ( g_loc_pla ) if isInResArea == "true" then timer1 = setTimer ( createProjectile, 2000, 0, g_loc_pla, 20, posX, posY, posZ, 1.0, g_loc_pla, 0, 0, rotZ, 0.1, 0.1, 0.1 ) timer2 = setTimer ( createProjectile, 2000, 0, g_loc_pla, 20, posX2, posY2, posZ2, 1.0, g_loc_pla, 0, 0, rotZ, 0.1, 0.1, 0.1 ) timer3 = setTimer ( createProjectile, 2000, 0, g_loc_pla, 20, posX3, posY3, posZ3, 1.0, g_loc_pla, 0, 0, rotZ, 0.1, 0.1, 0.1 ) timer4 = setTimer ( createProjectile, 2000, 0, g_loc_pla, 20, posX4, posY4, posZ4, 1.0, g_loc_pla, 0, 0, rotZ, 0.1, 0.1, 0.1 ) end end ) addEvent ( "destroyTimers", true ) addEventHandler ( "destroyTimers", g_loc_root, function () local isInResArea = getElementData ( g_loc_pla, "inRestrictedArea" ) if isInResArea == "false" then if ( isTimer ( timer1 ) ) then killTimer ( timer1 ) end if ( isTimer ( timer2 ) ) then killTimer ( timer2 ) end if ( isTimer ( timer3 ) ) then killTimer ( timer3 ) end if ( isTimer ( timer4 ) ) then killTimer ( timer4 ) end end end ) Link to comment
spoty Posted April 23, 2014 Author Share Posted April 23, 2014 no errors and its running but it dont shoot or even warn me if i get in area 51 and i am not in army acl Link to comment
spoty Posted April 23, 2014 Author Share Posted April 23, 2014 anyone can help me? script works fine but it wont fire the rockets i run /debugscript 3 and i dont have any kinda error Link to comment
MrMADRYAN Posted May 30, 2014 Share Posted May 30, 2014 Could you please give a link to the original script? Link to comment
xXMADEXx Posted May 30, 2014 Share Posted May 30, 2014 Could you please give a link to the original script? Is it really that hard to search the community? https://community.multitheftauto.com/index.php?p=resources 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