/signcheck XXXX -
iGetty - 18.07.2011
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.
Re: /signcheck XXXX -
Adil - 18.07.2011
Post it in the
Script Request Thread.
-
iGetty - 18.07.2011
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?
Re: /signcheck XXXX -
Danny - 18.07.2011
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.
Re: /signcheck XXXX -
iGetty - 18.07.2011
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.
Re: /signcheck XXXX -
Adil - 18.07.2011
Then just search it. I found this, but it uses a different command processor.
https://sampforum.blast.hk/showthread.php?tid=54943
Re: /signcheck XXXX -
iGetty - 18.07.2011
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?
AW: /signcheck XXXX -
jaksimaksi - 16.08.2011
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;
}
Re: /signcheck XXXX -
Biesmen - 16.08.2011
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".
AW: /signcheck XXXX -
jaksimaksi - 16.08.2011
What the hell? Im making ZCMD not dcmd