[Include] [INC] Game of Thrones intro for SA:MP
#1

What is this?

If you're a fan of a Game of Thrones series (based on A Song of Ice and Fire books by George R. R. Martin), then you know what this might be, but if you're not a fan of it, then watch the video (link is below).



Video:

Click here for the official Game Of Thrones show intro.

Example in SA-MP:

(Click on the image for the video)

Some old works which are based on the same include:
https://*****.com/48819234 (castles)
https://*****.com/66466911 (temple island)
https://*****.com/48567699 (include testing #1)
https://*****.com/48607504 (include testing #2)



Credits:

- Incognito for streamer plugin,
- Y_Less for foreach/iterator include.



How to use?

It's easy and simple - download and put the gtint.inc into the \pawno\include\ folder. Do the same thing with the foreach.inc and streamer.inc files. Put your streamer plugin (dll/so) into the \plugins\ folder.

Open your script and put this:
pawn Code:
#include <foreach>
#include <streamer>
#include <gtint>
right after the
pawn Code:
#include <a_samp>


Functions and callbacks:

Code:
// Functions.
CreateGTCamera(gtintroid, Float:x, Float:y, Float:z, Float:x2, Float:y2, Float:z2, time_move, time_wait);
IsGTIntroCreated(gtintroid);
SetCameraMoveTime(gtintroid, gtcamid, time);
GetCameraMoveTime(gtintroid, gtcamid);
SetCameraWaitTime(gtintroid, gtcamid, time);
GetCameraWaitTime(gtintroid, gtcamid);
GetCameraObjectCount(gtintroid, gtcamid);
CreateGTObject(gtintroid, gtcamid, modelid, Float:x, Float:y, Float:z, Float:rx, Float:ry, Float:rz, Float:x2, Float:y2, Float:z2, Float:rx2, Float:ry2, Float:rz2, Float:speed);
SetGTObjectMaterial(gtobjid, m_index, modelid, txdname[], texturename[]);
SetPlayerGTIntro(playerid, gtintroid, url[] = "");
EndPlayerGTIntro(playerid);
GetPlayerIntroID(playerid);
GetPlayerCameraID(playerid);
Code:
// Callbacks.
OnGTIntroCameraMove(playerid, gtintroid, gtcamid);

Examples:

Code:
// Examples.
#define INTRO_TEST_1 (0)

new
		gCamera;

public OnGameModeInit()
{
	/*
	* First camera will move towards second camera with the 2 seconds moving time
	* and the first camera will wait 5 seconds before going to the second camera.
	*
	* Since there is no camera after the second camera, that means that second
	* camera is the last camera, the ending camera.
	*
	* Three objects with model 18809 will be created.
	*
	* First object (for an example) will move from position -50.0, -50.0, 500.0 to position -60.0, -60.0, 510.0,
	* and the object will rotate from rotation 0.0, 0.0, 1.0 to rotation 0.0, 0.0, 360.0.
	* All that will happen with the speed of 5.0.
	*/

	gCamera = CreateGTCamera(INTRO_TEST_1, 81.94, 112.38, 611.69, 78.97, 108.36, 610.47, 2, 5);

	CreateGTObject(INTRO_TEST_1, gCamera, 18809, -50.0, -50.0, 500.0, 0.0, 0.0, 1.0, -60.0, -60.0, 510.0, 0.0, 0.0, 360.0, 5.0);
	CreateGTObject(INTRO_TEST_1, gCamera, 18809, -60.0, -60.0, 510.0, 0.0, 0.0, 1.0, -70.0, -70.0, 520.0, 0.0, 0.0, 360.0, 5.0);
	CreateGTObject(INTRO_TEST_1, gCamera, 18809, -70.0, -70.0, 520.0, 0.0, 0.0, 1.0, -50.0, -50.0, 500.0, 0.0, 0.0, 360.0, 5.0);

	CreateGTCamera(INTRO_TEST_1, -37.68, 125.22, 561.97, -35.71, 120.71, 562.87, 0, 0);

	/*****/

	if(IsGTIntroCreated(INTRO_TEST_1))
	{
		// Do something.
	}

	/*****/

	SetCameraMoveTime(INTRO_TEST_1, gCamera, 5);
	printf("Moving time: %i", GetCameraMoveTime(INTRO_TEST_1, gCamera));

	SetCameraWaitTime(INTRO_TEST_1, gCamera, 10);
	printf("Waiting time: %i", GetCameraWaitTime(INTRO_TEST_1, gCamera));

	/*****/

	new
			gt_object = CreateGTObject(INTRO_TEST_1, gCamera, 18809, -50.0, -50.0, 500.0, 0.0, 0.0, 1.0, -60.0, -60.0, 510.0, 0.0, 0.0, 360.0, 5.0);
	SetGTObjectMaterial(gt_object, 0, 8839, "vgsecarshow", "lightblue2_32");
	SetGTObjectMaterial(gt_object, 1, 8839, "vgsecarshow", "lightgreen2_32");
	SetGTObjectMaterial(gt_object, 2, 8839, "vgsecarshow", "lightyellow2_32");
	return true;
}

public OnGTIntroCameraMove(playerid, gtintroid, gtcamid)
{
	if(gtintroid == INTRO_TEST_1)
	{
		if(gtcamid == gCamera)
		{
			// Do something.
		}
	}
	return true;
}

Definitions:

pawn Code:
#define MAX_GT_INTROS (2)
#define MAX_GT_CAMERAS (5) // Per intro.
#define MAX_OBJECTS_PER_CAMERA (300) // Per camera.
#define MAX_GT_TEXTURES (3) // Per object.


Other:

You can collect the camera coordinates by using this script.



Download:

Reply
#2



Nice job
Reply
#3

This include file is updated:
Z-offset is no longer supported. First x, y and z coordinates along with rx, ry and rz rotation in CreateGTObject function are the starting coordinates and rotation for the object, the second x, y and z coordinates along with rx, ry and rz rotation are the finishing coordinates and rotation for the object.

Video: https://*****.com/48607504
Download link: http://www.solidfiles.com/d/0be311dd61
Reply
#4

done
Reply
#5

Interesting.
Reply
#6

good job
Reply
#7

Include is updated.

- PVars are turned to PAWN variables,
- PlayerObjects are turned to DynamicObjects,
- support for textures is now available.

All objects and their properties are stored in variables in this version. That could result in big .amx file if you decide you want to have a lot of objects and textures. Storing all that may not be needed always, but I still wanted to updated this old include and add everything I did. But I'll still release a new version soon, without ability to store objects and their properties. Creation of those can easily be handled in the "OnGTIntroCameraMove" callback.
Reply
#8

Fino fino, rep
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)