multi param commands with dcmd?
#1

Hi al. I am trying to make a /pay command... with dcmd.. but i cant figure out how to make it with 2 params... the player id (int) and the case (int). Can someone please give me an example of this? THANKZ!
Reply
#2

You can use..
pawn Код:
params[0] // Parameters 0 (playerid)
params[1] // Parameters 1 (ammount)
Or even better, sscanf
pawn Код:
new destination, ammount;
if (sscanf(params, "ui", destination, ammount)) return SendClientMessage(playerid, -1, "Usage: /sendmoney <destination> <ammount>");
GivePlayerMoney(destination, ammount);
GivePlayerMoney(playerid, -ammount);
Reply
#3

thanks... sscanf. its kinda coplex but makes a ton of sense! THX!
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)