How to remove spawn buttons -
smokeweed - 31.01.2012
Hey, how can I remove these spawn buttons on the bottom? I choose my team enz in dialogs:
Uploaded with
ImageShack.us
Thanks
[rep]
Re: How to remove spawn buttons -
MP2 - 31.01.2012
TogglePlayerSpectating.
Re: How to remove spawn buttons -
niels44 - 31.01.2012
i dont think thats possible... becouse it is something with the default settings of OnPlayerRequestClass... but maybe someone knows how.... but as far as i know this isnt possible.
EDIT: maybe he is right XD( but eehm shouldnt you explain how the toggleplayerspectating works? of show him a wiki of it?)
EDIT2: like this:
https://sampwiki.blast.hk/wiki/TogglePlayerSpectating
Re: How to remove spawn buttons -
fiki574 - 31.01.2012
SetSpawnInfo or SpawnPlayer!
Re: How to remove spawn buttons -
devil77771 - 31.01.2012
Good hack , man.
Re: How to remove spawn buttons -
MP2 - 31.01.2012
All that is necessary is this:
pawn Код:
#define ClearChat(%0) for(new i=0; i<20; i++) SendClientMessage(%0, -1, " ")
public OnPlayerRequestClass(playerid, classid)
{
SetSpawnInfo(playerid, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0); // Without this you'll be kicked when you spawn. Set it to wherever you want.
TogglePlayerSpectating(playerid, true);
SetTimerEx("login_dialog", 100, 0, "i", playerid);
return 1;
}
forward login_dialog(playerid);
public login_dialog(playerid)
{
SetPlayerCameraPos(playerid, x, y, z);
SetPlayerCameraLookAt(playerid, x, y, z);
// Show dialogs etc. here
ClearChat(playerid); // Custom macro to send some empty clientmessages
return 1;
}
Result:
http://www.movieserv.net/files/login_dialog.png
If you need messages in chat, remove the ClearChat() line, but I'd recommend keeping it clear as on low resolutions the chat ends up over the dialog.
To spawn players after that, it's extremely simple:
pawn Код:
TogglePlayerSpectating(playerid, false);
Re: How to remove spawn buttons -
milanosie - 31.01.2012
Will the script think the player is already spawned?
Cause I have my loading data for player positions at OnPlayerSpawn..
Will it override with the SpawnInfo?
Re: How to remove spawn buttons -
MP2 - 31.01.2012
SetSpawnInfo won't over-ride your SetPlayerPos in OnPlayerSpawn, afaik.
OnPlayerSpawn() shouldn't be called until you TogglePlayerSpectating off.
Re: How to remove spawn buttons -
MSI - 31.01.2012
Quote:
Originally Posted by MP2
All that is necessary is this:
pawn Код:
#define ClearChat(%0) for(new i=0; i<20; i++) SendClientMessage(%0, -1, " ")
public OnPlayerRequestClass(playerid, classid) { SetSpawnInfo(playerid, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0); // Without this you'll be kicked when you spawn. Set it to wherever you want. TogglePlayerSpectating(playerid, true); SetTimerEx("login_dialog", 100, 0, "i", playerid); return 1; }
forward login_dialog(playerid); public login_dialog(playerid) { SetPlayerCameraPos(playerid, x, y, z); SetPlayerCameraLookAt(playerid, x, y, z); // Show dialogs etc. here ClearChat(playerid); // Custom macro to send some empty clientmessages return 1; }
Result:
http://www.movieserv.net/files/login_dialog.png
If you need messages in chat, remove the ClearChat() line, but I'd recommend keeping it clear as on low resolutions the chat ends up over the dialog.
To spawn players after that, it's extremely simple:
pawn Код:
TogglePlayerSpectating(playerid, false);
|
Wow thats looks awesome! But how to get camera lookat and position? /save is for coords not for camera lookat?
Re: How to remove spawn buttons -
MP2 - 31.01.2012
I have a system on my server which uses the following commands:
/campos - Save your coordinates as the camera 'position'
/camlook - Save your coordinates as the camera 'lookat' coordinates
/cam - View the camera you just saved coordinates for
/camoff - SetCameraBehindPlayer();
/camsave - Writes the stored pos and lookat coordinates to a file
I also made /camedit which allows you to edit the camera with arrow keys.