Can I remove spawnscreen on death ?

Started by Mötley, Mar 10, 2016, 08:32 PM

Previous topic - Next topic

Mötley

Personally I find this setting ugly!

There has to be some type of way to disable on death.

And! without doing something nasty, possibly messing up bandwidth etc.
 I don't want anything nasty.
____________
I also want to script the spawn screen(camera matrix) to set random spawnscreens(possibly).

Already removed vehicles from server.config file and scripted those in (why? I found doing this allows full control over vehicles)
so this would be helpful to eliminate the server.config file and take control of the server with a ini file to turn functions/settings/values on and off..
That is the logic of this build, so i am pleased to receive help with the topic .

.

I'm sorry but what do you mean? You don't want to show the fade screen when your character dies or you don't want to go to the class selection screen (lobby) after your character dies? Because there are ways around that.

function ForceSpawn(player)
{
    // Forced spawning
    //player.Spawn();
    // Forced character selection
    //player.Select();
}

function onPlayerDeath(player, reason)
{
    ForceSpawn(player);
}

function onPlayerTeamKill(killer, player, reason, body_part)
{
    ForceSpawn(player);
}

function onPlayerKill(killer, player, reason, body_part)
{
    ForceSpawn(player);
}
.

Mötley

#2
Not solved Just got around to testing more and this is not doing the trick.

The spawn screen is messing a lot up in the server.

on /login
Delete/overwrites your last saved pos
deletes all of your weapons.
Overwrites skin saves.
will sometimes overwrite saved health and Armour to 0 on spawn causing instant death
I think there is more i am not sure.

I cant send a player to the nearest hospital due to this as even it i did something like

if (!player.Spawned) player.Spawn();
as it would send the player to the character spawn location rather than the nearest hospital.

I would like to seek support to being capable of turning the spawn screen off!!!
I will just use
Player.SetCameraPos and freeze the player until he logs in
Once login is detected unfreeze and load positions, etc

 
I personally see that the spawn screen has bugs.
This is only useful if you have a Death match server as you do not need everything I am using.

DizzasTeR

You just need to repeat a condition on the two events onPlayerRequestClass and onPlayerRequestSpawn like so:

function onPlayerRequestClass( player, classID, skin, team ) {
     if( !isLoggedIn(player) ) {
        // He is not logged in, tell him to login first.
       return 0;
    }
    return 1; // Yes he is logged in so spawn him
}

function onPlayerRequestSpawn( player )
{
    if( !isLoggedIn(player) ) {
        // He is not logged in, tell him to login first.
       return 0;
    }
    return 1; // Yes he is logged in so spawn him
}

function onPlayerSpawn( player )
{
    // Now the player instantly spawns after death and only if he/she is logged in
}

Un-tested, just gave you the idea of how I use it in my script.

Mötley

This is a very interesting code!!!

Thank you as I have been attempting to  write a correct function that is professional ^ I LIKE THAT :D

Mötley

#5
SomeTimes I am dumb!!! and need help. ^ Once again Thanks.

Now building my own spawn-screen, Freeze the player, Validate the login if true un-freeze, restore the camera and get the data from the account
 will be fun
:D

function onPlayerRequestClass( player, classID, skin, team )
{
if (!player.Spawned) player.Spawn();
}

Didnt see that function or missed it in the wiki as i over thought This :P

THANKS!! :D

Edit didnt build the spawnscreen BUT I Did create random positions on spawns at hospitals :D

KAKAN

Quote from: S.L.C on Mar 10, 2016, 08:38 PMI'm sorry but what do you mean? You don't want to show the fade screen when your character dies or you don't want to go to the class selection screen (lobby) after your character dies? Because there are ways around that.
You don't need to that much of code. There's a function for it: http://wiki.vc-mp.org/wiki/Scripting/Squirrel/Functions/SetWastedSettings
SetWastedSettings( 0, 0, 0, 0, RGB(0,0,0), 0, 0); :P That might be what Motley is looking for.
oh no

Mötley

For those that want a little help when it refers to giving a player there account related items, the fix I used is the same I had In LU I just did not think to well with all the scripting I was doing at that time.

The fix for keeping the spawn screen would have to be,

function onPlayerSpawn(player, spawn) {
 
  if (Account[player.ID].Logged == true) {
    //Lets give the player there positions
    //Lets give the player there saved armour
    //Lets give the player there saved wanted level
    //Lets give the player there saved skin
    //Lets give the player there saved weapons so the spawn screen wont erase them   
    //Lets give the player other spawn related features
  }
 
  return true;
}

If the player managed to spawn before logging in there account related items will still load if you make sure to load these items with your login function. I also suggest if you do not have a team death-match you should add this when a player successfully logs in
if (!player.Spawned) player.Spawn();
and only make this call to load the rest of the account related items when the player spawns. That was my preference.

*I don't like team death-match, basically almost every server in VCMP is team death-match