01.08.2011, 09:05
Sorry for double posting but , i fixed an error , like this :
Withdraw CMD :
Deposit CMD:
, now it give those errors :
Withdraw CMD :
pawn Код:
if(strcmp(cmd, "/withdraw", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(IsPlayerInRangeOfPoint(playerid, 5.0, 1432.8818,-997.5147,1639.7911))||IsPlayerInRangeOfPoint(playerid, 5.0, 2316.3171,-1916.4500,828.1979))
{
SendClientMessage(playerid, COLOR_NICEGREEN, " You are not at the bank !");
return 1;
}
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_WHITE, "USAGE: /withdraw [amount]");
format(string, sizeof(string), " You have $%d in your bank account.", PlayerInfo[playerid][pAccount]);
SendClientMessage(playerid, COLOR_GRAD3, string);
return 1;
}
new cashdeposit = strvalEx(tmp);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_WHITE, "USAGE: /withdraw [amount]");
format(string, sizeof(string), " You have $%d in your bank account.", PlayerInfo[playerid][pAccount]);
SendClientMessage(playerid, COLOR_GRAD3, string);
return 1;
}
if(cashdeposit > PlayerInfo[playerid][pAccount] || cashdeposit < 1)
{
SendClientMessage(playerid, COLOR_GRAD2, " You don't have that much !");
return 1;
}
PlayerInfo[playerid][pCash] = PlayerInfo[playerid][pCash]+cashdeposit;
GivePlayerMoney(playerid,cashdeposit);
PlayerInfo[playerid][pAccount] = PlayerInfo[playerid][pAccount]-cashdeposit;
format(string, sizeof(string), " You have withdrawn $%d from your bank account, Total: $%d ", cashdeposit,PlayerInfo[playerid][pAccount]);
SendClientMessage(playerid, COLOR_YELLOW, string);
return 1;
}
return 1;
}
Deposit CMD:
pawn Код:
if(strcmp(cmd, "/deposit", true) == 0 || strcmp(cmd, "/deposit", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(!IsPlayerInRangeOfPoint(playerid, 5.0, 1432.8818,-997.5147,1639.7911))||IsPlayerInRangeOfPoint(playerid, 5.0, 2316.3171,-1916.4500,828.1979))
{
SendClientMessage(playerid, COLOR_NICEGREEN, " You are not at the bank !");
return 1;
}
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_WHITE, "USAGE: /bank [amount]");
format(string, sizeof(string), " You have $%d in your bank account.", PlayerInfo[playerid][pAccount]);
SendClientMessage(playerid, COLOR_GRAD3, string);
return 1;
}
new cashdeposit = strvalEx(tmp);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_WHITE, "USAGE: /bank [amount]");
format(string, sizeof(string), " You have $%d in your bank account.", PlayerInfo[playerid][pAccount]);
SendClientMessage(playerid, COLOR_GRAD3, string);
return 1;
}
if(cashdeposit > PlayerInfo[playerid][pCash] || cashdeposit < 1)
{
SendClientMessage(playerid, COLOR_GRAD2, " You don't have that much !");
return 1;
}
PlayerInfo[playerid][pCash] = PlayerInfo[playerid][pCash]-cashdeposit;
GivePlayerMoney(playerid,-cashdeposit);
new curfunds = PlayerInfo[playerid][pAccount];
PlayerInfo[playerid][pAccount] = cashdeposit+PlayerInfo[playerid][pAccount];
SendClientMessage(playerid, COLOR_WHITE, "|___ BANK STATEMENT ___|");
format(string, sizeof(string), " Old Balance: $%d", curfunds);
SendClientMessage(playerid, COLOR_GRAD2, string);
format(string, sizeof(string), " Deposit: $%d",cashdeposit);
SendClientMessage(playerid, COLOR_GRAD4, string);
SendClientMessage(playerid, COLOR_GRAD6, "|------------------------------------------|");
format(string, sizeof(string), " New Balance: $%d", PlayerInfo[playerid][pAccount]);
SendClientMessage(playerid, COLOR_WHITE, string);
return 1;
}
return 1;
}
pawn Код:
E:\GTA SanAndreas\X-Zone RPG\gamemodes\xzrpg.pwn(22654) : error 029: invalid expression, assumed zero
E:\GTA SanAndreas\X-Zone RPG\gamemodes\xzrpg.pwn(22654) : error 001: expected token: ";", but found ")"
E:\GTA SanAndreas\X-Zone RPG\gamemodes\xzrpg.pwn(22654) : error 029: invalid expression, assumed zero
E:\GTA SanAndreas\X-Zone RPG\gamemodes\xzrpg.pwn(22654) : fatal error 107: too many error messages on one line
Compilation aborted.Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
4 Errors.