SA-MP Forums

Go Back   SA-MP Forums > SA-MP > General

Reply
 
Thread Tools Display Modes
Old 19/02/2018, 07:55 PM   #1
george3002
Little Clucker
 
Join Date: Dec 2014
Posts: 5
Reputation: 0
Question Command Binding

I am On a server And I want to setup a command binding Because While typing I give my enemies time to kill me while typing.

I want when I press a button to run:
Quote:
/(command) (Nearest ID)
But I don't Know how to do it
Does someone know how to make my client Auto type a command And the nearest player ID


More specific I want the command to be
Quote:
/taze (Nearest Player ID)
and another One to be
Quote:
/cuff (Nearest Player ID)
george3002 is offline   Reply With Quote
Old 19/02/2018, 09:07 PM   #2
NaS
High-roller
 
NaS's Avatar
 
Join Date: Mar 2008
Posts: 1,584
Reputation: 466
Default Re: Command Binding

Finding out the nearest player id would require a hack or at least memory hacking, so do not expect help on that here.

You can however create regular key binds, like "/cuff " and type the ID yourself. Making it type the nearest ID would be the kind of macro you should be banned for in my opinion.
NaS is online now   Reply With Quote
Old 19/02/2018, 09:38 PM   #3
DannyW
Little Clucker
 
Join Date: Nov 2012
Posts: 28
Reputation: 13
Default Re: Command Binding

Make a loop that runs /cuff 1-500 lul
DannyW is offline   Reply With Quote
Old 20/02/2018, 10:37 AM   #4
george3002
Little Clucker
 
Join Date: Dec 2014
Posts: 5
Reputation: 0
Default Re: Command Binding

Quote:
Originally Posted by DannyW View Post
Make a loop that runs /cuff 1-500 lul
Can you tell me how to do that
george3002 is offline   Reply With Quote
Old 20/02/2018, 10:39 AM   #5
iKarim
Gangsta
 
iKarim's Avatar
 
Join Date: Oct 2015
Posts: 585
Reputation: 139
Default Re: Command Binding

Quote:
Originally Posted by DannyW View Post
Make a loop that runs /cuff 1-500 lul
You do realize that will send 500 commands in a short amount of time that's enough to get him banned for flooding?

Last edited by iKarim; 21/02/2018 at 09:55 AM.
iKarim is offline   Reply With Quote
Old 20/02/2018, 12:02 PM   #6
george3002
Little Clucker
 
Join Date: Dec 2014
Posts: 5
Reputation: 0
Default Re: Command Binding

I know how to make a keybind via a software but i want that nearest ID

Also I don't have coding knowledge
george3002 is offline   Reply With Quote
Old 20/02/2018, 12:28 PM   #7
Zeth
Gangsta
 
Zeth's Avatar
 
Join Date: Feb 2017
Location: Titan
Posts: 503
Reputation: 114
Default Re: Command Binding

Quote:
Originally Posted by george3002 View Post
I know how to make a keybind via a software but i want that nearest ID

Also I don't have coding knowledge
Although this is possible server-sided but there's no chance for client sided because, as mentioned by NaS, this would certainly require some memory hacking and some server sided codes.
__________________
server.one-rp.com
Zeth is offline   Reply With Quote
Old 20/02/2018, 02:52 PM   #8
iLearner
Gangsta
 
iLearner's Avatar
 
Join Date: Apr 2017
Posts: 650
Reputation: 133
Default Re: Command Binding

I don't see how is that hard, you can use one of keys provided by SA:MP as hotkey (Y, N, H and so on) and then send the cmd_COMMAND_NAME_HERE(playerid, GetNearestPlayerID(playerid));

Note: GetNearestPlayerID will most likely return an integer while zcmd requires second param to be string so you'll have to format the integer into a string and pass to the cmd.
iLearner is offline   Reply With Quote
Old 20/02/2018, 03:52 PM   #9
NaS
High-roller
 
NaS's Avatar
 
Join Date: Mar 2008
Posts: 1,584
Reputation: 466
Default Re: Command Binding

Quote:
Originally Posted by iLearner View Post
I don't see how is that hard, you can use one of keys provided by SA:MP as hotkey (Y, N, H and so on) and then send the cmd_COMMAND_NAME_HERE(playerid, GetNearestPlayerID(playerid));

Note: GetNearestPlayerID will most likely return an integer while zcmd requires second param to be string so you'll have to format the integer into a string and pass to the cmd.
I doubt he is talking about a Server he owns or is scripting for, then he would probably have posted it in Scripting Help.
NaS is online now   Reply With Quote
Old 20/02/2018, 03:54 PM   #10
george3002
Little Clucker
 
Join Date: Dec 2014
Posts: 5
Reputation: 0
Default Re: Command Binding

True I posted this for client hotkeys without acess to server scripts
george3002 is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Binding IP's on a Dedi. iGetty Server Support 1 13/05/2013 01:45 AM
Binding problems xXRealLegitXx Scripting Help 8 17/04/2013 01:36 AM
Binding a command to a key Scripter12345 Scripting Help 1 05/04/2012 01:22 AM
binding IPs potato Server Support 3 16/06/2010 11:57 AM
binding fix+nitro jamesbond007 Help Archive 8 02/12/2009 07:54 PM


All times are GMT. The time now is 10:46 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.