DonPro Posted October 7, 2014 Share Posted October 7, 2014 Hey, i have been trying in a while now to get this Moving gate to be working ONLY for the Class spawn. but its a bug, when i spawn as test i see the gate is opening for this spawn to. someone that could help me with it? a51gate1 = createObject ( 3037, 2360.89, -1272.40, 24.89, 0, 0, 0 ) a51col = createColCircle ( 2360.69, -1271.90, 4 ) function opena51gates(thePlayer) if getElementData(source, "class") ~= "Crip" and getElementData(source, "class") ~= "Crip" and getElementData(source, "class") ~= "Crip" then moveObject (a51gate1, 2000, 2360.89, -1280.59, 24.89 ) end end addEventHandler( "onColShapeHit", a51col, opena51gates ) function closea51gates(thePlayer) if getElementData(source, "class") ~= "Crip" and getElementData(source, "class") ~= "Crip" and getElementData(source, "class") ~= "Crip" then moveObject (a51gate1, 2000, 2360.89, -1272.40, 24.89 ) end end addEventHandler( "onColShapeLeave", a51col, closea51gates ) I dont know if im gonna write the name on the skin or only the Class name but this script up here is only for the Skins Link to comment
t3wz Posted October 7, 2014 Share Posted October 7, 2014 In onColShapeHit and onColShapeLeave the source is the colshape, try Use thePlayer: a51gate1 = createObject ( 3037, 2360.89, -1272.40, 24.89, 0, 0, 0 ) a51col = createColCircle ( 2360.69, -1271.90, 4 ) function opena51gates(thePlayer) if getElementData(thePlayer, "class") ~= "Crip" then moveObject (a51gate1, 2000, 2360.89, -1280.59, 24.89 ) end end addEventHandler( "onColShapeHit", a51col, opena51gates ) function closea51gates(thePlayer) if getElementData(thePlayer, "class") ~= "Crip" then moveObject (a51gate1, 2000, 2360.89, -1272.40, 24.89 ) end end addEventHandler( "onColShapeLeave", a51col, closea51gates ) Link to comment
DonPro Posted October 7, 2014 Author Share Posted October 7, 2014 In onColShapeHit and onColShapeLeave the source is the colshape, try Use thePlayer: a51gate1 = createObject ( 3037, 2360.89, -1272.40, 24.89, 0, 0, 0 ) a51col = createColCircle ( 2360.69, -1271.90, 4 ) function opena51gates(thePlayer) if getElementData(thePlayer, "class") ~= "Crip" then moveObject (a51gate1, 2000, 2360.89, -1280.59, 24.89 ) end end addEventHandler( "onColShapeHit", a51col, opena51gates ) function closea51gates(thePlayer) if getElementData(thePlayer, "class") ~= "Crip" then moveObject (a51gate1, 2000, 2360.89, -1272.40, 24.89 ) end end addEventHandler( "onColShapeLeave", a51col, closea51gates ) Hi Thanks both, but its still opens for all. the Spawn list is an .map file is that maby why its does not activate this Moving gate script? Link to comment
t3wz Posted October 7, 2014 Share Posted October 7, 2014 Hi Thanks both, but its still opens for all. the Spawn list is an .map file is that maby why its does not activate this Moving gate script? Try this code, this only open for players with element data "class" = "Crip": a51gate1 = createObject ( 3037, 2360.89, -1272.40, 24.89, 0, 0, 0 ) a51col = createColCircle ( 2360.69, -1271.90, 4 ) function opena51gates(thePlayer) if getElementData(thePlayer, "class") == "Crip" then moveObject (a51gate1, 2000, 2360.89, -1280.59, 24.89 ) end end addEventHandler( "onColShapeHit", a51col, opena51gates ) function closea51gates(thePlayer) if getElementData(thePlayer, "class") == "Crip" then moveObject (a51gate1, 2000, 2360.89, -1272.40, 24.89 ) end end addEventHandler( "onColShapeLeave", a51col, closea51gates ) Link to comment
DonPro Posted October 7, 2014 Author Share Posted October 7, 2014 Hi Thanks both, but its still opens for all. the Spawn list is an .map file is that maby why its does not activate this Moving gate script? Try this code, this only open for players with element data "class" = "Crip": a51gate1 = createObject ( 3037, 2360.89, -1272.40, 24.89, 0, 0, 0 ) a51col = createColCircle ( 2360.69, -1271.90, 4 ) function opena51gates(thePlayer) if getElementData(thePlayer, "class") == "Crip" then moveObject (a51gate1, 2000, 2360.89, -1280.59, 24.89 ) end end addEventHandler( "onColShapeHit", a51col, opena51gates ) function closea51gates(thePlayer) if getElementData(thePlayer, "class") == "Crip" then moveObject (a51gate1, 2000, 2360.89, -1272.40, 24.89 ) end end addEventHandler( "onColShapeLeave", a51col, closea51gates ) Now noone can use it Link to comment
t3wz Posted October 7, 2014 Share Posted October 7, 2014 Now noone can use it This works when I use this code: setElementData ( getPlayerFromName("Duh"), "class", "Crip" ) Link to comment
DonPro Posted October 7, 2014 Author Share Posted October 7, 2014 Now noone can use it This works when I use this code: setElementData ( getPlayerFromName("Duh"), "class", "Crip" ) Do i have to write all members who is allowed to use this when they are spawned as that class? Link to comment
t3wz Posted October 7, 2014 Share Posted October 7, 2014 Now noone can use it This works when I use this code: setElementData ( getPlayerFromName("Duh"), "class", "Crip" ) Do i have to write all members who is allowed to use this when they are spawned as that class? Yes, but Change getPlayerFromName("Duh"). Link to comment
DonPro Posted October 7, 2014 Author Share Posted October 7, 2014 hmm, my plan once is to get the spawn up to class, and when the owner of a Gang/Squad invite a player to the gang he can use the spawn and the gate without that i have to go into the script and put him into there thats why i want this script to work as CLASS 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