Error trying to random a textdraw
#1

pawn Код:
TextDrawShowForPlayer(playerid, RandomTDs[random(sizeof(RandomTDs))]);
Error:
error 035: argument type mismatch (argument 2)

RandomTDs:
pawn Код:
new RandomTDs[][] =
{
    "Textdraw0",
    "Textdraw1",
    "Textdraw2",
    "Textdraw3",
    "Textdraw4",
    "Textdraw5"
};
Reply
#2

Hello barbarbar1,
please use the search function before open a new thread.
https://sampforum.blast.hk/showthread.php?tid=327709 - Tutorial by Dripac

https://sampforum.blast.hk/showthread.php?tid=501669 - Filterscript by Remba031

http://forum.sa-mp.com/showpost.php?...73&postcount=7 - Answer by Jeffrey

etc...
Reply
#3

Quote:
Originally Posted by GangstaaSunny
Посмотреть сообщение
Hello barbarbar1,
please use the search function before open a new thread.
https://sampforum.blast.hk/showthread.php?tid=327709 - Tutorial by Dripac

https://sampforum.blast.hk/showthread.php?tid=501669 - Filterscript by Remba031

http://forum.sa-mp.com/showpost.php?...73&postcount=7 - Answer by Jeffrey

etc...
This one is about changing the text in textdraws. I am speaking about changing the textdraws themselves by random.
Reply
#4

Better to use a switch function here, rather than an array

pawn Код:
switch ( random ( 5 ) )
{
    case 0: TextDrawShowForPlayer ( playerid , TextDraw1 );
    case 1: TextDrawShowForPlayer ( playerid , TextDraw2 );
    case 2: TextDrawShowForPlayer ( playerid , TextDraw3 );
    case 3: TextDrawShowForPlayer ( playerid , TextDraw4 );
    case 4: TextDrawShowForPlayer ( playerid , TextDraw5 );
}
Don't forget to hide the previous textdraw before you've shown the player the new one
Reply
#5

Hello barbarbar1,
its the same coding stuff. Just edit the functions.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)