18.05.2010, 09:16
Hello guys, I'm new in here and also in the scripting world and I really like to learn, could someone tell me what's wrong with this script please, thanks a lot.
Depositing command,
Withdrawal command,
It's only part of the script, well when I play it in game, everything goes well, except when I type /withdraw 100, it keeps saying SERVER: Unknown command. But when I only type /withdraw, it works well saying USAGE: /withdraw (ammount). Goes the same with /deposit.
Depositing command,
Код:
if(strcmp(cmdtext,"/deposit",true) == 0)
{
new ammount;
tmp = strtok(cmdtext,idx);
if(banklogged[playerid] == 0)
{
SendClientMessage(playerid,0xF5DEB3FF,"You are not logged in on your bank account!");
return 1;
}
if(!strlen(tmp))
{
SendClientMessage(playerid,0xFF0000FF,"USAGE: /deposit (ammount)");
return 1;
}
ammount = strval(tmp);
new currentm = GetPlayerMoney(playerid);
if(currentm <= ammount)
{
SendClientMessage(playerid,0xF5DEB3FF,"You cannot deposit more money than you have!");
return 1;
}
if(PlayerToPoint(3,playerid,2308.7920,-13.5103,26.7422))
{
bankmoney[playerid] += ammount;
format(string, sizeof(string),"You have deposited $%d.00 to your bank account.",ammount);
SendClientMessage(playerid,0xF5DEB3FF,string);
GivePlayerMoney(playerid,-ammount);
return 1;
}
else
{
SendClientMessage(playerid,0xF5DEB3FF,"You are not at the Bank!");
return 1;
}
}
Код:
if(strcmp(cmdtext,"/withdraw",true) == 0)
{
new wammount;
tmp = strtok(cmdtext,idx);
if(banklogged[playerid] == 0)
{
SendClientMessage(playerid,0xF5DEB3FF,"You are not logged in into your bank account!");
return 1;
}
if(!strlen(tmp))
{
SendClientMessage(playerid,0xFF0000FF,"USAGE: /withdraw (ammount)");
return 1;
}
wammount = strval(tmp);
new bank = bankmoney[playerid];
if(bank <= wammount-1)
{
SendClientMessage(playerid,0xF5DEB3FF,"You cannot withdraw more money than you have!");
return 1;
}
if(PlayerToPoint(3,playerid,2308.7920,-13.5103,26.7422))
{
bankmoney[playerid] -= wammount;
format(string,sizeof(string),"You have withdrawed $%d.00 from your bank account.",wammount);
SendClientMessage(playerid,0xF5DEB3FF,string);
GivePlayerMoney(playerid,wammount);
return 1;
}
else
{
SendClientMessage(playerid,0xF5DEB3FF,"You are not in the bank!");
return 1;
}
Код:
C:\Documents and Settings\Super Dude\Desktop\bonecounty.pwn(129) : warning 204: symbol is assigned a value that is never used: "pincode" C:\Documents and Settings\Super Dude\Desktop\bonecounty.pwn(158) : warning 204: symbol is assigned a value that is never used: "pincode" Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 2 Warnings.


Do you mean that I have to make it like this?