Jump to content

help with teamcars


jirco

Recommended Posts

Posted

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 ) 

excla.png
Posted

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.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted
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

If you need an Intermediate scripter feel free to PM me as I will accept "almost" any job, STATUS: UNAVAILABLE

SCOTLAND, my hometown, and the Home of GTA!

Posted

Yes, that's right.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

Would it be possible to when the player is denied access to the Veh, a GUI is triggered?

If you need an Intermediate scripter feel free to PM me as I will accept "almost" any job, STATUS: UNAVAILABLE

SCOTLAND, my hometown, and the Home of GTA!

Posted

Yes, of course.

He would need to use:

triggerClientEvent 
addEvent 
addEventHandler 
guiSetVisible 

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted
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?

If you need an Intermediate scripter feel free to PM me as I will accept "almost" any job, STATUS: UNAVAILABLE

SCOTLAND, my hometown, and the Home of GTA!

Posted

The event he's using is right.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted
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!

If you need an Intermediate scripter feel free to PM me as I will accept "almost" any job, STATUS: UNAVAILABLE

SCOTLAND, my hometown, and the Home of GTA!

Posted

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 :)

excla.png
Posted
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?

If you need an Intermediate scripter feel free to PM me as I will accept "almost" any job, STATUS: UNAVAILABLE

SCOTLAND, my hometown, and the Home of GTA!

Posted
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.

If you need an Intermediate scripter feel free to PM me as I will accept "almost" any job, STATUS: UNAVAILABLE

SCOTLAND, my hometown, and the Home of GTA!

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...