22.12.2014, 22:38
Well.. I created an ATM system but its gives alot of errors and i dunno what the problem is, can you check it?
pawn Код:
C:\Users\Davey\Desktop\Divoro Linux\VL-RP.pwn(5532) : warning 209: function "cmd_atm" should return a value
C:\Users\Davey\Desktop\Divoro Linux\VL-RP.pwn(5533) : error 010: invalid function or declaration
C:\Users\Davey\Desktop\Divoro Linux\VL-RP.pwn(5537) : error 021: symbol already defined: "SendClientMessage"
C:\Users\Davey\Desktop\Divoro Linux\VL-RP.pwn(5541) : error 010: invalid function or declaration
C:\Users\Davey\Desktop\Divoro Linux\VL-RP.pwn(5543) : error 010: invalid function or declaration
C:\Users\Davey\Desktop\Divoro Linux\VL-RP.pwn(5549) : error 010: invalid function or declaration
pawn Код:
command(atm, playerid, params[])
{
new amount, string[128];
new me[128], playerb;
if(sscanf(params, "s[16]i", playerb ,params, amount))
{
SCM(playerid, COLOR_WHITE, "** [Usage]: /atm [withdraw/balance/deposit/transfer] [amount]");
return 1;
}
if(!strcmp(params, "withdraw", true))
{
if(amount > Player[playerid][BankMoney]) return SCM(playerid, COLOR_GREY, "You don't have that much money in your bank account.");
if(amount <= 0) return SCM(playerid, COLOR_GREY, "Invalid money amount.");
if(amount > 50000) return SCM(playerid, COLOR_GREY, "You can't deposit more than $50,000 in an ATM.");
Player[playerid][BankMoney] -= amount;
GivePlayerMoney(playerid, amount);
format(me, sizeof(me), "** %s presses a button on the ATM machine and waits for a response.", RPName(playerid));
NearByMessage(playerid, NICESKY, me);
SCM(playerid, COLOR_WHITE, "_________________________________");
format(string, sizeof(string), "You have successfully withdrawn $%d from your Bank account.", amount);
SCM(playerid, COLOR_LIGHTBLUE, string);
format(string, sizeof(string), "You have a total of $%d remaining in your Bank account.", Player[playerid][BankMoney]);
SCM(playerid, COLOR_LIGHTBLUE, string);
}
else if(!strcmp(params, "deposit", true))
{
if(amount > Player[playerid][Money]) return SCM(playerid, COLOR_GREY, "You don't have that much money on you.");
if(amount <= 0) return SCM(playerid, COLOR_GREY, "Invalid money amount.");
if(amount > 50000) return SCM(playerid, COLOR_GREY, "You can't withdraw more than $50,000 from the ATM.");
SCM(playerid, COLOR_GREY, string);
}
Player[playerid][BankMoney] += amount;
GivePlayerMoney(playerid, -amount);
format(me, sizeof(me), "** %s presses a button on the ATM machine and waits for a response.", RPName(playerid));
NearByMessage(playerid, NICESKY, me);
SCM(playerid, COLOR_WHITE, "_________________________________");
format(string, sizeof(string), "You have successfully deposit $%d into your Bank account.", amount);
SCM(playerid, COLOR_LIGHTBLUE, string);
format(string, sizeof(string), "You have a total of $%d in your Bank account now.", Player[playerid][BankMoney]);
SCM(playerid, COLOR_LIGHTBLUE, string);
}
else if(!strcmp(params, "balance", true))
{
format(me, sizeof(me), "** %s presses a button on the ATM machine and waits for a response.", RPName(playerid));
NearByMessage(playerid, NICESKY, string);
SCM(playerid, COLOR_WHITE, "_________________________________");
format(string, sizeof(string), "Your current Bank-account balance is: $%d.", Player[playerid][BankMoney]);
SCM(playerid, COLOR_LIGHTBLUE, string);
}
else if(!strcmp(params, "transfer", true))
{
if(sscanf(params, "ui", playerb, amount)) return SCM(playerid, COLOR_WHITE, "[Usage]: /atm transfer [playerid] [amount]");
Player[playerid][BankMoney] -= amount;
SCM(playerid, COLOR_WHITE, "You transferd money over to %s", RPName(playerb));
Player[playerb][BankMoney] += amount;
SCM(playerb, COLOR_WHITE, "You reveice money from %s", RPName(playerid)):
}
return 1;
}