Card Randomiser Help
#1

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.
Reply
#2

You didn't index it correctly.

new cards[][] =
Reply
#3

Quote:
Originally Posted by Pottus
Посмотреть сообщение
You didn't index it correctly.

new cards[][] =
Thank you, that fixed it.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)