How do I make a fakecmd in zcmd like dis?
#1

How would I go about doing this? I know this won't work, but it's just an example,

CMD:fakecmd(playerid, params[])
{
if(sscanf(params, "iss", playerid, command, fakeparams)) return sendmsg(playerid, "/fakecmd [id] [cmd] [params]");
cmd_command(playerid, fakeparams);
return 1;
}
Reply
#2

What do you want to do with this command?
Reply
#3

Quote:
Originally Posted by DamonD
Посмотреть сообщение
How would I go about doing this? I know this won't work, but it's just an example,

CMD:fakecmd(playerid, params[])
{
if(sscanf(params, "iss", playerid, command, fakeparams)) return sendmsg(playerid, "/fakecmd [id] [cmd] [params]");
cmd_command(playerid, fakeparams);
return 1;
}
You would use this...
pawn Код:
CallRemoteFunction("OnPlayerCommandText", "is", id, command);
But you need to change the sscanf params so command and fakeparams are in the same thing.
Reply
#4

The tricky part is that I believe that sends it in strcmp? Would it work with ZCMD?
Reply
#5

Yes.
Reply
#6

Alright, i'll try it now. Hope it works!

UPDATE: I've scripted it, and it's compiling. Hopefully, it will work as it's supposed to.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)