Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - Phantom

#1
Its a pretty basic system. but you can improve it later on.
function onServerStart()
{
local DuelAr = false;
}

function onScriptLoad()
{
    DuelStats <- array( GetMaxPlayers(), null );
    DuelAr <- array( GetMaxPlayers(), null );
    DuelAr = false;
}

class DuelClass
{
Duel = false;
Dueling = -1;
DRequest = -1;
DKills = 0;
DK = 0;
}

function onPlayerJoin( player )
{
DuelStats[ player.ID ] = DuelClass();
}

function GetTok(string, separator, n, ...)
{
    local m = vargv.len() > 0 ? vargv[0] : n,
          tokenized = split(string, separator),
          text = "";

    if (n > tokenized.len() || n < 1) return null;
    for (; n <= m; n++)
    {
        text += text == "" ? tokenized[n-1] : separator + tokenized[n-1];
    }
    return text;
}

function Unf2( playerID )
{
local player = FindPlayer(playerID);
player.Pos = Vector(-264.459, -815.077, 1211.09);
player.Angle = 0.0553603;
player.Frozen = false;
MessagePlayer("Duel Started",player);
}

function Unf( playerID )
{
local player = FindPlayer(playerID);
player.Pos = Vector(-264.537, -787.858, 1211.15);
player.Angle = -3.14039;
player.Frozen = false;
MessagePlayer("Duel Started",player);
}

function onPlayerCommand( player, cmd, text ){
if ( cmd == "duel" )
{
if( !text ) MessagePlayer( "/Duel <Name/ID>", player );
else if ( DuelStats[ player.ID ].Duel ) MessagePlayer("[ERROR]You are already in a duel.", player );
else if ( DuelAr == true ) MessagePlayer("Duel Arena is full.",player);
else
{
local plr = FindPlayer( GetTok( text, " ", 1 ) );
if ( !plr ) MessagePlayer( "Invalid Player.", player );
else if ( player.ID == plr.ID ) MessagePlayer( "You can't duel yourself.", player );
else if ( DuelStats[ plr.ID ].Duel ) MessagePlayer( "That player is already dueling.", player );
else if ( DuelStats[ plr.ID ].DRequest != -1 ) MessagePlayer( "That player has already a duel request.", player );
else
{
DuelStats[ plr.ID ].DRequest = player.ID;
MessagePlayer( "You sent a duel request to " + plr.Name + ".", player );
MessagePlayer( player.Name + " sent you a duel request,you can /acduel or /deduel ", plr );
}
}
}
else if ( cmd == "acceptduel" || cmd == "acduel" )
{
if ( DuelStats[ player.ID ].DRequest == -1 ) MessagePlayer( "[ERROR]You dont have a pending duel.", player );
else
{
local plr = FindPlayer(  DuelStats[ player.ID ].DRequest.tointeger() );
DuelStats[ plr.ID ].DRequest = -1;
DuelStats[ plr.ID ].Duel = true;
DuelStats[ plr.ID ].Dueling = player.ID;
DuelStats[ player.ID ].DRequest = -1;
DuelStats[ player.ID ].Duel = true;
DuelStats[ player.ID ].Dueling = plr.ID;
plr.Eject();
plr.Pos = Vector(-264.537, -787.858, 1211.15);
plr.Angle = -3.14039;
plr.Frozen = true;
Announce( "Duel will start in 10 secs.", plr, 6 );
NewTimer( "Unf", 5000, 1, plr.ID );
player.Eject();
player.Pos = Vector(-264.459, -815.077, 1211.09);
player.Angle = 0.0553603;
player.Frozen = true;
Announce( "Duel will start in 10 secs.", player, 6 );
NewTimer( "Unf2", 5000, 1, player.ID );
DuelAr = true;
Message( player.Name +" is now in duel against " + plr.Name );
}
}
else if ( cmd == "denyduel" || cmd == "deduel" )
{
if ( DuelStats[ player.ID ].DRequest == -1 ) Error_MSG( "You dont have a pending duel request.", player );
else
{
local plr = FindPlayer( DuelStats[ player.ID ].DRequest.tointeger() );
DuelStats[ player.ID ].DRequest = -1;
DuelStats[ player.ID ].Duel = false;
DuelStats[ player.ID ].Dueling = -1;
DuelStats[ plr.ID ].DRequest = -1;
DuelStats[ plr.ID ].Duel = false;
Message( player.Name +" denied " + plr.Name + "'s duel request" );
}
}
}

function onPlayerTeamKill( killer, player, reason, bodypart )
{
if ( DuelStats[ player.ID ].Duel && DuelStats[ killer.ID ].Duel && DuelStats[ player.ID ].Dueling == killer.ID && DuelStats[ killer.ID ].Dueling == player.ID && DuelStats[ killer.ID ].DKills >= 4 )
{
Message(killer.Name + " has won the duel against " + player.Name );
DuelStats[ player.ID ].DRequest = -1;
DuelStats[ player.ID ].DKills = 0;
DuelStats[ killer.ID ].DKills = 0;
DuelStats[ killer.ID ].Duel = -1;
DuelStats[ player.ID ].Duel = false;
DuelStats[ killer.ID ].Duel = false;
DuelStats[ player.ID ].Dueling = -1;
DuelStats[ killer.ID ].Dueling = -1;
DuelAr = false;
}
else if ( DuelStats[ player.ID ].Duel && DuelStats[ killer.ID ].Duel && DuelStats[ player.ID ].Dueling == killer.ID && DuelStats[ killer.ID ].Dueling == player.ID )
{
DuelStats[ killer.ID ].DKills += 1;
Announce( "~w~Duel Resulte: ~b~" + DuelStats[ killer.ID ].DKills + "~w~ - ~b~ " + DuelStats[ player.ID ].DKills, killer, 6 );
Announce( "~w~Duel Resulte: ~b~" + DuelStats[ player.ID ].DKills + "~w~ -  ~b~ " + DuelStats[ killer.ID ].DKills, player, 6 );
Message( "[DUEL]> " + killer.Name + "killed " + player.Name + " with a shot in " + GetBP( bodypart ) + " with " + GetWeaponName( reason ) + ". Duel result: " + DuelStats[ killer.ID ].DKills + " - " + DuelStats[ player.ID ].DKills );
}
}

