22.05.2011, 16:37
Quote:
Alright, well I get several questions which could assist me with a tutorial for new players of a server.
|
Quote:
At first I would like to know how I can create something like a camerascreen for a tutorial like here.
|
Quote:
There you can see the LSPD without any Player infront of you. What kind of commands do I need for that?
|
Dont forget to set the world to 0 again if he spawns
Quote:
Second: I'd like to know how it's possible to make a movement of a camera if I got the screen of question one. Like for example the camera slowly flys around the LSPD building.
|
We create a function which call it self again till something happens (as example if the player spawns)
pawn Код:
forward TRotate(playerid, Float: X, Float: Y, Float: Z, Float: R, Float: A);
public TRotate(playerid, Float: X, Float: Y, Float: Z, Float: R, Float: A) {
if(GetPlayerState(player) == PLAYER_STATE_WASTED) {
SetCameraPos(playerid, X + (floatcos(A, degrees) * R), Y + (floatsin(A, degrees) * R), Z + 10);
SetTimerEx("TRotate", 100, false, "ifffff", playerid, X, Y, Z, R, A + 1.0);
}
}
Quote:
Third: How is it possible to make an image changing slowly like it slowly looses its oppacity? Let's say you got the image of the LSPD and now I want to change it to an image of the Cityhall. How can I make that it's not a fast changing of the image but a slow one like slowly the screen gets black and afterwards slowly the black screen disappears and looses its oppacity that the new image is visible?
|
And than change the camera pos / look at and afterwards let it go to 0 opacity again
pawn Код:
stock StartChange(playerid, Float: X, Float: Y, Float: Z, Float: cX, Float: cY, Float: cZ) {
new Text:gText = TextDrawCreate(0.0, 0.0, "_");
TextDrawUseBox(gText, true);
cbOpacity(playerid, gText, 0, false, X, Y, Z, cX, cY, cZ);
}
pawn Код:
forward cbOpacity(playerid, Text:tText, opacity, bool: down, Float: X, Float: Y, Float: Z, Float: cX, Float: cY, Float: cZ);
public cbOpacity(playerid, Text:tText, opacity, bool: down, Float: X, Float: Y, Float: Z, Float: cX, Float: cY, Float: cZ) {
TextDrawBoxColor(tText, opacity);
if(down) {
if(--opacity <= 0) {
TextDrawDestroy(tText);
return ;
}
} else {
if(++opacity >= 255) {
SetTimerEx("cbOpacity", 100, false, "iiib", playerid, _:tText, opacity, true);
SetPlayerCameraPos(playerid, cX, cY, cZ);
SetPlayerCameraLookAt(playerid, X, Y, Z);
return;
}
}
SetTimerEx("cbOpacity", 100, false, "iiib", playerid, _:tText, color, visible, X, Y, Z, cX, cY, cZ);
}