/givemoney won't work
#1

So this cmd
pawn Код:
COMMAND:givemoney(playerid, params[])
{
    if Info[playerid][aLevel] > 2
    {
        new
          toplayerid,
          amount;

        if (!sscanf(params, "ii", toplayerid, amount))
        {
          if (toplayerid != INVALID_PLAYER_ID)
          {
            new
              message[40];
            GivePlayerMoney(toplayerid, amount);
            format(message, sizeof(message), "You received $%d from an admin!", amount);
            SendClientMessage(toplayerid, 0x00FF00FF, message);
          }
          else SendClientMessage(playerid, 0xFF0000FF, "You inputed an invalid player.");
        }
        else SendClientMessage(playerid, 0xFFFFFFFF, "Usage: /givemoney <playerid> <amount>");
    }
    else SendClientMessage(playerid, 0xFF0000FF, "Your admin level is too low to perform this command!");
    return 1;
}
Shows me this error

Код:
C:\Users\x3990.003\Desktop\SELLIZE CNR\filterscripts\essentials.pwn(251) : error 029: invalid expression, assumed zero
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.
Reply
#2

line 251 is....
Reply
#3

Line 251 is the "{"

pawn Код:
if Info[playerid][aLevel] > 2
    {
Reply
#4

you forgot to put ) at last
pawn Код:
if(Info[playerid][aLevel] > 2)
Try This
pawn Код:
COMMAND:givemoney(playerid, params[])
{
    if(Info[playerid][aLevel] > 2)
    {
        new
          toplayerid,
          amount;

        if (!sscanf(params, "ii", toplayerid, amount))
        {
          if (toplayerid != INVALID_PLAYER_ID)
          {
            new
              message[40];
            GivePlayerMoney(toplayerid, amount);
            format(message, sizeof(message), "You received $%d from an admin!", amount);
            SendClientMessage(toplayerid, 0x00FF00FF, message);
          }
          else SendClientMessage(playerid, 0xFF0000FF, "You inputed an invalid player.");
        }
        else SendClientMessage(playerid, 0xFFFFFFFF, "Usage: /givemoney <playerid> <amount>");
    }
    else SendClientMessage(playerid, 0xFF0000FF, "Your admin level is too low to perform this command!");
    return 1;
}
Reply
#5

That gave me these...

Код:
C:\Users\x3990.003\Desktop\SELLIZE CNR\filterscripts\essentials.pwn(250) : error 001: expected token: "*then", but found ")"
C:\Users\x3990.003\Desktop\SELLIZE CNR\filterscripts\essentials.pwn(250) : error 029: invalid expression, assumed zero
C:\Users\x3990.003\Desktop\SELLIZE CNR\filterscripts\essentials.pwn(270) : error 029: invalid expression, assumed zero
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


3 Errors.

Quote:
Originally Posted by pds2012
Посмотреть сообщение
you forgot to put ) at last
pawn Код:
if Info[playerid][aLevel] > 2)
Try This
pawn Код:
COMMAND:givemoney(playerid, params[])
{
    if Info[playerid][aLevel] > 2)
    {
        new
          toplayerid,
          amount;

        if (!sscanf(params, "ii", toplayerid, amount))
        {
          if (toplayerid != INVALID_PLAYER_ID)
          {
            new
              message[40];
            GivePlayerMoney(toplayerid, amount);
            format(message, sizeof(message), "You received $%d from an admin!", amount);
            SendClientMessage(toplayerid, 0x00FF00FF, message);
          }
          else SendClientMessage(playerid, 0xFF0000FF, "You inputed an invalid player.");
        }
        else SendClientMessage(playerid, 0xFFFFFFFF, "Usage: /givemoney <playerid> <amount>");
    }
    else SendClientMessage(playerid, 0xFF0000FF, "Your admin level is too low to perform this command!");
    return 1;
}
Reply
#6

Try my post again,
Edited
Reply
#7

Quote:
Originally Posted by pds2012
Посмотреть сообщение
Try my post again,
Edited
thx! worked
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)