How to make commands with parameters?
#1

How to make commands with parameters?
for example like: "/givecash [playerid] [Amount]"
Reply
#2

Код:
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
	SendClientMessage(playerid, COLOR, "[USAGE:] /givemoney [playerid] [money]");
	return 1;
}
Reply
#3

Quote:
Originally Posted by Compton's Eazy E
Код:
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
	SendClientMessage(playerid, COLOR, "[USAGE:] /givemoney [playerid] [money]");
	return 1;
}
how do you know that?
i mean how can i know how to make another commands with parameters alone?
Reply
#4

Use dcmd + sscanf, it's small, easy, fast.

https://sampwiki.blast.hk/wiki/Dcmd
https://sampwiki.blast.hk/wiki/Dcmd#example_revisited
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)