Jump to content

Write a command in the chat automatically


guix

Recommended Posts

Hello all, I'm a long time player of GTA SA, SA-MP and kind of new to MTA and I want to make scripts :)

I would like to make something similar to Yom's Buttons script for SA-MP, where players can press a button on a wall and it open a door or write a chat command or whatever!

But I have a problem, I can't find how to send MTA command such as "say hello", or "quit". I know it is restricted for "security reasons", but is there any workaround?

Thanks, and happy new year!

Link to comment

Yes but how to do with button on the wall?

I don't want to manually type command or bind a key to the command, I would like with executeCommandHandler, but hardcoded commands are blocked in this function, so I would like a workaround if it's possible!

Link to comment
  • Moderators

lol, I think your question isn't correct, Mta can do everything that samp can. Only sometimes you have to make it your self.

"Yes but how to do with button on the wall?" hmm?

You mean a button to click (3d button) so something happens?

You mean this: https://wiki.multitheftauto.com/wiki/OnClientClick

wikimta onclientclick

This event triggers whenever the user clicks his mouse. This is linked to the GTA world, as oppose to GUI for which onClientGUIClick is to be used. This event allows detection of click positions of the 3D world.

Move object:

https://wiki.multitheftauto.com/wiki/MoveObject

Link to comment
  • Moderators
Not quite! They are buttons (using the keypad object) that players can press using the Enter key, look the images on this topic to understand: http://forum.sa-mp.com/showthread.php?t=74902

OnClientClick or whatever... there is still no solution to execute hardcoded commands such as /quit (which was the original question) right?

Sorry for my bad english if you don't understand me :S

About that keypad thingy, you can use OnClientClick and check the distance from the X,Y,Z from the OnclientClick and the object it self and it should work. That means you click with your mouse on the button.

Or

https://wiki.multitheftauto.com/wiki/OnColShapeHit, to enable a key to activate the keypad. onColShapeLeave to remove the bind.

Next to that you can check the distance from the player and compare that with the keypad so it will only work when you close. At last you can use animation to finish it.

What's wrong with the /quit ? :?

;'''quit''' or '''exit''' :This disconnects you from the server and returns you to the Windows des

What else must happen when you write that? :?:

and no your English isn't bad, but your explanation is.

https://wiki.multitheftauto.com/wiki/AddCommandHandler

Link to comment
About that keypad thingy, you can use OnClientClick and check the distance from the X,Y,Z from the OnclientClick and the object it self and it should work. That means you click with your mouse on the button.

Or

https://wiki.multitheftauto.com/wiki/OnColShapeHit, to enable a key to activate the keypad. onColShapeLeave to remove the bind.

Next to that you can check the distance from the player and compare that with the keypad so it will only work when you close. At last you can use animation to finish it.

What's wrong with the /quit ? :?

;'''quit''' or '''exit''' :This disconnects you from the server and returns you to the Windows des

What else must happen when you write that? :?:

and no your English isn't bad, but your explanation is.

https://wiki.multitheftauto.com/wiki/AddCommandHandler

As said, it's a radical forced command. It forces you to quit the game and I am sure no game developer wants that to happen. Think that I created a nice server and when people join and press "Log in", they'll be quitted from the game. It's stupid and very annoying and that is exactly why it is disabled.

Link to comment

Are you making an admin area and if they enter a wrong PIN, they're bullied into restarting their game? Sheeiiiit. Why not format their entire PCs? But seriously, you should probably just ban them so they can't accidentally join your server again.

addBan 

Link to comment

IIYAMA, most of the script is made already :) I don't need to know how to make buttons (I was just explaining what my goal was), just how to send hardcoded commands!

Are you making an admin area and if they enter a wrong PIN, they're bullied into restarting their game? Sheeiiiit. Why not format their entire PCs? But seriously, you should probably just ban them so they can't accidentally join your server again.

No I just want to make a roleplay server where players have some buttons in their houses or in the map to do handy actions instead of typing boring commands. You seem very arrogant and close-minded.

As said, it's a radical forced command. It forces you to quit the game and I am sure no game developer wants that to happen. Think that I created a nice server and when people join and press "Log in", they'll be quitted from the game. It's stupid and very annoying and that is exactly why it is disabled.

If your goal is to annoy players (this isn't my goal at all, I'm a nice guy) then ok, and there are much more annoying things you can do while you are at it, for example teleport them somewhere random every seconds or flash their screen with huge white rectangles every milliseconds, good for epileptic people... Surely typing "/quit" automatically is more annoying than those allowed things I just described -_-.

Forget it, it isn't possible in MTA, thanks anyway.

Edited by Guest
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...