[Tutorial] Using Zcmd and Sscanf
#24

Use sscanf and Zcmd..

pawn Code:
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, "ui", 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;
}
Reply


Messages In This Thread
Using Zcmd and Sscanf - by Markx - 28.03.2011, 19:43
Re: Using Zcmd and Sscanf - by Mikkel_Pedersen - 28.03.2011, 19:55
Re: Using Zcmd and Sscanf - by Markx - 28.03.2011, 19:58
Re: Using Zcmd and Sscanf - by Mikkel_Pedersen - 28.03.2011, 20:00
Re: Using Zcmd and Sscanf - by Markx - 28.03.2011, 20:00
Re: Using Zcmd and Sscanf - by gamer931215 - 29.03.2011, 10:45
Re: Using Zcmd and Sscanf - by Markx - 29.03.2011, 10:49
Re: Using Zcmd and Sscanf - by Mr_Scripter - 29.03.2011, 11:24
Re: Using Zcmd and Sscanf - by Markx - 29.03.2011, 11:36
Re: Using Zcmd and Sscanf - by Mr_Scripter - 29.03.2011, 13:47
Re: Using Zcmd and Sscanf - by Markx - 29.03.2011, 14:42
Re: Using Zcmd and Sscanf - by bake_pg - 29.03.2011, 19:40
Re: Using Zcmd and Sscanf - by Ironboy - 29.03.2011, 19:41
Re: Using Zcmd and Sscanf - by gamer931215 - 30.03.2011, 07:06
Re: Using Zcmd and Sscanf - by alpha500delta - 30.03.2011, 12:03
Re: Using Zcmd and Sscanf - by Markx - 30.03.2011, 17:48
Re: Using Zcmd and Sscanf - by sabreman - 02.04.2011, 12:19
Re: Using Zcmd and Sscanf - by Markx - 02.04.2011, 14:22
Re: Using Zcmd and Sscanf - by sabreman - 02.04.2011, 16:49
Re: Using Zcmd and Sscanf - by PinkFloydLover - 03.04.2011, 12:48
Re: Using Zcmd and Sscanf - by ricardo178 - 03.04.2011, 13:37
Re: Using Zcmd and Sscanf - by omer5198 - 03.04.2011, 13:38
Re: Using Zcmd and Sscanf - by bestr32 - 03.04.2011, 16:38
Re: Using Zcmd and Sscanf - by Markx - 03.04.2011, 21:14
Re: Using Zcmd and Sscanf - by Arnoldas - 27.04.2011, 20:08
Re: Using Zcmd and Sscanf - by Joe Staff - 27.04.2011, 20:18
Re: Using Zcmd and Sscanf - by Markx - 28.04.2011, 08:38
Re: Using Zcmd and Sscanf - by xRyder - 28.04.2011, 11:16
Re: Using Zcmd and Sscanf - by Markx - 29.04.2011, 11:23
Re: Using Zcmd and Sscanf - by Shubham - 08.05.2011, 12:25
Re: Using Zcmd and Sscanf - by Markx - 11.05.2011, 18:41
Re: Using Zcmd and Sscanf - by roadless - 12.05.2011, 17:21
Re: Using Zcmd and Sscanf - by Mr.Carson Clay - 07.02.2012, 09:48
Re: Using Zcmd and Sscanf - by lsfmd - 07.02.2012, 15:18

Forum Jump:


Users browsing this thread: 1 Guest(s)