jirco Posted January 22, 2013 Share Posted January 22, 2013 Hello everybody, i wanted to ask something i just started scripting and i made a script that other teams can't enter but i want that a gui box opens and that the text is in it instead of the outputchatbox but i just don't know how can anybody help me please? and i wanted to ask if this script is correct i didn't tested it yet teamName = "CIA" or "SFPD" or "Military Police" or "U.S. Army" SFPDVehs = { [427] = true } SFPDVehs = { [523] = true } SFPDVehs = { [525] = true } SFPDVehs = { [596] = true } SFPDVehs = { [599] = true } SFPDVehs = { [597] = true } SFPDVehs = { [598] = true } SFPDVehs = { [497] = true } function enterVehicle ( thePlayer ) if SFPDVehs [ getElementModel ( source ) ] then if getTeamFromName ( teamName ) then if getPlayerTeam ( thePlayer ) ~= getTeamFromName ( teamName ) then function exitVehicle ( thePlayer ) and outputChatBox ( "Only the fraktions can drive these cars!", thePlayer, 255, 0, 0, true ) cancelEvent ( ) end else outputChatBox ( "The Team Is not Available !", thePlayer, 255, 255, 0, true ) end end end addEventHandler ( "onVehicleStartEnter", root, enterVehicle ) Link to comment
Castillo Posted January 22, 2013 Share Posted January 22, 2013 That script itself doesn't really make much sense, it has a lot of problems. Such as, how you define "teamName" variable, also the table with vehicle models, you're replacing it each time. Link to comment
Lloyd Logan Posted January 22, 2013 Share Posted January 22, 2013 That script itself doesn't really make much sense, it has a lot of problems.Such as, how you define "teamName" variable, also the table with vehicle models, you're replacing it each time. SFPDVehs = { [427] = true, [523] = true, [525] = true, [596] = true, [599] = true, [597] = true, [598] = true, [497] = true} Should it be that Castillo, if i am not wrong? Edit: Also, I am not too sure, but this may help?? viewtopic.php?f=91&t=53083 Link to comment
Lloyd Logan Posted January 22, 2013 Share Posted January 22, 2013 Would it be possible to when the player is denied access to the Veh, a GUI is triggered? Link to comment
Castillo Posted January 22, 2013 Share Posted January 22, 2013 Yes, of course. He would need to use: triggerClientEvent addEvent addEventHandler guiSetVisible Link to comment
Lloyd Logan Posted January 22, 2013 Share Posted January 22, 2013 Yes, of course.He would need to use: triggerClientEvent addEvent addEventHandler guiSetVisible That's exactly what I mean, hope he understands that... So if he were to trigger the onVehicleStartEnter , would that work? Link to comment
Castillo Posted January 22, 2013 Share Posted January 22, 2013 The event he's using is right. Link to comment
Lloyd Logan Posted January 22, 2013 Share Posted January 22, 2013 Hello everybody,i wanted to ask something i just started scripting and i made a script that other teams can't enter but i want that a gui box opens and that the text is in it instead of the outputchatbox but i just don't know how can anybody help me please? and i wanted to ask if this script is correct i didn't tested it yet teamName = "CIA" or "SFPD" or "Military Police" or "U.S. Army" SFPDVehs = { [427] = true } SFPDVehs = { [523] = true } SFPDVehs = { [525] = true } SFPDVehs = { [596] = true } SFPDVehs = { [599] = true } SFPDVehs = { [597] = true } SFPDVehs = { [598] = true } SFPDVehs = { [497] = true } function enterVehicle ( thePlayer ) if SFPDVehs [ getElementModel ( source ) ] then if getTeamFromName ( teamName ) then if getPlayerTeam ( thePlayer ) ~= getTeamFromName ( teamName ) then function exitVehicle ( thePlayer ) and outputChatBox ( "Only the fraktions can drive these cars!", thePlayer, 255, 0, 0, true ) cancelEvent ( ) end else outputChatBox ( "The Team Is not Available !", thePlayer, 255, 255, 0, true ) end end end addEventHandler ( "onVehicleStartEnter", root, enterVehicle ) Anyways, I'd be glad to help you with this! Link to comment
jirco Posted January 23, 2013 Author Share Posted January 23, 2013 like i said i just started so there could be mistakes and thanks for the help! and indeed i copied the script from the link and changed it to how i wanted it i was just stuck with the Gui box Link to comment
Lloyd Logan Posted January 23, 2013 Share Posted January 23, 2013 like i said i just started so there could be mistakes and thanks for the help!and indeed i copied the script from the link and changed it to how i wanted it i was just stuck with the Gui box Do you still need help? Link to comment
jirco Posted January 31, 2013 Author Share Posted January 31, 2013 yes it would be helpfull Link to comment
Lloyd Logan Posted January 31, 2013 Share Posted January 31, 2013 yes it would be helpfull It's been a while, what do you need help with? My Skype is lloydlogan11 I you need any further help. 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