/signcheck XXXX
#1

Can somebody help me, on how to create something, that is along the lines of this command?:

pawn Код:
COMMAND:signcheck, playerid, params[])
{
The things to use here for the numbers...
return 1;
}
And also, could it be like, 4 random numbers that appear on
pawn Код:
SendClientMessage(playerid, 0xFFFFFFF, "Your signcheck number is %s);
Or w/e it would be?


thanks.

If you need a picture of how it looks, please tell me, and I will get one.
Reply
#2

Post it in the Script Request Thread.
Reply
#3

They take TOO long to reply..... and it's a help thing, just to get a bit of help with params.. but alright.

EDIT1: The one below, was not a bump, but was a mistaken edit.

EDIT: Whenever I try to go on the Script Request Thread, it doesn't let me post?
Reply
#4

Save the number somewhere.

Код:
new number = (1000 + random(9999));
format(str, sizeof str,"Your number is: %d.",number);
SendClientMessage(playerid, COLOR, str);
CheckNum[playerid] = number;
Then, check the number at the command with:
Код:
if(CheckNum[playerid] == enterednumber) // the number that's entered behind the signcheck cmd.
Reply
#5

Quote:
Originally Posted by -Danny-
Посмотреть сообщение
Save the number somewhere.

Код:
new number = (1000 + random(9999));
format(str, sizeof str,"Your number is: %d.",number);
CheckNum[playerid] = number;
Then, check the number at the command with:
Код:
if(CheckNum[playerid] == enterednumber) // the number that's entered behind the signcheck cmd.
Could you explain in like, a bit more detail please?, much appreciated.
Reply
#6

Then just search it. I found this, but it uses a different command processor. https://sampforum.blast.hk/showthread.php?tid=54943
Reply
#7

pawn Код:
if(strcmp(cmdtext, "/signcheck", 10)==0)
{
  if(!strlen(cmdtext[11]))
  {
    SendClientMessage(playerid, 0xFF0000AA, "Use: /signcheck [checknumber]");
    return 1;
  }
  new number = strval(cmdtext[11]);
  if(number == CheckNumber[playerid])
  {
    SendClientMessage(playerid, 0x00FF00AA, "You received your money!");
    GivePlayerMoney(playerid, ENTER_HERE_THE_AMOUNT!!);
  }
  else
  {
    SendClientMessage(playerid, 0xFF0000AA, "Wrong checknumber!");
  }
  return 1;
}
How could I turn that to ZCMD?
Reply
#8

Yea I need it on zcmd too.. Could someone convert? I tryed but script works with all numbers that ive type

pawn Код:
CMD:signcheck(playerid, params[])
{
if(sscanf(params, "i", CheckNumber))
return SendClientMessage(playerid, COLOR_GREY,"[Naudojimas]: /signcheck [id]");

  new number = strval(params);
  if(number == CheckNumber[playerid])
  {
    SendClientMessage(playerid, 0x00FF00AA, "You received your money!");
    GivePlayerMoney(playerid, 100);
  }
  else
  {
    SendClientMessage(playerid, 0xFF0000AA, "Wrong checknumber!");
  }
  return 1;
}
Reply
#9

Weird command, but anyway from CMD to ZCMD is very easy. change CMD: into zcmd.

so replace
pawn Код:
CMD:signcheck(playerid,params[])
with
pawn Код:
dcmd_signcheck(playerid, params[])
Make sure you "defined" the command at the callback OnPlayerCommandText by typing this somewhere in that callback:
pawn Код:
dcmd(signcheck, 9, cmdtext);
Why 9? Because I count 9 letters if I count "signcheck".
Reply
#10

What the hell? Im making ZCMD not dcmd
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)