Something simple but doesn't work?
#1

Sup, I made a little piece of code.

pawn Код:
#define CAMX -1817.9412
#define CAMY 769.3878
#define CAMZ 132.6589
#define CAMLX -1300.8754
#define CAMLY 68.0546
#define CAMLZ 129.4823
pawn Код:
new MC;
pawn Код:
MC = SetTimer("MoveCam",33,true);
pawn Код:
SetPlayerCameraPos(playerid,CAMLX,CAMLY,CAMLZ);
    SetPlayerCameraLookAt(playerid,CAMX,CAMY,CAMZ);

pawn Код:
forward MoveCam(playerid);
public MoveCam(playerid)
{
    SetPlayerCameraLookAt(playerid,CAMX+50,CAMY+50,CAMZ+2);
    SetPlayerCameraPos(playerid,CAMLX+50,CAMLY+50,CAMLZ+2);
    return 1;
}
That is extremely simple. But the part I don't understand is; why doesn't the camera move?!

I try it on a blank Gamemode, still a frozen camera.
Reply
#2

I don't get it, what do you want to accomplish? a moving camera at the spawn?

Anyway, I suppose you have it in a timer?
Reply
#3

Quote:
Originally Posted by playbox12
Посмотреть сообщение
I don't get it, what do you want to accomplish? a moving camera at the spawn?

Anyway, I suppose you have it in a timer?
Oops, yeah I do, forgot to post the SetTimer.
Reply
#4

Quote:
Originally Posted by [FU]Victious
Посмотреть сообщение
Oops, yeah I do, forgot to post the SetTimer.
Alright, well I am not sure I will do some testing when I have time. Sorry.
Reply
#5

Quote:
Originally Posted by playbox12
Посмотреть сообщение
Alright, well I am not sure I will do some testing when I have time. Sorry.
Don't worry. Hopefully I'll fathom this out.
Reply
#6

ive tryed to help but i get these errors try fixing these
C:\Users\Lyn\Documents\LCRP\gamemodes\LCRP.pwn(12) : error 010: invalid function or declaration
C:\Users\Lyn\Documents\LCRP\gamemodes\LCRP.pwn(14) : error 021: symbol already defined: "SetPlayerCameraPos"
C:\Users\Lyn\Documents\LCRP\gamemodes\LCRP.pwn(25) : warning 203: symbol is never used: "MC"

ive put all your script in pawno are you sure that the whole scrippt there
Reply
#7

Quote:
Originally Posted by Snowman12
Посмотреть сообщение
ive tryed to help but i get these errors try fixing these
C:\Users\Lyn\Documents\LCRP\gamemodes\LCRP.pwn(12) : error 010: invalid function or declaration
C:\Users\Lyn\Documents\LCRP\gamemodes\LCRP.pwn(14) : error 021: symbol already defined: "SetPlayerCameraPos"
C:\Users\Lyn\Documents\LCRP\gamemodes\LCRP.pwn(25) : warning 203: symbol is never used: "MC"

ive put all your script in pawno are you sure that the whole scrippt there
On a BLANK piece of code. Not your GM.
Reply
#8

each 33miliseconds you are setting the camera pos to defined+50, without defining the new values.
put in the timer.
#undef x
#define x x+50
and so on.

I would use variables, the code could be smaller then.
Reply
#9

Quote:
Originally Posted by Macluawn
Посмотреть сообщение
each 33miliseconds you are setting the camera pos to defined+50, without defining the new values.
put in the timer.
#undef x
#define x x+50
and so on.

I would use variables, the code could be smaller then.
I shall try that later. Thanks :P
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)