how to return CMD?
#1

Im using this:

https://sampforum.blast.hk/showthread.php?tid=307319

I would like to make a command, /PDL who returns /siren 1 , a case /pdl is like if i tipe /SIREN 1 +REP!
Reply
#2

CMD:pdl(playerid) return cmd_siren(playerid,"1");
Reply
#3

blank. has made a good example but this is more efficient.

paste this on

pawn Код:
#define SHIFT_CMD:%1->%2;           \
COMMAND:%1(playerid, params[])   \
return cmd_%2(playerid, params);
then you can put
pawn Код:
SHIFT_CMD:pdl->siren;
Reply
#4

Quote:
Originally Posted by TheArcher
Посмотреть сообщение
blank. has made a good example but this is more efficient.

paste this on

pawn Код:
#define SHIFT_CMD:%1->%2;           \
COMMAND:%1(playerid, params[])   \
return cmd_%2(playerid, params);
then you can put
pawn Код:
SHIFT_CMD:pdl->siren;
Actually, what blank has posted is more efficient in what he wants. He wants it to return something that changes the params to "1" so it will auto do the command.
Reply
#5

@Antonio no gooday wants to return the same command if you type another one. Mine is more faster cause it uses macros.
Reply
#6

Quote:
Originally Posted by TheArcher
Посмотреть сообщение
@Antonio no gooday wants to return the same command if you type another one. Mine is more faster cause it uses macros.
It does exactly the same thing except yours isn't as versatile when it comes to parameters, yours might come in handy when you want to mask a large number of commands, I.E /shout /s, /low /l and so on but not for the reason he wants it.
Reply
#7

@blank. that what i meant, i also suggested to make it use with many commands. I'm sure he's going to edit another GM but whatever let's stay in topic. Good answer though.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)