SA-MP Forums Archive
Unknown command? - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Unknown command? (/showthread.php?tid=408873)



Unknown command? - Sellize - 19.01.2013

Whenever i type /givemoney it says unknown command but it compiles without errors
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;
}



Re: Unknown command? - DeathOnaStick - 19.01.2013

What kind of system do you use for implementation? I'm something of an "Oldie", never seen the COMMAND thing before, only CMD (probably the same procedure...). If I were you I'd check whether everything is put in correctly in OnPlayerCommandText, if that's necessary for that feature, though I'm pretty sure it is. Just look if it's in there, I bet it isn't.


Re: Unknown command? - Sellize - 20.01.2013

Quote:
Originally Posted by DeathOnaStick
Посмотреть сообщение
What kind of system do you use for implementation? I'm something of an "Oldie", never seen the COMMAND thing before, only CMD (probably the same procedure...). If I were you I'd check whether everything is put in correctly in OnPlayerCommandText, if that's necessary for that feature, though I'm pretty sure it is. Just look if it's in there, I bet it isn't.
I didnt get that...