Vice City: Multiplayer

Server Development => Scripting and Server Management => Script Showroom => Topic started by: Xann^ on Aug 12, 2023, 11:01 AM

Title: [Gamemode] Battle
Post by: Xann^ on Aug 12, 2023, 11:01 AM
Functions:
Snippet has been made by Xann, a very simple and basic usage!

//Classes//

class Assault
{
Assault = null;
}

//==============FUNCTIONS=================//

function onAssault()
{
Assault = true;
}

function offAssault()
{
Assault = false;
}

function Respawn(player)
    {
       
        if ( onAssault )
{
            player.Pos = Vector(-1759.98, -193.022, 14.8683);
        }
    }

 //onPlayerSpawn

function onPlayerSpawn( player )
{
if ( onAssault )
{
Respawn(player);
}
}
 
   //Commands
if ( cmd == "battle" )
 {
if(!text) MessagePlayer( "Error - Correct syntax - /battle <join/leave>' !",player );
else
{
 if( text == "join" )
  {
onAssault();
player.World = 2;
Message( "[#FFFFFF]* " + player.Name + " Has joined the Battle!" );
player.Pos = Vector(-1759.98, -193.022, 14.8683);
  }

else if ( text == "leave" )
{
offAssault();
player.World = 0;
Message( "[#FFFFFF]* " + player.Name + " has left the battle" );
}
 }
 }
else if( cmd == "cmds" )
{
MessagePlayer("Gamemode: Battle", player );
MessagePlayer("Commands: Battle(join/leave)", player );
}
else if( cmd == "credits" )
{
MessagePlayer( "[#FFFFFF]Snippet made by Xann.",player );
return 0;
}

Note: Ignore my mistakes, as being a newbie over here posting my snippet/script.

Gamemode: This is called a gamemode, because honestly you can just use this as a battle gamemode, where you can play, duel whatever you wanna, everything is basic.

Suggestion: I do suggest you to use MR.SK's Spawnwep system for this.
Title: Re: [Gamemode] Battle
Post by: Xann^ on Aug 12, 2023, 11:06 AM
Credits: Sebyy(Sebastian)

I have used his, function onPlayerSpawn
Title: Re: [Gamemode] Battle
Post by: habi on Aug 12, 2023, 01:20 PM
Good.
Title: Re: [Gamemode] Battle
Post by: H.a.S.a.N on Aug 13, 2023, 01:35 PM
Good job 👍
Title: Re: [Gamemode] Battle
Post by: Abbas_905 on Mar 03, 2024, 03:09 AM
Nice good job!