Camera before class selection. -
TheKingWillem - 14.07.2010
I'm trying to figure out how to put the camera somewhere, before the class selection. So for example when you enter the server, the camera will hang on a xx spot, and after 5 seconds you will go to class selection. But i really cant figure out how to do that.
Re: Camera before class selection. -
Pghpunkid - 14.07.2010
Basically, if i am not mistaken, on OnPlayerRequestClass you return 0 for 5 seconds then allow it to return 1 again. I think, haven't done this but suggest be tried.
Re: Camera before class selection. -
ViruZZzZ_ChiLLL - 14.07.2010
Well I kinda don't understand you but try this under OnPlayerConnect :
pawn Code:
public OnPlayerConnect(playerid
{
SetTimerEx("LOL", 1000/10, false, "i", playerid)
return 1;
}
forward LOL(playerid);
public LOL(playerid)
{
SetCameraPos(....)
....
return 1;
}
You get my point
Why set a timer?
I tried it without a timer just plain put the Camerapos under on connect,
didn't work :P so set a timer
Re: Camera before class selection. -
Finn - 14.07.2010
Quote:
Originally Posted by Pghpunkid
Basically, if i am not mistaken, on OnPlayerRequestClass you return 0 for 5 seconds then allow it to return 1 again. I think, haven't done this but suggest be tried.
|
This is what you should do.
If you want to hide the selection ({<<} {>>} {SPAWN}), you have to mess with spectating, when you set player to spectate something, those dialogs should disappear.
TogglePlayerSpectating. You could also check Grand Larceny gamemode.
Re: Camera before class selection. -
TheKingWillem - 14.07.2010
Timer shit didnt work, i'm confused:S
Re: Camera before class selection. -
ViruZZzZ_ChiLLL - 14.07.2010
Quote:
Originally Posted by TheKingWillem
Timer shit didnt work, i'm confused:S
|
I don't know, this shit kinda worked for me :
pawn Code:
public OnPlayerConnect(playerid)
{
SetTimerEx("OnPlayerConnectView", 1000/2/2, false, "i", playerid);
return 1;
}
forward OnPlayerConnectView(playerid);
public OnPlayerConnectView(playerid)
{
SetPlayerFacingAngle(playerid, 54.038623);
SetPlayerCameraLookAt(playerid, 2459.469238, -1651.988525, 13.437360);
SetPlayerCameraPos(playerid, 2459.469238 + (10 * floatsin(-54.038623, degrees)), -1651.988525 + (10 * floatcos(-54.038623, degrees)), 13.437360);
return 1;
}
Re: Camera before class selection. -
TheKingWillem - 14.07.2010
Yes it kinda works, the camera is on a different spot, but it still is on the class selection.
Re: Camera before class selection. -
ViruZZzZ_ChiLLL - 14.07.2010
Quote:
Originally Posted by TheKingWillem
Yes it kinda works, the camera is on a different spot, but it still is on the class selection.
|
Oh, so what you want to do is, when you connect, the camera will be on a different spot
until on OnPlayerRequest class?
The spot won't change until you spawn?
Re: Camera before class selection. -
TheKingWillem - 14.07.2010
Let me explain. If you enter my server, the camera will hang in a different spot of the map, and showing some textdraw or something. After 5 seconds it should then go to class selection where u can choose a character.
Re: Camera before class selection. -
Finn - 14.07.2010
pawn Code:
new bool:beenspectating[MAX_PLAYERS];
forward spawnplayer(playerid);
public spawnplayer(playerid)
{
beenspectating[playerid] = true;
ForceClassSelection(playerid);
TogglePlayerSpectating(playerid, 0);
SpawnPlayer(playerid);
return 1;
}
public OnPlayerConnect(playerid)
{
beenspectating[playerid] = false;
return 1;
}
public OnPlayerRequestClass(playerid, classid)
{
if(beenspectating[playerid])
{
return 1;
}
else
{
SpawnPlayer(playerid);
TogglePlayerSpectating(playerid, 1);
// SetPlayerCameraPos, SetPlayerCameraLookAt, etc.
SetTimerEx("spawnplayer", 5000, false, "i", playerid);
return 0;
}
}
Should work. I scripted that in very short time so it might have bugs. I tested if it works, and it did.