SA-MP Forums Archive
TextDraw Help - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: TextDraw Help (/showthread.php?tid=507927)



TextDraw Help - [rG]Cold - 19.04.2014

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?


Re: TextDraw Help - 2K9CON - 19.04.2014

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)


Re : TextDraw Help - Ramoboss - 19.04.2014

this callback didn't exist x)

her's the callback you've looked for :

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



Re: TextDraw Help - [rG]Cold - 19.04.2014

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;
}



Re: TextDraw Help - 2K9CON - 19.04.2014

removed


Re: TextDraw Help - [rG]Cold - 20.04.2014

BUMP!