/Buybeer help.
#1

Ok so, when i type /buybeer amount it says "Unkown command" and when i type /buybeer alone nothing happens.
Код:
if(strcmp(cmdtext, "/buybeer", true) == 0)
{
	new tmp[5], index;

	new length = strlen(cmdtext);
	while ((index < length) && (cmdtext[index] <= ' '))
	{
		index++;
	}

	new offset = index;
	while ((index < length) && (cmdtext[index] > ' ') && ((index - offset) < (sizeof(tmp) - 1)))
	{
		tmp[index - offset] = cmdtext[index];
		index++;
	}
	tmp[index - offset] = EOS;

	if( ! strlen(tmp) ) return SendClientMessage(playerid, 0xFFFFFFAA, "Usage: /buybeer [amount]");
	new amount = strval(tmp);

	if ( GetPlayerMoney(playerid) < (amount*50) ) return SendClientMessage(playerid, 0xFFFFFFAA, "You don't have enough money to buy that amount of beer.");

	GivePlayerMoney( playerid, (50*amount) );

	BEER[playerid] += amount;

	return 1;
}
Reply
#2

What's wrong with your old topic? Post there.
Reply
#3

Quote:
Originally Posted by Don Correlli
What's wrong with your old topic? Post there.
This one makes more sense.
Reply
#4

No, it makes less sence. Use your old topic for the SAME question.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)