Posts: 542
Threads: 14
Joined: Aug 2016
Reputation:
0
Don’t be lazy. This doesn’t even make sense code them separately.
Posts: 6,242
Threads: 8
Joined: Jun 2008
This doesn't fit what they are wanting to do...
Seems like an attempt at a dynamic command system, but really, it's flawed in the long run.
Simply do as what ISmokezU said... Simply code the commands, as in the longer term, those commands should be populated later, so you could easily just make...
Code:
CMD:help(playerid)
{
SendClientMessage(playerid, COLOR_WHITE, "Help will be available soon.");
return 1;
}
Posts: 1,349
Threads: 194
Joined: Jan 2014
Reputation:
0
To be honest I don't think it's gonna be possible. If it is that's really gonna be hard and would be limited too.
Posts: 678
Threads: 16
Joined: Apr 2014
Reputation:
0
Store them in file and load them with texts?
I saw that in a script in some forums and that command does the same thing but limited to that only.
Posts: 6,242
Threads: 8
Joined: Jun 2008
^^ I remember something similar, yet I searched for it thinking it was "Dynamic Commands" but couldn't find it.
Posts: 578
Threads: 40
Joined: Dec 2016
This question has very little to none explanation, and those who's said it's impossible slash very hard to, please provide some logic to that? What you're asking to do is create a message response when a client sends the messages which is given in an input. This is very easy in the long run, all you have to do is look at the compability and stability.
The run of this idea is to: register the keyworf '${commandKey}' to a database storage (let it be file storage or MariaDB etc), register another keyword '${commandResponse}'. Then we've got a list of 'commands' defined by a user. Since PAWN is working under the runtime only, we now gotta define this list of commands staticly, to do this you can use the callback of 'OnPlayerCmdText', however. It will depend on how you code this, will you loop over the list of the registered commands, will you pull the data everytime a slash is written, will you use 'if' statements, and so on. All of those examples are bad practice, keep that in mind. I believe this is enough to get you on track.
for the love of god, don't ask me for code.