SA-MP Forums Archive
[Help] Making commands - 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: [Help] Making commands (/showthread.php?tid=526653)



[Help] Making commands - William_McKnight - 18.07.2014

I am working on to create commands like /givemoney and anothers but those cmds are not working.

Код:
COMMAND:givemoney(playerid, params[])
{
    if (IsPlayerAdmin(playerid))
    {
        new
          toplayerid, // the player we want to give money to
          amount;
        // extracting player's ID and amount from params
        if (!sscanf(params, "ii", toplayerid, amount))
        {
          if (toplayerid != INVALID_PLAYER_ID)
          {
            new
              message[40];
            GivePlayerMoney(toplayerid, amount);
            format(message, sizeof(message), "You got $%d from admin!", amount);
            SendClientMessage(toplayerid, 0x00FF00FF, message);
          }
          else SendClientMessage(playerid, 0xFF0000FF, "That player is not connected");
        }
        else SendClientMessage(playerid, 0xFFFFFFFF, "Usage: /givemoney <playerid> <amount>");
    }
    else SendClientMessage(playerid, 0xFF0000FF, "Only admins can use this command!");
    return 1;
}
Error:

Код:
C:\Slymind-Projects\gamemodes\slymind.pwn(437) : warning 203: symbol is never used: "givemoney"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Warning.
Please explain me that how to fix it and how to add more commands cause I am learning pawn and I want to learn it really quickly. Thanks for your time.


Re: [Help] Making commands - LivingLikeYouDo - 18.07.2014

Show us your line no. 437


Re: [Help] Making commands - Konstantinos - 18.07.2014

Include ZCMD.

pawn Код:
#include <a_samp> // must be first
#include <zcmd>



Re: [Help] Making commands - William_McKnight - 18.07.2014

Quote:
Originally Posted by LivingLikeYouDo
Посмотреть сообщение
Show us your line no. 437
There is no line no. 437. But, I am getting this error message and I hope that it will be fix soon.

Quote:
Originally Posted by Konstantinos
Посмотреть сообщение
Include ZCMD.

pawn Код:
#include <a_samp> // must be first
#include <zcmd>
I included this then I got this error message:

Код:
C:\Slymind-Projects\gamemodes\slymind.pwn(3) : fatal error 100: cannot read from file: "zcmd"

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.



Re: [Help] Making commands - Konstantinos - 18.07.2014

Download zcmd.inc and paste it to C:\Slymind-Projects\pawno\include folder.

http://www.solidfiles.com/d/323cc04b3c/zcmd.inc


Re: [Help] Making commands - Faix - 18.07.2014

Download ZCMD include.


Re: [Help] Making commands - William_McKnight - 18.07.2014

Quote:
Originally Posted by Konstantinos
Посмотреть сообщение
Download zcmd.inc and paste it to C:\Slymind-Projects\pawno\include folder.

http://www.solidfiles.com/d/323cc04b3c/zcmd.inc
Thanks a lot and I want to learn pawno's basics to become 3rd Developer to write scripts. But, not the whole GM. Any suggestions?