gghvcffcv Posted March 15, 2014 Share Posted March 15, 2014 Hello guys, i am doing some jobs for my server, but i want to restrict this SWAT Job, for those members that are in a gang, If you can help me Please say me how to do it. Teame = createTeam("SWAT", 0, 0, 100) CT = { [Teame] = true } CV = { [596] = true } function crear() Policia = createPed ( 285, 1288.12341, -1642.04602, 13.54688, 270, true ) createBlip ( 1288.12341, -1642.04602, 13.54688, 30, 2, 0, 0, 255, 255 ) Marcador = createMarker ( 1288.12341, -1642.04602, 12.54688, "cylinder", 1.0, 0, 0, 255, 255 ) end addEventHandler ( "onResourceStart", getRootElement(), crear ) -------------------------------------------------------------- function aceptarr (hitElement) local team = getTeamFromName ( "SWAT" ) if team then setPlayerTeam ( source, team ) setPlayerNametagColor ( source, 0, 0, 100 ) setElementModel (source, 285) giveWeapon ( source, 23, 10000 ) giveWeapon ( source, 3, 1 ) giveWeapon ( source, 31, 500 ) giveWeapon ( source, 34, 200 ) giveWeapon ( source, 41, 5000 ) giveWeapon ( source, 46, 1 ) end end addEvent( "onGreeting", true ) addEventHandler( "onGreeting", root, aceptarr ) -------------------------------------------------------------- function cerrarr (hitElement) end addEvent( "onGreetinA", true ) addEventHandler( "onGreetinA", root, cerrarr ) -------------------------------------------------------------- Link to comment
HerculePoirot Posted March 15, 2014 Share Posted March 15, 2014 I think you should create a table which contains the name of those players in gang. Check whether he is in the gang and give him job if he is. Link to comment
gghvcffcv Posted March 15, 2014 Author Share Posted March 15, 2014 I think you should create a table which contains the name of those players in gang. Check whether he is in the gang and give him job if he is. So how could i do the table? Link to comment
Anubhav Posted March 15, 2014 Share Posted March 15, 2014 local swat = { } Teame = createTeam("SWAT", 0, 0, 100) CT = { [Teame] = true } CV = { [596] = true } function crear() Policia = createPed ( 285, 1288.12341, -1642.04602, 13.54688, 270, true ) createBlip ( 1288.12341, -1642.04602, 13.54688, 30, 2, 0, 0, 255, 255 ) Marcador = createMarker ( 1288.12341, -1642.04602, 12.54688, "cylinder", 1.0, 0, 0, 255, 255 ) end addEventHandler ( "onResourceStart", getRootElement(), crear ) -------------------------------------------------------------- function aceptarr (hitElement) local team = getTeamFromName ( "SWAT" ) if team then setPlayerTeam ( source, team ) setPlayerNametagColor ( source, 0, 0, 100 ) setElementModel (source, 285) giveWeapon ( source, 23, 10000 ) giveWeapon ( source, 3, 1 ) giveWeapon ( source, 31, 500 ) giveWeapon ( source, 34, 200 ) giveWeapon ( source, 41, 5000 ) giveWeapon ( source, 46, 1 ) end end addEvent( "onGreeting", true ) addEventHandler( "onGreeting", root, aceptarr ) -------------------------------------------------------------- function cerrarr (hitElement) end addEvent( "onGreetinA", true ) addEventHandler( "onGreetinA", root, cerrarr ) -------------------------------------------------------------- function invite(command,source,invite) local invite = getPlayerFromName(invite) if not invite then return else table.insert(swat,invite) outputChatBox("You are in a SWAT Team.",invite,0,0,255) outputChatBox("You added"..invite.."in swat team.",source,0,0,255) setElementData(invite,"swat",invite) if getElementData(invite,"swat") then outputChatBox("He's already in SWAT!",source,0,0,255) outputChatBox("If you want to remove him so use /remove PLAYERNAME",source,0,0,255) end end end addCommandHandler("invite",invite) -------------------------------------------------------------- function remove(command,source,remove) local remove = getPlayerFromName(remove) local data = getElementData(remove,"swat") if not data and remove then outputChatBox("The player is not in the SWAT Team!!!",source,0,0,255) return else removeElementData(remove,"swat") outputChatBox("You kicked"..remove.."from SWAT Team!",source,0,0,255) outputChatBox("You have been kicked from SWAT Team!!",remove,0,0,255) table.remove(swat,remove) end end addCommandHandler("remove",remove) -------------------------------------------------------------- Use /remove PlayerName to remove a player from SWAT. Or use /invite PlayerName to add a player to SWAT. Only for SWAT players!! 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