ATM problem
#1

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;
}
Reply
#2

help please
Reply
#3

Since when can you deposit money into an ATM lol.

Anyway

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.");
        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;
}
Reply
#4

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.");
        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;
}
EDIT: The code pasted above would never work.
EDIT 2: That stupid fucker copied my code. What a fucking scrub.
Reply
#5

Quote:
Originally Posted by biker122
Посмотреть сообщение
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.");
        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;
}
EDIT: The code pasted above would never work.
EDIT 2: He copied/edited the code in seconds.
Still the same errors, but thanks that you are trying to help me
Reply
#6

Which is the line 5537? Can you post the error logs once again?
Reply
#7

pawn Код:
SCM(playerb, COLOR_WHITE, "You reveice money from %s", RPName(playerid)):
You've mistaken the semicolon with a colon.

pawn Код:
SCM(playerb, COLOR_WHITE, "You receive money from %s", RPName(playerid));
And you probably have this line:
pawn Код:
#define SCM SendClientMessage
More than once in your filterscript/gamemode.
Reply
#8

All of the errors are now fixed thanks...
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)