Placebet DCMD help..
#1

Hi, I am unsure how to start a Placebet Command in DCMD.

I want it so a player can type /placebet [a number from 1-6] [amount to bet]

So they are placing a certain amount of money on a number. E.G 5k on number 4....

Could someone give me a guide on how to do this. I have searched everywhere but can't find a solution.

pawn Код:
dcmd(placebet, 8, cmdtext);
I tried using a /pay script and editing it however that is not going to work because I'm not looking for a playerid..

pawn Код:
dcmd_placebet(playerid, params[])
{
    if(joinedtable[playerid] == 1)
    {
        if(peopleattable == 2)
            {
            new targetid, value;
            if(sscanf(params, "ui", targetid, value)) return SendClientMessage(playerid, COLOR_RED, "ERROR: /placebet [] [amount]");
I don't know.. If someone could help i would appreciate it. Just a little guidance
Reply
#2

Код:
dcmd_placebet(playerid, params[])
{
	if(joinedtable[playerid] == 1) //joined the table
	{
		if(peopleattable >= 2) //there is more than two people on the table
		{
			new number, amount;
			if(sscanf(params, "ii", number, amount)) return SendClientMessage(playerid, COLOR_RED, "ERROR: /placebet [1-6] [amount]");
			if (number < 1) return SendClientMessage(playerid, COLOR_RED, "Numbers should be greater than 1.");
            if (number > 6) return SendClientMessage(playerid, COLOR_RED, "Numbers should be less than 6.");
            //continue with your code.
        }
        else SendClientMessage(playerid, COLOR_RED, "You need to have 2+ players at a table.");
    }
	else SendClientMessage(playerid, COLOR_RED, "You need to join a table.");
	return 1;
}
Reply
#3

Wow, thankyou so much for that. Works brilliantly.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)