function onPlayerKill( killer, player, reason, bodypart )   
{
if ( DuelStats[ player.ID ].Duel && DuelStats[ killer.ID ].Duel && DuelStats[ player.ID ].Dueling == killer.ID && DuelStats[ killer.ID ].Dueling == player.ID && DuelStats[ killer.ID ].DKills >= 4 )
{
Message(killer.Name + " has won the duel against " + player.Name );
DuelStats[ player.ID ].DRequest = -1;
DuelStats[ player.ID ].DKills = 0;
DuelStats[ killer.ID ].DKills = 0;
DuelStats[ killer.ID ].Duel = -1;
DuelStats[ player.ID ].Duel = false;
DuelStats[ killer.ID ].Duel = false;
DuelStats[ player.ID ].Dueling = -1;
DuelStats[ killer.ID ].Dueling = -1;
DuelAr = false;
}
else if ( DuelStats[ player.ID ].Duel && DuelStats[ killer.ID ].Duel && sDuelStats[ player.ID ].Dueling == killer.ID && DuelStats[ killer.ID ].Dueling == player.ID )
{
DuelStats[ killer.ID ].DKills += 1;
Announce( "~w~Duel Resulte: ~b~" + DuelStats[ killer.ID ].DKills + "~w~ - ~b~ " + DuelStats[ player.ID ].DKills, killer, 6 );
Announce( "~w~Duel Resulte: ~b~" + DuelStats[ player.ID ].DKills + "~w~ -  ~b~ " + DuelStats[ killer.ID ].DKills, player, 6 );
Message( "[DUEL-INFO]> " + killer.Name + " killed " + player.Name + " with a shot in " + GetBP( bodypart ) + " with " + GetWeaponName( reason ) + ". Duel result: " + DuelStats[ killer.ID ].DKills + " - " + DuelStats[ player.ID ].DKills );
}
}

function onPlayerSpawn( player )
{
NewTimer( "DuelSpawn", 1000, 1, player.ID );
}

function DuelSpawn( playerID )
{
local player = FindPlayer( playerID );
if ( player && DuelStats[ player.ID ].Duel )
{
local plr = FindPlayer( DuelStats[ player.ID ].Dueling.tointeger() );
player.Pos = Vector(-264.537, -787.858, 1211.15);
player.Angle = -3.14039;
plr.Pos = Vector(-264.459, -815.077, 1211.09);
plr.Angle = 0.0553603;
player.Health = 100;
plr.Health = 100;
player.Armour = 0;
plr.Armour = 0;
}
}

function GetBP( part )
{
local group;
if ( part == 0 ) group = "Body";
else if ( part == 1 ) group = "Torso";
else if ( part == 2 ) group = "Left Arm";
else if ( part == 3 ) group = "Right Arm";
else if ( part == 4 ) group = "Left Leg";
else if ( part == 5 ) group = "Right Leg";
else if ( part == 6 ) group = "Head";
else if ( part == 7 ) group = "Vehicle";
else group = "Unknown";
return group;
}

here is the map file link: https://drive.google.com/file/d/1W7ft0l7Ni8HF0vcjvRkr3oFK4S4nRqqH/view?usp=drive_link

Feel Free to modify and improve it.
#2
Script Showroom / Re: RomaniaRoleplay
Dec 09, 2024, 03:16 PM
Quote from: UncleRus on Dec 06, 2022, 07:57 AMIts a NicusorN5 version Romania Roleplay but i stupid man create in github GitHub
For a "Stupid Man", you created a pretty good roleplay server with quite a few decent features. Nice Work imo
#3
Quote from: husnainaligee on Jul 15, 2021, 03:10 PMevery link of scripts is expire
Blame Dosya for that
#4
Quote from: KrOoB_ on Jul 15, 2021, 11:55 PM
Quote from: husnainaligee on Jul 15, 2021, 03:10 PMevery link of scripts is expire
https://dosya.co/e8z5gtfs0af7/Inventory_Blank.7z.html
try this one

*Link Updated


maybe try to upload it in a different file upload web, other than dosya.
#5
Quote from: Abbas_905 on Jul 14, 2024, 01:43 AMHello Everyone
I want your smalll help,
need adminmod,apark command for admins
can you be a bit more specific about what you ACTUALLY need?
#6
Script Showroom / Re: Transferstats Command
Nov 28, 2024, 08:32 AM
Good job stealing someone else's command, dickwad
#7
Script Showroom / Re: Set Grapics Command!
Jun 01, 2023, 05:11 PM
bro just took a random heal command and renamed it to grapics cmd XD
#8
Script Showroom / Re: Ban System
May 26, 2023, 11:16 AM
Quote from: H.a.S.a.N on Mar 15, 2023, 07:18 PMhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh
this for ban ip player
not in account
this low
 ;D  ;D  XD

Atleast he made something
#9
Lmao you just stole MarineForce's Cop system and reposted it