TextDraw Help
#1

Hey!
I have this 1 clickable textdraw and 10 cars.
I want to make it so each time i press on it it spectates each vehicle starting from 1st to 10th
and when it reaches the 10th one it starts again from 1.

How do i do that?
Reply
#2

I'm not really good at scripting but how about something like this.

Код:
new Float:CarCameras[][4] =
{
	{1751.1097,-2106.4529,13.5469,183.1979}, // CAM1
	{2652.6418,-1989.9175,13.9988,182.7107}; // CAM2

};

new tempvar = 0
public OnTextDrawClicked(playerid)
{
	if(tempvar => 2){
		tempvar = 0;
	}
	InterpolateCameraPos(playerid, [CarCameras[TempVar][1]], [CarCameras[TempVar][2]], [CarCameras[TempVar][3]] )
	tempvar = tempvar + 1;
}
// This is just a ruff thing (^^ I forgot the function names so i just named them as that, but you get my idea)
Reply
#3

this callback didn't exist x)

her's the callback you've looked for :

pawn Код:
public OnPlayerClickTextDraw(playerid, Text:clickedid)
Reply
#4

I managed to create a code,but now it only moves the camera from the player to car #1...

pawn Код:
public OnPlayerClickTextDraw(playerid, Text:clickedid)
{
    if(tempvar >= 11)
    {
        tempvar = 0;
    }
    InterpolateCameraPos(playerid,ICP[playerid][0],ICP[playerid][1],ICP[playerid][2],ICP[playerid][3],ICP[playerid][4],ICP[playerid][5],3000, CAMERA_MOVE);
    InterpolateCameraLookAt(playerid,ICLA[playerid][0],ICLA[playerid][1],ICLA[playerid][2],ICLA[playerid][3],ICLA[playerid][4],ICLA[playerid][5],3000,CAMERA_MOVE);
    tempvar = tempvar + 1;
    TogglePlayerControllable(playerid,0);
    return 1;
}
Reply
#5

removed
Reply
#6

BUMP!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)