Textdraw issue
#6

Quote:
Originally Posted by kevin1990
Посмотреть сообщение
Well it would not be clickable. I want them to use the command /spin when it does that it shows the textdraw of the slots. If the number is 2 then comes up it shows cherry.

so /spin generates a random number between 1-10 if its lands on 2 its cherry. otherwise its something else and so on. They dont ever have to click the textdraw.
You have to create certain textdraws (cherry and so on) and show it when the /spin command randomally found number...

pawn Код:
// At the very top

new SlotNumber[MAX_PLAYERS] = -1;
new TextDraw[MAX_PLAYERS] = -1;
new Text:Noting;
new Text:Jacks;
new Text:Cherries;
// .. And so on..
forward Spining(playerid);

public OnGameModeInit()
{
     // Create the 'noting', 'jacks', 'cherries', textdraws
     return 1;
}

public OnPlayerConnect(playerid)
{
     SlotNumber[playerid] = -1;
     TextDraw[playerid] = -1;
}

// cmd for the spin
CMD:spin(playerid, params[])
{
     if(!PlayerInfo[playerid][pCoin]) return SendClientMessage(playerid, COLOR_WHITE, "** You are missing coins, you cant spin. **");
     SetTimerEx("Spining", 7000, false, "i", playerid);
     SendClientMessage(playerid, COLOR_WHITE, "** Slot machine spining.. **");
     return 1;
}

// public which will be execuded after timer ends. (7 Seconds)
public Spining(playerid)
{
     new Number = random(10);
     SlotNumber[playerid] = Number;
     if(SlotNumber[playerid] == 0) TextDrawShowForPlayer(playerid, Noting); TextDraw[playerid] = Noting;
     if(SlotNumber[playerid] == 1) TextDrawShowForPlayer(playerid, Jacks); TextDraw[playerid] = Jacks;
     if(SlotNumber[playerid] == 2) TextDrawShowForPlayer(playerid, Cherries); TextDraw[playerid] = Cherries;
     // .. And so on ..
     SlotNumber[playerid] = -1
     TextDrawHideForPlayer(playerid, TextDraw[playerid]);
     return 1;
}
Thats how I would have done it. This is very simple and took about 2 minutes to create. I would suggest you to adjust it and add to it as you wish.
Reply


Messages In This Thread
Textdraw issue - by kevin1990 - 24.03.2015, 22:07
Re: Textdraw issue - by maximthepain - 24.03.2015, 22:17
Respuesta: Textdraw issue - by kevin1990 - 24.03.2015, 22:40
Re: Textdraw issue - by maximthepain - 24.03.2015, 22:55
Respuesta: Textdraw issue - by kevin1990 - 24.03.2015, 23:07
Re: Respuesta: Textdraw issue - by maximthepain - 25.03.2015, 00:51

Forum Jump:


Users browsing this thread: 1 Guest(s)