opnaiC Posted May 7, 2016 Share Posted May 7, 2016 Hello, I am trying to setup the fraction "LSPD". But I dont know how to do a level system in the team. Also I dont know how to save the "LSPD" team members, because after restart or reconnect the arent in the team! Example: 1 - Cadet 2 - ..... 3 - ... 5 - Chief I am not asking you to give me the hole code, just how I can setup something like this ... Hope you can help me )) Link to comment
ViRuZGamiing Posted May 7, 2016 Share Posted May 7, 2016 You could work for example with createTeam or make our own team system. Then the best way to store the members are SQL or XML (I suggest SQL). Regards Viruz Link to comment
opnaiC Posted May 7, 2016 Author Share Posted May 7, 2016 You could work for example with createTeam or make our own team system. Then the best way to store the members are SQL or XML (I suggest SQL). Regards Viruz setTeamFriendlyFire(teampolice, false) teampolice = createTeam ( "LSPD", 0, 0, 255 ) --police skins and cars policeVehicles = { [601]=true,[427]=true,[551]=true,[596]=true, [523]=true, [497]=true } policeSkins = { [266]=true,[267]=true,[280]=true,[281]=true,[284]=true,[285]=true } function policeenterVehicle ( player, seat, jacked ) --when a player enters a vehicle if ( policeVehicles[getElementModel ( source )] ) and ( not policeSkins[getElementModel ( player )] ) and ( seat == 0 ) then --if no police skins removePedFromVehicle ( player )--force the player out of the vehicle outputChatBox ( "Вы не сотрудник LSPD!", player ) --and tell the player why end end addEventHandler ( "onVehicleEnter", getRootElement(), policeenterVehicle ) LSPDgateMoving = false LSPDgateMoved = false LSPDGate1 = createObject ( 971, 1589.0352783203, -1638.1243896484, 15.08652305603, 0, 0, 180 ) LSPDGate2 = createObject ( 2930, 1582.5673828125, -1637.8597412109, 15.019668579102, 0, 0, 90 ) function mv_func ( player ) local team = getPlayerTeam(player) if (getTeamName(team)== "LSPD") then if getDistanceBetweenPoints3D ( 1589.0352783203, -1638.1243896484, 15.08652305603, getElementPosition ( player ) ) < 17 then if LSPDgateMoved == false then moveObject ( LSPDGate1, 3000, 1597.0734863281, -1638.0965576172, 15.08652305603 ) moveObject ( LSPDGate2, 1500, 1580.8779296875, -1637.8725585938, 15.019668579102 ) LSPDgateMoved = true else moveObject ( LSPDGate1, 3000, 1589.0352783203, -1638.0965576172, 15.08652305603 ) moveObject ( LSPDGate2, 1500, 1582.5673828125, -1637.8597412109, 15.019668579102 ) LSPDgateMoved = false end end end end addCommandHandler ( "gate", mv_func ) This is what I have at the moment. Can you help me or anybody else in setting up a rank system in the team. Example: chief = { [266]=true } Also I dont know how to store the ranks and teams in a xml file (( Link to comment
ViRuZGamiing Posted May 7, 2016 Share Posted May 7, 2016 Take a look at the Scripting Functions on the bottom of the page and practice those in simpele examples first. https://wiki.multitheftauto.com/wiki/Xml Also if you work with an account system you could use setAccountData Link to comment
opnaiC Posted May 7, 2016 Author Share Posted May 7, 2016 Take a look at the Scripting Functions on the bottom of the page and practice those in simpele examples first.https://wiki.multitheftauto.com/wiki/Xml Also if you work with an account system you could use setAccountData naaahhh Is there any other way to save teams ? Any fast way ? Link to comment
Anubhav Posted May 7, 2016 Share Posted May 7, 2016 https://community.multitheftauto.com/in ... s&id=13002 Create it fast and quick. As long as that resource is running, your team will be saved. Not advertising but I think that's the only way left for you. Link to comment
ViRuZGamiing Posted May 7, 2016 Share Posted May 7, 2016 https://community.multitheftauto.com/index.php?p=resources&s=details&id=13002Create it fast and quick. As long as that resource is running, your team will be saved. Not advertising but I think that's the only way left for you. If he doesn't feel like learning than that's probably the best (and only) option. Link to comment
opnaiC Posted May 7, 2016 Author Share Posted May 7, 2016 I found a resource that will save team members: https://community.multitheftauto.com/in ... ls&id=6678 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