SA-MP Forums Archive
[Tutorial] PridatKameru (Add Camera) - 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)
+---- Forum: Tutorials (https://sampforum.blast.hk/forumdisplay.php?fid=70)
+---- Thread: [Tutorial] PridatKameru (Add Camera) (/showthread.php?tid=208786)



PridatKameru (Add Camera) - burysek - 09.01.2011

Excuse my English .. I'm from Czech Republic .. And I can not English

My TUT concerns that we create a camera with a single line ...
And then you'll get a dialogue to choose which camera you want to watch ...
Suitable as the DP for monitoring streets and roads for police, etc. .. It's a lot of use ...


Maybe you will feel that it is copied from the samp-forum .... From this I just got this idea because it's what I downloaded and edited by me .. even rammed the original so I decided to do this ...


Funkce
Code:
PridatKameru(Jmeno[],Float:PoziceKameryX,Float:PoziceKameryY,
Float:PoziceKameryZ,Float:PohledKameryX,Float:PohledKameryY,Float:PohledKameryZ);
Popisek

Jmeno[] - Name od Camera....např... "Test" , "Los Santos"...
PoziceKameryX - Camera positiony X
PoziceKameryY - Camera position Y
PoziceKameryZ - Camera position Z
PohledKameryX - View Cameras X
PohledKameryY - View Cameras Y
PohledKameryZ - View Cameras Z


Přнklad:
Code:
PridatKameru("Zkouљka",1175.1573,-1994.1238,70.2576,1681.9150,-1353.7527,159.6641);
Souřadnice zjistнme nбsledovně

We go to the game and save your position using /save KameraPozice

And we'll go to the place where you should look at the camera and let /save KameraPohled

If you have a newer SA-MP than 0.2x then go to Documents->Gta User Files->SAMP->savedpositions.txt...

There you will find something like this:


AddPlayerClass(1,1175.1573,-1994.1238,70.2576,331.6336,0,0,0,0,0,0); // KameraPozice

1175.1573 - Naљe PoziceKameryX
-1994.1238 - Naљe PoziceKameryY
70.2576 - Naљe PoziceKameryZ


AddPlayerClass(1,1681.9150,-1353.7527,159.6641,232.1873,0,0,0,0,0,0); // KameraPohled

1681.9150 - Naљe PohledKameryX
-1353.7527 - Naљe PohledKameryY
159.6641 - Naљe PohledKameryZ



And now that we have the coordinates, we can embark Scripts =))...
Definice
Code:
#define MAX_KAMER     50   //Kolik je moћno Max.Kamer...
#define ID_DIALOGU 5959 //ID Dialogu pro zobrazenн Kamer...
#define BILA	 0xFFFFFFAA //Definice Bнlй barvy...
ENUMY
Code:
enum Kamerky{
JmenoKamery[50],
Float:XPoziceKamery,
Float:YPoziceKamery,
Float:ZPoziceKamery,
Float:XPohledKamery,
Float:YPohledKamery,
Float:ZPohledKamery,
ID
};
NEW
Code:
new Kamery=-1;
new Kamera[MAX_KAMER][Kamerky];
Attention! - New ... let the Enum is Enum is loaded before the New

STOCK

Here's the main thing STOCK =D:
Code:
stock PridatKameru(Jmeno[], Float:PoziceKameryX, Float:PoziceKameryY, Float:PoziceKameryZ,Float:PohledKameryX,Float:PohledKameryY,Float:PohledKameryZ)
{
Kamery++;
format(Kamera[Kamery][JmenoKamery],50,"%s",Jmeno);
Kamera[Kamery][XPoziceKamery] = PoziceKameryX;
Kamera[Kamery][YPoziceKamery] = PoziceKameryY;
Kamera[Kamery][ZPoziceKamery] = PoziceKameryZ;
Kamera[Kamery][XPohledKamery] = PohledKameryX;
Kamera[Kamery][YPohledKamery] = PohledKameryY;
Kamera[Kamery][ZPohledKamery] = PohledKameryZ;
Kamera[Kamery][ID] = Kamery;
return 1;
}
OnDialogResponse
Code:
if(dialogid == ID_DIALOGU)
{
if(response == 1)
{
if(listitem == Kamera[listitem][ID])
{
format(string, sizeof(string), "Kamera ==> %s", Kamera[listitem][JmenoKamery]);
SendClientMessage(playerid, BILA, string);//Poљleme hrбči zprбvu na kterou kameru se dнvб...
SetPlayerCameraPos(playerid,Kamera[listitem][XPoziceKamery],
Kamera[listitem][YPoziceKamery],Kamera[listitem][ZPoziceKamery]);//Nastavнme Pozici Kamery
SetPlayerCameraLookAt(playerid, Kamera[listitem][XPohledKamery],Kamera[listitem][YPohledKamery],
Kamera[listitem][ZPohledKamery]);//Nastavнme Kam Se Bude Kamera Dнvat
}
}
}
OnPlayerCommandText

2 Simple instructions for initiating dialogue and stop browsing ...
Code:
if(!strcmp(cmdtext, "/kamery", true))
{
new string2[500];
format(string2, 500, "");
for(new i=0;i<=Kamery;i++)
{
format(string2,500, "%s%s\n",string2,Kamera[i][JmenoKamery]);
}
ShowPlayerDialog(playerid,ID_DIALOGU,DIALOG_STYLE_LIST, "Kamery",string2,"Podнvat", "Nedнvat");
return 1;
}
if(!strcmp(cmdtext, "/nedivat", true)) {
SpawnPlayer(playerid);
return 1;
}
That's all .... I tried the camera and went 2-3 in cool and I hope that you will use it ...

For me, it was found that it was using the players to look at things in fashion, etc. ..

Otherwise, good luck with scriptнkem error and if they were to write =))...



Sincerely,


burysek

Sorry..I donť speak English


Re: PridatKameru (Add Camera) - CaHbKo - 09.01.2011

To be honest, I didn't understand anything, except that this is something about cameras.


Re: PridatKameru (Add Camera) - luckie12 - 09.01.2011

Maybe u can use www.translate.******.com ?

or post in youre language forum?

sorry if linking is against the rules


Re: PridatKameru (Add Camera) - GiS - 09.01.2011

Well, thank you for this tutorial but it's pretty hard to understand it. It would be better if you post it in the right forum


Re: PridatKameru (Add Camera) - black_dota - 14.01.2011

omfg wtf useless tut i dont understand a fuck


Re: PridatKameru (Add Camera) - WebScript.Biz - 14.01.2011

If you donґt understand, try translate it with http://translate.******.com , Author of this , created this script and released on this forum too, and some people is scolding him... I agree with rules, but he write that: "Excuse my English .. I'm from Czech Republic .. And I can not English" . So he donґt speak english well and he only wanted to share this script with us


Re: PridatKameru (Add Camera) - justsomeguy - 16.01.2011

thank you! i just realise i got cctv!