Jump to content

Execute Command In Admin-Panel


Z4Zy

Recommended Posts

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 by DeadthStrock
Link to comment
  • Moderators

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

As Patrick said, use runcode for this xD

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

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

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