Card Randomiser 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: Card Randomiser Help (
/showthread.php?tid=579940)
Card Randomiser Help -
BR3TT - 01.07.2015
pawn Код:
CMD:card(playerid, params[])
{
new string[128];
new cards[] =
{
"One",
"Two",
"Three",
"Four",
"Five",
"Six",
"Seven",
"Eight",
"Nine",
"Ten",
"Jack",
"Queen",
"King"
};
format(string, sizeof(string), "%s has pulled out a %s from his deck of cards.", PlayerName(playerid), cards[random(sizeof(cards))]);
SendClientMessage(playerid, COLOR_PURPLE, string);
I'm using the above to make a random card command. However say it wants to output seven, it will output it as "ven" so "Player has pulled out a ven from his deck of cards".
I'm only knew to this, I'm sure this is an easy fix and will +rep with any help.
Re: Card Randomiser Help -
Pottus - 01.07.2015
You didn't index it correctly.
new cards[][] =
Re: Card Randomiser Help -
BR3TT - 01.07.2015
Quote:
Originally Posted by Pottus
You didn't index it correctly.
new cards[][] =
|
Thank you, that fixed it.