DRW Posted May 16, 2015 Posted May 16, 2015 I'm editing the https://community.multitheftauto.com/index.php?p= ... ls&id=4058 resource so I can use it in my server. It's supposed to check two vehicles' models and then if a player is not in the team "Médicos" then it won't be able to enter, the problem is that it doesn't even allow people from "Médicos" to enter. What's wrong? medicVehicles = { [416]=true } medicVehicles2 = { [563]=true } medicTeam = { [Médicos]=true } function medicenterVehicle ( player, seat, jacked ) if ( medicVehicles[getElementModel ( source )] ) and --Here is the wrong thing ( not medicTeam[getPlayerTeam ( player )] ) and ( seat == 0 ) then cancelEvent() outputChatBox ( "Debes de ser un médico para poder entrar al vehículo.", player ) end end addEventHandler ( "onVehicleStartEnter", getRootElement(), medicenterVehicle ) Proud owner and developer of ZNEXT: Aftermath. Enter a post-apocalyptic San Andreas and fight over 30 types of enemies and bosses with varying difficulties and skills, improve and customize your character by leveling up, completing challenges and a solid lootbox system with no Pay-to-Win mechanics that will break your experience. Meet new characters, creatures and weapon metas, experience an innovative combo-based melee system, or join our solid PvP modes to show other survivors who’s boss. Español, Pусский, Türk, عربى, Polski, Português IP: mtasa://104.36.110.227:22003 - Discord: https://discord.gg/CxMxjvC5pB
WhoAmI Posted May 16, 2015 Posted May 16, 2015 medicVehicles = { [416]=true, [563]=true } medicTeam = { [Médicos]=true } function medicenterVehicle ( player, seat, jacked ) if ( medicVehicles[getElementModel ( source )] and ( not medicTeam[getPlayerTeam ( player )] ) and seat == 0 ) then cancelEvent() outputChatBox ( "Debes de ser un médico para poder entrar al vehículo.", player ) end end addEventHandler ( "onVehicleStartEnter", getRootElement(), medicenterVehicle )
DRW Posted May 16, 2015 Author Posted May 16, 2015 medicVehicles = { [416]=true, [563]=true } medicTeam = { [Médicos]=true } function medicenterVehicle ( player, seat, jacked ) if ( medicVehicles[getElementModel ( source )] and ( not medicTeam[getPlayerTeam ( player )] ) and seat == 0 ) then cancelEvent() outputChatBox ( "Debes de ser un médico para poder entrar al vehículo.", player ) end end addEventHandler ( "onVehicleStartEnter", getRootElement(), medicenterVehicle ) It said ']' expected near ' so i removed the é and now it says table index is nil Proud owner and developer of ZNEXT: Aftermath. Enter a post-apocalyptic San Andreas and fight over 30 types of enemies and bosses with varying difficulties and skills, improve and customize your character by leveling up, completing challenges and a solid lootbox system with no Pay-to-Win mechanics that will break your experience. Meet new characters, creatures and weapon metas, experience an innovative combo-based melee system, or join our solid PvP modes to show other survivors who’s boss. Español, Pусский, Türk, عربى, Polski, Português IP: mtasa://104.36.110.227:22003 - Discord: https://discord.gg/CxMxjvC5pB
xXMADEXx Posted May 16, 2015 Posted May 16, 2015 Try replacing line 2 with this: medicTeam = { ['Médicos']=true } The Ultimate Lua Tutorial! | MTA PHP SDK
DRW Posted May 16, 2015 Author Posted May 16, 2015 Try replacing line 2 with this: medicTeam = { ['Médicos']=true } Still doesn`t allow the team to enter to the vehicle Proud owner and developer of ZNEXT: Aftermath. Enter a post-apocalyptic San Andreas and fight over 30 types of enemies and bosses with varying difficulties and skills, improve and customize your character by leveling up, completing challenges and a solid lootbox system with no Pay-to-Win mechanics that will break your experience. Meet new characters, creatures and weapon metas, experience an innovative combo-based melee system, or join our solid PvP modes to show other survivors who’s boss. Español, Pусский, Türk, عربى, Polski, Português IP: mtasa://104.36.110.227:22003 - Discord: https://discord.gg/CxMxjvC5pB
Mr.unpredictable. Posted May 16, 2015 Posted May 16, 2015 Try replacing line 2 with this: medicTeam = { ['Médicos']=true } Still doesn`t allow the team to enter to the vehicle Post your code
DRW Posted May 16, 2015 Author Posted May 16, 2015 medicVehicles = { [416]=true, [563]=true } medicTeam = { ['Médicos']=true } function medicenterVehicle ( player, seat, jacked ) if ( medicVehicles[getElementModel ( source )] and ( not medicTeam[getPlayerTeam ( player )] ) and seat == 0 ) then cancelEvent() outputChatBox ( "Debes de ser un médico para poder entrar al vehículo.", player ) end end addEventHandler ( "onVehicleStartEnter", getRootElement(), medicenterVehicle ) Proud owner and developer of ZNEXT: Aftermath. Enter a post-apocalyptic San Andreas and fight over 30 types of enemies and bosses with varying difficulties and skills, improve and customize your character by leveling up, completing challenges and a solid lootbox system with no Pay-to-Win mechanics that will break your experience. Meet new characters, creatures and weapon metas, experience an innovative combo-based melee system, or join our solid PvP modes to show other survivors who’s boss. Español, Pусский, Türk, عربى, Polski, Português IP: mtasa://104.36.110.227:22003 - Discord: https://discord.gg/CxMxjvC5pB
ALw7sH Posted May 16, 2015 Posted May 16, 2015 medicVehicles = { [416]=true, [563]=true } medicTeam = { ['Médicos']=true } function medicenterVehicle ( player, seat, jacked ) if ( medicVehicles[getElementModel ( source )] and ( medicTeam[getPlayerTeam ( player )] ) and seat == 0 ) then cancelEvent() outputChatBox ( "Debes de ser un médico para poder entrar al vehículo.", player ) end end addEventHandler ( "onVehicleStartEnter", getRootElement(), medicenterVehicle )
Walid Posted May 16, 2015 Posted May 16, 2015 it should work medicVehicles = {[416]=true, [563]=true } medicTeam = { ['Médicos']=true } function medicenterVehicle ( player, seat, jacked ) local model = getElementModel ( source ) local medic = getTeamName(getPlayerTeam (player)) if ( medicVehicles[model] and ( not medicTeam[medic] ) and seat == 0 ) then cancelEvent() outputChatBox ( "Debes de ser un médico para poder entrar al vehículo.", player,255,0,0) end end addEventHandler ( "onVehicleStartEnter", getRootElement(), medicenterVehicle ) Do not yield your back to your enemy, might feel something strange in your ass. Two things are infinite the universe and human stupidity and i'm not sure about the universe. UF: IsTextInGridList | GetGridListRowIndexFromText | Table.removeValue | removeHex | dxDrawTriangle Skype: SaSuki102 | About Me | Youtube channel | Lua Tips & Tricks | Lua Strings | Lua Tables | Lua Operators
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