[Tutorial] Making an easy /pay [playerid/name] [amount] system
#7

Quote:

First of all, we are going to use DCMD, for that u will have to download dini.
The chance that u already have dini is pretty big, (especially if you have downloaded an admin script for your server already)
If you don't have dini yet, just look for a download link on the internet, or download LuxAdmin, it has the dini file included.

You don't have to download dini to have Dcmd. Searching on ****** for "sa-mp dcmd" will find it. It is on the wiki page and it's only a single define line.

Quote:

Now that you have your dini, thing u are going to add this on top of your GM:
#include <dini>
it should be under #include <a_samp>
or under your other includes that you have installed yet.

Where are you using dini in this tutorial, what does dini have anything to do with it?

Quote:

Next we need a define
pawn Code:
#define dcmd(%1,%2,%3) if (!strcmp((%3)[1], #%1, true, (%2)) && ((((%3)[(%2) + 1] == '\0') && (dcmd_%1(playerid, ""))) || (((%3)[(%2) + 1] == ' ') && (dcmd_%1(playerid, (%3)[(%2) + 2]))))) return 1
now, I have no idea what the hell that means, I think there are only a few people who know what it means (you don't need to know what it means to make commands using DCMD...)...
anyways, this is just one define u need in your script to use dini.

What? Dini works fine without the Dcmd command processor.

pawn Code:
if (sscanf(params, "ii", ID,amount)) return SendClientMessage(playerid, 0xff0000aa, "* Usage: /pay [playerid/name] [amount]");
It says in the sscanf topic that "u" is used for playerid. I know that "i" works as well, but I would think that it's recommended to use "u".

pawn Code:
GetPlayerName(ID, name2, sizeof(name2));
    format(string8,sizeof(string8),"{FFFF00}|- You have paid %s $%i -|",name2,amount);
    SendClientMessageToAll(COLOR_RED,string8);
   
    GetPlayerName(playerid, name, sizeof(name));
    format(string7,sizeof(string7),"{FFFF00}* %s(%d) Has paid you: $%i",name,playerid,amount);
    SendClientMessageToAll(COLOR_RED,string7);
Why send the messages to all players?
Reply


Messages In This Thread
Making an easy /pay [playerid/name] [amount] system - by knackworst - 11.09.2011, 18:40
Re: Making an easy /pay [playerid/name] [amount] system - by Wesley221 - 11.09.2011, 18:51
Re: Making an easy /pay [playerid/name] [amount] system - by knackworst - 11.09.2011, 18:52
Re: Making an easy /pay [playerid/name] [amount] system - by Wesley221 - 11.09.2011, 18:53
Re: Making an easy /pay [playerid/name] [amount] system - by FireCat - 11.09.2011, 18:53
Re: Making an easy /pay [playerid/name] [amount] system - by knackworst - 11.09.2011, 18:54
Re: Making an easy /pay [playerid/name] [amount] system - by Prumpuz - 11.09.2011, 19:22
Re: Making an easy /pay [playerid/name] [amount] system - by knackworst - 11.09.2011, 19:39
Re: Making an easy /pay [playerid/name] [amount] system - by Prumpuz - 11.09.2011, 20:11
Re: Making an easy /pay [playerid/name] [amount] system - by knackworst - 11.09.2011, 20:13
Re: Making an easy /pay [playerid/name] [amount] system - by Davz*|*Criss - 12.09.2011, 11:53
Re: Making an easy /pay [playerid/name] [amount] system - by NickTaSpy - 25.10.2011, 17:47
Re: Making an easy /pay [playerid/name] [amount] system - by knackworst - 25.10.2011, 19:45
Re: Making an easy /pay [playerid/name] [amount] system - by Elka_Blazer - 25.10.2011, 19:46
Re: Making an easy /pay [playerid/name] [amount] system - by Kurvits - 29.10.2011, 18:03
Re: Making an easy /pay [playerid/name] [amount] system - by Kostas' - 03.11.2011, 14:14
Re: Making an easy /pay [playerid/name] [amount] system - by knackworst - 03.11.2011, 14:56
Re: Making an easy /pay [playerid/name] [amount] system - by Kostas' - 03.11.2011, 15:16
Re: Making an easy /pay [playerid/name] [amount] system - by Astralis - 19.11.2011, 09:27
Re: Making an easy /pay [playerid/name] [amount] system - by stylerof619 - 19.11.2011, 19:40
Re: Making an easy /pay [playerid/name] [amount] system - by knackworst - 20.11.2011, 11:07
Re: Making an easy /pay [playerid/name] [amount] system - by stylerof619 - 20.11.2011, 14:22
Re: Making an easy /pay [playerid/name] [amount] system - by .:Kaos:. - 20.11.2011, 14:35
Re: Making an easy /pay [playerid/name] [amount] system - by stylerof619 - 20.11.2011, 14:42

Forum Jump:


Users browsing this thread: 1 Guest(s)