Placebet DCMD help.. - 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: Placebet DCMD help.. (
/showthread.php?tid=565936)
Placebet DCMD help.. -
KingyKings - 02.03.2015
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
Re: Placebet DCMD help.. -
Evocator - 02.03.2015
Код:
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;
}
Re: Placebet DCMD help.. -
KingyKings - 02.03.2015
Wow, thankyou so much for that. Works brilliantly.