One question.
#1

Hey guys here is the question - how is it possible to turn this.

Код:
new Text3D: Riffa1;
Riffa1 = Create3DTextLabel("Grovet",COLOR_GROVE,0,0,0,50,0);              //Grove Street
Attach3DTextLabelToVehicle(Riffa1, 1, 0.0,0.0,0.0+1.0);
new Text3D: Riffa2;
Riffa2 = Create3DTextLabel("Grove",COLOR_GROVE,0,0,0,50,0);            
Attach3DTextLabelToVehicle(Riffa2, 2, 0.0,0.0,0.0+1.0);
new Text3D: Riffa3;
Riffa3 = Create3DTextLabel("Grove",COLOR_GROVE,0,0,0,50,0);           
Attach3DTextLabelToVehicle(Riffa3, 3, 0.0,0.0,0.0+1.0);
In to a one line. I don't want to waste my time creating all these lines, and then if i add a car before them id have to change the entire thing. so can anyone help? thank you
Reply
#2

I think..
pawn Код:
new Text3D: Riffa1; Riffa1 = Create3DTextLabel("Grovet",COLOR_GROVE,0,0,0,50,0); Attach3DTextLabelToVehicle(Riffa1, 1, 0.0,0.0,0.0+1.0); new Text3D: Riffa2; Riffa2 = Create3DTextLabel("Grove",COLOR_GROVE,0,0,0,50,0); Attach3DTextLabelToVehicle(Riffa2, 2, 0.0,0.0,0.0+1.0); new Text3D: Riffa3; Riffa3 = Create3DTextLabel("Grove",COLOR_GROVE,0,0,0,50,0); Attach3DTextLabelToVehicle(Riffa3, 3, 0.0,0.0,0.0+1.0);
EDIT: Or use a stock
Reply
#3

pawn Код:
stock FuncName()
{
new Text3D: Riffa1;
Riffa1 = Create3DTextLabel("Grovet",COLOR_GROVE,0,0,0,50,0);              //Grove Street
Attach3DTextLabelToVehicle(Riffa1, 1, 0.0,0.0,0.0+1.0);
new Text3D: Riffa2;
Riffa2 = Create3DTextLabel("Grove",COLOR_GROVE,0,0,0,50,0);            
Attach3DTextLabelToVehicle(Riffa2, 2, 0.0,0.0,0.0+1.0);
new Text3D: Riffa3;
Riffa3 = Create3DTextLabel("Grove",COLOR_GROVE,0,0,0,50,0);          
Attach3DTextLabelToVehicle(Riffa3, 3, 0.0,0.0,0.0+1.0);
}
Reply
#4

is there any other way?
Reply
#5

Quote:
Originally Posted by [Comrade]
Посмотреть сообщение
is there any other way?
Either a stock or the way I first posted (which makes the script hard to read), else than that, I dont know any way and Im doubtful there is any. Becareful when you choose the IDs and that stuff so you don't have to change it all when you made a mistake.
Reply
#6

yeah thats what im trying to do, can you give me an example of a stock? for like this? how does it work?
Reply
#7

In my personal theory, stock is just like a function. It's a bunch of functions inside other function, like..
pawn Код:
OnPlayerConnect(playerid)
{
    WelcomePlayer();
}

stock WelcomePlayer();
{
        new string[50], pname[MAX_PLAYER_NAME];
    GetPlayerName(playerid, pname, sizeof(pname));
    format(string, sizeof(string), "%s has joined the server", pname);
    SendClientMessageToAll(COLOR_YELLOW, string);
}
You can also add extra parameters like..

pawn Код:
WelcomePlayer(color);
But i yet dont know how to do that.
Reply
#8

all i really wanted to do was add same Text to a bunch of cars without making aklot of lines like to cars whos ids are like from 0> <6
Reply
#9

Quote:
Originally Posted by [Comrade]
Посмотреть сообщение
all i really wanted to do was add same Text to a bunch of cars without making aklot of lines like to cars whos ids are like from 0> <6
Like this?
pawn Код:
if (vehicleid > 0 && vehicleid < 6)
{
    DoSomething();
}
Reply
#10

Quote:
Originally Posted by XePloiT
Посмотреть сообщение
pawn Код:
stock FuncName()
{
new Text3D: Riffa1;
Riffa1 = Create3DTextLabel("Grovet",COLOR_GROVE,0,0,0,50,0);              //Grove Street
Attach3DTextLabelToVehicle(Riffa1, 1, 0.0,0.0,0.0+1.0);
new Text3D: Riffa2;
Riffa2 = Create3DTextLabel("Grove",COLOR_GROVE,0,0,0,50,0);            
Attach3DTextLabelToVehicle(Riffa2, 2, 0.0,0.0,0.0+1.0);
new Text3D: Riffa3;
Riffa3 = Create3DTextLabel("Grove",COLOR_GROVE,0,0,0,50,0);          
Attach3DTextLabelToVehicle(Riffa3, 3, 0.0,0.0,0.0+1.0);
}
i don't get 'ya... you want a stack? here i made one for you ^
or what you want?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)