ramzi Posted December 22, 2014 Posted December 22, 2014 guys i edited this script,it is (area51 protection)script,it was for skin 287 and i made it for team,but i had this problem! this is the error msg: [2014-12-22 18:13:30] WARNING: mil_protection\ad_base_s.lua:14: Bad argument @ 'getPlayerTeam' [Expected player at argument 1, got nil] [2014-12-22 18:13:30] WARNING: mil_protection\ad_base_s.lua:14: Bad argument @ 'getTeamName' [Expected team at argument 1, got boolean] and here is the code: 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 ( pla, dim ) if getElementType ( pla ) == "player" then local vehicle = getPedOccupiedVehicle ( pla ) if vehicle or not vehicle then local className = "Delta Force" if ( getTeamName(getPlayerTeam(thePlayer)) == "Delta Force" ) then outputChatBox ( "Welcome, "..getPlayertName(pla).."!", pla, 0, 150, 0 ) else setElementData ( pla, "inRestrictedArea", "true" ) triggerClientEvent ( pla, "destroyTrepassor", g_root, pla ) outputChatBox ( "***Restricted Area***", pla, 255, 0, 0 ) outputChatBox ( "* "..getPlayerName(pla).." has entered Restricted Area!", g_root, 255, 0, 0 ) end end end end addEventHandler ( "onColShapeHit", g_base_col, hit ) function leave ( pla, dim ) if getElementType ( pla ) == "player" then local vehicle = getPedOccupiedVehicle ( pla ) if vehicle or not vehicle then local className = "Delta Force" if ( getTeamName(getPlayerTeam(thePlayer)) == "Delta Force" ) then outputChatBox ( "Good Bye!", pla, 0, 100, 0 ) else setElementData ( pla, "inRestrictedArea", "false" ) triggerClientEvent ( pla, "destroyTimers", g_root, pla ) outputDebugString ( "*"..getPlayerName(pla).." has left col shape" ) end end end end addEventHandler ( "onColShapeLeave", g_base_col, leave ) DZ Army Base: https://community.multitheftauto.com/index.php?p=resources&s=details&id=11101 Flyingcars script: https://community.multitheftauto.com/index.php?p=resources&s=details&id=11116
AJXB Posted December 22, 2014 Posted December 22, 2014 if ( getTeamName(getPlayerTeam(thePlayer)) == "Delta Force" ) then replace it with if ( getTeamName(getPlayerTeam(pla)) == "Delta Force" ) then Your player var is "pla" not thePlayer, that's it. On line 32 aswell. ~ This has to be the worst board post I have ever read. It simply makes no sense. You start off by talking about space or something, then you randomly start babbling about cupcakes, and you end off with random fish names. ~ Don't listen to this guy, any board with the categories 'dinosaurs, spaceships, fried foods, wild animals, alien abductions, business casual, robots, and fireworks' has true potential.
ramzi Posted December 23, 2014 Author Posted December 23, 2014 well it worked fine thnx so much,but i still have a little problem with this error: ERROR: mil_protection\ad_base_s.lua:15: attempt to call global 'getPlayertName' (a nil value),chatbox doesnt appear. DZ Army Base: https://community.multitheftauto.com/index.php?p=resources&s=details&id=11101 Flyingcars script: https://community.multitheftauto.com/index.php?p=resources&s=details&id=11116
LaCosTa Posted December 23, 2014 Posted December 23, 2014 change this outputChatBox ( "Welcome, "..getPlayertName(pla).."!", pla, 0, 150, 0 ) to this outputChatBox ( "Welcome, "..getPlayerName(pla).."!", pla, 0, 150, 0 )
ramzi Posted December 23, 2014 Author Posted December 23, 2014 well it worked fine thnx so much,but i still have a little problem with this error:ERROR: mil_protection\ad_base_s.lua:15: attempt to call global 'getPlayertName' (a nil value),chatbox doesnt appear. oh,i fixed it,i just changed getPlayerName with get ClientName DZ Army Base: https://community.multitheftauto.com/index.php?p=resources&s=details&id=11101 Flyingcars script: https://community.multitheftauto.com/index.php?p=resources&s=details&id=11116
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