Help me boys
#1

How to make from

PlayerTextDrawHide(playerid, Intro[playerid][0]);
PlayerTextDrawHide(playerid, Intro[playerid][1]);
PlayerTextDrawHide(playerid, Intro[playerid][2]);

This is 3 lines but how to make 1 line but it will hide all
Reply
#2

Use loop
Reply
#3

You can do it by looping.
pawn Код:
for(new i = 0; i < 3; i++)
    PlayerTextDrawHide(playerid, Intro[playerid][i]));
Or if you've got other codes and if you're referring to hide them or combine them into a function, you can search for creating functions or stocks. But the first option on this case would be using a loop.
Reply
#4

ok but what if i have 5 of 6 textdraws? sorry me no good at script
Reply
#5

Quote:
Originally Posted by Lordzy
Посмотреть сообщение
You can do it by looping.
pawn Код:
for(new i = 0; i < 3; i++)
    PlayerTextDrawHide(playerid, Intro[playerid][i]));
Or if you've got other codes and if you're referring to hide them or combine them into a function, you can search for creating functions or stocks. But the first option on this case would be using a loop.
Don't use statements like functions or stocks because they are not same
Reply
#6

Quote:
Originally Posted by Sreyas
Посмотреть сообщение
Don't use statements like functions or stocks because they are not same
In case if the same code segments are repeated elsewhere in script, I'd prefer combining them as a stock (as per PAWN defined). It could reduce copies of codes that are used more than once.
Reply
#7

help pls
Reply
#8

I modified Lordzy's code.

pawn Код:
for(new i = 0; i < sizeof(Intro[playerid]); i++)
    PlayerTextDrawHide(playerid, Intro[playerid][i]));
Reply
#9

Quote:
Originally Posted by Skimmer
Посмотреть сообщение
I modified Lordzy's code.

pawn Код:
for(new i = 0; i < sizeof(Intro[playerid]); i++)
    PlayerTextDrawHide(playerid, Intro[playerid][i]));
You might face an error, it should be : sizeof(Intro[]));
Reply
#10

FIXED
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)