/Buybeer help. - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: /Buybeer help. (
/showthread.php?tid=102071)
/Buybeer help. -
Sal_Kings - 13.10.2009
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;
}
Re: /Buybeer help. -
Correlli - 13.10.2009
What's wrong with your old topic? Post there.
Re: /Buybeer help. -
Sal_Kings - 13.10.2009
Quote:
Originally Posted by Don Correlli
What's wrong with your old topic? Post there.
|
This one makes more sense.
Re: /Buybeer help. -
Correlli - 13.10.2009
No, it makes less sence. Use your old topic for the SAME question.