orcun99 Posted June 20, 2014 Posted June 20, 2014 vehicle1 = createVehicle(487, 2798, 2548.900390625, 22.700000762939, 0, 0, 43.994750976563) -- This car can be toggleVehicleRespawn ( vehicle1 , true ) setVehicleRespawnDelay ( vehicle1 , 10000) -- Araç patladıktan kaç saniye sonra respawnlanacağını belirtir. setVehicleIdleRespawnDelay ( vehicle1 , 60000) -- vehicle = createVehicle ( modelID, x, y, z, rotX, rotY, rotZ ) state = setVehicleDoorState ( vehicle, 1, 1 ) setVehicleDamageProof ( vehicle, true ) -----car won't take damage (change it to false if you want to take damage) function lockPrivate( player, seat, jacked ) if ( source == vehicle1 ) then if ( seat ~= 0 ) then -- If the seat isn't '0' ( driver's seat ) return -- Stop the function from executing. end local playerTeam = getPlayerTeam ( player ) local oldTeamName = ( playerTeam and getTeamName ( playerTeam ) or "" ) if ( oldTeamName ~= "Admins" ) then cancelEvent ( ) exports.ORCcommands:sendMessage("Buna Binmen İçin Admin Olman Gerek.", GetLocalPlayer, 255, 190, 0, source) else exports.ORCcommands:sendMessage("Tekrar Hoşgeldin Admin Bey.", GetLocalPlayer, 255, 190, 0, source) end end end addEventHandler ( "onVehicleStartEnter", getRootElement(), lockPrivate, GetLocalPlayer ) send a message to all players at the person who is sending it just got in the car How do I set? exports.ORCcommands:sendMessage("Buna Binmen İçin Admin Olman Gerek.", GetLocalPlayer, 255, 190, 0, source) I am english very bad Post only want to get into the car to go to the people message goes to all players now
xXMADEXx Posted June 21, 2014 Posted June 21, 2014 GetLocalPlayer isn't a globally defined variable by MTA. Not only that, but the localPlayer (also getLocalPlayer() ) which I assume is what you're trying to do is only for the client side.
Max+ Posted June 21, 2014 Posted June 21, 2014 Try This , vehicle1 = createVehicle(487, 2798, 2548.900390625, 22.700000762939, 0, 0, 43.994750976563) -- This car can be toggleVehicleRespawn ( vehicle1 , true ) setVehicleRespawnDelay ( vehicle1 , 10000) -- Araç patladıktan kaç saniye sonra respawnlanacağını belirtir. setVehicleIdleRespawnDelay ( vehicle1 , 60000) -- state = setVehicleDoorState ( vehicle1, 1, 1 ) setVehicleDamageProof ( vehicle1, true ) -----car won't take damage (change it to false if you want to take damage) function lockPrivate( seat ) if isPedInVehicle (source, vehicle1 ) and ( seat ~= 0 ) and getPlayerTeam(getTeamName( source ) == 'Admins' ) then cancelEvent ( ) exports.ORCcommands:sendMessage("Buna Binmen İçin Admin Olman Gerek.", source, 255, 190, 0) else exports.ORCcommands:sendMessage("Tekrar Hoşgeldin Admin Bey.", source, 255, 190, 0) end end addEventHandler ( "onVehicleStartEnter", getRootElement(), lockPrivate) Make sure it's ServerSide , on meta.xml
orcun99 Posted June 21, 2014 Author Posted June 21, 2014 warning line 9 bad "ped" pointer @ "ispedinvehicle" <1> means everyone can ride and articles still everyone is going to
justn Posted June 21, 2014 Posted June 21, 2014 (edited) Here you go vehicle1 = createVehicle(487, 2798, 2548.900390625, 22.700000762939, 0, 0, 43.994750976563) -- This car can be toggleVehicleRespawn ( vehicle1 , true ) setVehicleRespawnDelay ( vehicle1 , 10000) -- Araç patladıktan kaç saniye sonra respawnlanacağını belirtir. setVehicleIdleRespawnDelay ( vehicle1 , 60000) -- state = setVehicleDoorState ( vehicle1, 1, 1 ) setVehicleDamageProof ( vehicle1, true ) -----car won't take damage (change it to false if you want to take damage) function lockPrivate( player, seat ) if ( source == vehicle1 ) then if ( seat ~= 0 ) and ( getTeamName(getPlayerTeam( player )) == 'Admins' ) then exports.ORCcommands:sendMessage("Buna Binmen İçin Admin Olman Gerek.", player, 255, 190, 0) else exports.ORCcommands:sendMessage("Tekrar Hoşgeldin Admin Bey.", player, 255, 190, 0) cancelEvent ( ) end end end addEventHandler ( "onVehicleStartEnter", getRootElement(), lockPrivate) Edited June 21, 2014 by Guest
justn Posted June 21, 2014 Posted June 21, 2014 Vehicle does not what ? //EDIT: I just edited my code, try that
orcun99 Posted June 21, 2014 Author Posted June 21, 2014 I tried your code I did not specify the coordinates vehicle
orcun99 Posted June 21, 2014 Author Posted June 21, 2014 Even though I'm on the team now, admins can not ride vehicles
justn Posted June 21, 2014 Posted June 21, 2014 This should work. vehicle1 = createVehicle(487, 2798, 2548.900390625, 22.700000762939, 0, 0, 43.994750976563) -- This car can be toggleVehicleRespawn ( vehicle1 , true ) setVehicleRespawnDelay ( vehicle1 , 10000) -- Araç patladıktan kaç saniye sonra respawnlanacağını belirtir. setVehicleIdleRespawnDelay ( vehicle1 , 60000) -- state = setVehicleDoorState ( vehicle1, 1, 1 ) setVehicleDamageProof ( vehicle1, true ) -----car won't take damage (change it to false if you want to take damage) function lockPrivate( player, seat ) if ( source == vehicle1 ) then if ( seat == 0 ) or ( seat == 1 ) or ( seat == 2 ) or ( seat == 3 ) or ( seat == 4 ) then if ( getTeamName(getPlayerTeam( player )) == 'Admins' ) then outputChatBox("Tekrar Hoşgeldin Admin Bey.", player, 255, 190, 0) else outputChatBox("Buna Binmen İçin Admin Olman Gerek.", player, 255, 190, 0) cancelEvent ( ) end end end end addEventHandler ( "onVehicleStartEnter", getRootElement(), lockPrivate)
orcun99 Posted June 21, 2014 Author Posted June 21, 2014 I can do it I'm trying to "exports. commands: SendMessage" want to do this using the command
justn Posted June 21, 2014 Posted June 21, 2014 Just replace outputChatBox with exports.ORCcommands:sendMessage
orcun99 Posted June 21, 2014 Author Posted June 21, 2014 I "orccommand" I want the message to be sent I have given in the code base, but as in most of the top players going to give you all that I write in code I use google transtle
orcun99 Posted June 21, 2014 Author Posted June 21, 2014 I am not understand my server gamemode is : rpg
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