Z4Zy Posted June 21, 2018 Share Posted June 21, 2018 (edited) Hellow Friends ! I think you've heard / experienced / saw an execute command field with the text "For Advanced Users Only" , that we can see inside the resource tab of admin-panel As far as I know, we can insert commands, for example, outputChatBox("Hellow Mates!",root,255,255,0) and hit the server button will output text to everyone. Okay..!!?? setElementHealth(source,100) killPed(source) setDevelopmentMode(true) ,are some examples that can be executed using admin-panel's execute field. But I have a problem. How did I execute a code like bellow, using above admin-panel's execute field ?? Is it possible ?? local vehicle = getPedOccupiedVehicle(localPlayer) setElementVelocity(vehicle,0,0,5) and what occasions did you using this execute command field ?? Edited June 21, 2018 by DeadthStrock Link to comment
Moderators Patrick Posted June 21, 2018 Moderators Share Posted June 21, 2018 Check the 'runcode' resource. (default MTA resource, like admin-panel) You can use this resource to run scripts with commands. - Server side script: /srun <script> - Client side script: /crun <script> (You need to use one-line script. example: /crun x,y,z = getElementPosition(localPlayer) setElementPosition(localPlayer, x,y,z+5)) Link to comment
_Evo_ Posted June 22, 2018 Share Posted June 22, 2018 As Patrick said, use runcode for this setElementVelocity(getPedOccupiedVehicle(localPlayer),0,0,5) can be /srun setElementVelocity(getPedOccupiedVehicle(localPlayer),0,0,5) or /crun setElementVelocity(getPedOccupiedVehicle(localPlayer),0,0,5) Link to comment
Discord Moderators Pirulax Posted June 22, 2018 Discord Moderators Share Posted June 22, 2018 You dont need to take out the local variable(but its recommended, because of clearness of the code) Since the interpreter doesnt care if everything is in one line, you could just write in: local vehicle = getPedOccupiedVehicle(localPlayer);setElementVelocity(vehicle, 0, 0, 5) local vehicle = getPedOccupiedVehicle(localPlayer) setElementVelocity(vehicle, 0, 0, 5) Or maybe this(im not sure about this one, but try it): local vehicle = getPedOccupiedVehicle(localPlayer)setElementVelocity(vehicle, 0, 0, 5) But the best is what _Evo_ wrote: Quote setElementVelocity(getPedOccupiedVehicle(localPlayer),0,0,5) 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