DI System

Started by =RK=MarineForce, Aug 26, 2019, 10:35 PM

Previous topic - Next topic

=RK=MarineForce


Commands: /packs,/pack,/put,/dpack

Class:
[noae][noae][noae]pack = false
 pack1 = false;
 pack2 = false;
 pack3 = false;
 pack4 = false;
 pack5 = false;
 pack6 = false;
 pack7 = false;
 w1 = false;
 w2 = false;
 w3 = false;
 w4 = false;
 w5 = false;
 w6 = false;
 w7 = false;
[/noae][/noae][/noae]

OnPlayerSpawn
[noae][noae][noae]NewTimer( "spack", 1000, 1, player.ID );[/noae][/noae][/noae]

OnPlayerCommands

[noae][noae][noae]if (cmd == "put")
{
if ( player.Cash < 200 ) MessagePlayer( "[#00de00]Info: [#fbf3f3]Error - You Need Alteast 250$", player );
else if (stats[player.ID].pack) MessagePlayer( "[#00de00]Info: [#fbf3f3]Error - You Already In", player );
else {
stats[player.ID].pack  = true;
player.Disarm()
player.Cash -= 200;
player.IsFrozen = true;
Message("[#00cc00]*** " + player.Name + " Set into Choice");
player.Pos = Vector(-681.544, 1205.18, 11.1089);
 NewTimer( "put", 10000, 1, player.ID );
 }
 }

if (cmd == "packs")
{
MessagePlayer("[#00de00]*** Pack 1: [#00ffff]M4,Pump-Shotgun",player);
MessagePlayer("[#00de00]*** Pack 2: [#00ffff]RPG,Stubby ",player);
MessagePlayer("[#00de00]*** Pack 3: [#00ffff]SniperRifle,molotov ",player);
MessagePlayer("[#00de00]*** Pack 4: [#00ffff]Katana,FlameThrower",player);
MessagePlayer("[#00de00]*** Pack 5: [#00ffff]M60,Stubby",player);
MessagePlayer("[#00de00]*** Pack 6: [#00ffff]Chainsaw,TearGas",player);
MessagePlayer("[#00de00]*** Special Pack 7: [#00ffff]Ruger,Pump-Shotgun,Instagram,Grenade ",player);
MessagePlayer("[#00de00]*** You can also buy some weapons using /wep",player);
}

if( cmd == "pack")
{
if(stats[player.ID].pack == false) MessagePlayer("[#ff0000] You Must Be in Choice ",player);
else if(!text) MessagePlayer("[#00ff00]*** /pack <1,2,3,4,5,6,7> ",player);
else{
if(text == "1")
{
stats[player.ID].pack1 = true;
player.Disarm();
player.SetWeapon(26, 9999);
player.SetWeapon(19, 9999);
MessagePlayer("[#00ffff]** Pack " + text + " has been added into your weapons slots successfully",player);
}

if(text == "2")
{
stats[player.ID].pack2 = true;
player.Disarm();
player.SetWeapon(30, 20);
player.SetWeapon(21, 9999);
MessagePlayer("[#00ffff]** Pack " + text + " has been added into your weapons slots successfully",player);
}

if(text == "3")
{
stats[player.ID].pack3 = true;
player.Disarm();
player.SetWeapon(28, 55);
player.SetWeapon(15, 15);
MessagePlayer("[#00ffff]** Pack " + text + " has been added into your weapons slots successfully",player);
}

if(text == "4")
{
stats[player.ID].pack4 = true;
player.Disarm();
player.SetWeapon(10, 9999);
player.SetWeapon(31, 250);
MessagePlayer("[#00ffff]** Pack " + text + " has been added into your weapons slots successfully",player);
}

if(text == "5")
{
stats[player.ID].pack5 = true;
player.Disarm();
player.SetWeapon(32, 9999);
player.SetWeapon(21, 9999);
MessagePlayer("[#00ffff]** Pack " + text + " has been added into your weapons slots successfully",player);
}

if(text == "6")
{
stats[player.ID].pack6 = true;
player.Disarm();
player.SetWeapon(14, 25);
player.SetWeapon(11, 9999);
MessagePlayer("[#00ffff]** Pack " + text + " has been added into your weapons slots successfully",player);
}
if(text == "7")
{
stats[player.ID].pack7 = true;
player.Disarm();
player.SetWeapon(27, 1500);
player.SetWeapon(19, 1500);
player.SetWeapon(24, 1500);
player.SetWeapon(12, 50);
MessagePlayer("[#00ffff]** " + text + " has been added into your weapons slots successfully",player);
}
}
}

if( cmd == "wep")
{
if(stats[player.ID].pack == false) MessagePlayer("[#ff0000] You Must Be in Choice ",player);
else if(!text) MessagePlayer("[#00ff00]*** /wep <mp5,uzi,insta,stubby,shotgun,colt,phyton> ",player);
else{
if(text == "mp5")
{
stats[player.ID].w1 = true;
player.SetWeapon(25, 1500);
MessagePlayer("[#00ffff]** " + text + " has been added into your weapons slots successfully",player);
}
if(text == "uzi")
{
stats[player.ID].w2 = true;
player.SetWeapon(23, 1500);
MessagePlayer("[#00ffff]** " + text + " has been added into your weapons slots successfully",player);
}
if(text == "insta")
{stats[player.ID].w3 = true;
player.SetWeapon(24, 1500);
MessagePlayer("[#00ffff]** " + text + " has been added into your weapons slots successfully",player);
}
if(text == "stubby")
{stats[player.ID].w4 = true;
player.SetWeapon(21, 1500);
MessagePlayer("[#00ffff]** " + text + " has been added into your weapons slots successfully",player);
}
if(text == "shotgun")
{stats[player.ID].w5 = true;
player.SetWeapon(19, 1500);
MessagePlayer("[#00ffff]** " + text + " has been added into your weapons slots successfully",player);
}
if(text == "colt")
{stats[player.ID].w6 = true;
player.SetWeapon(18, 1500);
MessagePlayer("[#00ffff]** " + text + " has been added into your weapons slots successfully",player);
}
if(text == "phyton")
{stats[player.ID].w7 = true;
player.SetWeapon(17, 1500);
MessagePlayer("[#00ffff]** " + text + " has been added into your weapons slots successfully",player);
}
}
}
else if ( cmd == "dpacks")
{
 stats[player.ID].pack1 = false;
 stats[player.ID].pack2 = false;
 stats[player.ID].pack3 = false;
 stats[player.ID].pack4 = false;
 stats[player.ID].pack5 = false;
 stats[player.ID].pack6 = false;
 stats[player.ID].pack = false
 stats[player.ID].pack7 = false;
 stats[player.ID].w1 = false;
 stats[player.ID].w2 = false;
 stats[player.ID].w3 = false;
 stats[player.ID].w4 = false;
 stats[player.ID].w5 = false;
 stats[player.ID].w6 = false;
 stats[player.ID].w7 = false;
 MessagePlayer("[#00ffff]** All Weapon Packs Disarmed From your weapons slots successfully",player);
 }
 
[/noae][/noae][/noae]


Functions

[noae][noae][noae]function put(player)
{
local player = FindPlayer(player);
stats[player.ID].pack = false;
player.IsFrozen = false;
}

function spack(player)
{
local player = FindPlayer(player);
 if(stats[player.ID].pack) MessagePlayer("[#00ffff]** Packs/Weapons has been added into your weapons slots successfully",player);
if(stats[player.ID].pack) MessagePlayer("[#00ffff]** Packs/Weapons To Disarm it using /dpacks ",player);
if(stats[player.ID].pack1 == true)
 {
 player.Disarm();
player.SetWeapon(26, 9999);
player.SetWeapon(19, 9999);
 }
 if(stats[player.ID].pack2 == true)
 {
 player.Disarm();
player.SetWeapon(30, 20);
player.SetWeapon(21, 9999);
 }
 if(stats[player.ID].pack3 == true)

 {
 player.Disarm();
player.SetWeapon(28, 55);
player.SetWeapon(15, 15);
 }
 if(stats[player.ID].pack4 == true)
 {
 player.Disarm();
player.SetWeapon(10, 9999);
player.SetWeapon(31, 250);
 }
 if(stats[player.ID].pack5 == true)
 {
 player.Disarm();
player.SetWeapon(32, 9999);
player.SetWeapon(21, 9999);
 }
 if(stats[player.ID].pack6 == true)
 {
 player.Disarm();
player.SetWeapon(14, 25);
player.SetWeapon(11, 9999);
 }
 if(stats[player.ID].pack7 == true)
 {
 player.Disarm();
player.SetWeapon(27, 1500);
player.SetWeapon(19, 1500);
player.SetWeapon(24, 1500);
player.SetWeapon(12, 50);
 }
 if(stats[player.ID].w1 == true)
 {
 player.SetWeapon(25, 1500);
 }
  if(stats[player.ID].w2 == true)
 {
 player.SetWeapon(23, 1500);
 }
  if(stats[player.ID].w3 == true)
 {
 player.SetWeapon(24, 1500);
 }
  if(stats[player.ID].w4 == true)
 {
 player.SetWeapon(21, 1500);
 }
  if(stats[player.ID].w5 == true)
 {
 player.SetWeapon(19, 1500);
 }
  if(stats[player.ID].w6 == true)
 {
 player.SetWeapon(18, 1500);
 }
  if(stats[player.ID].w7 == true)
 {
 player.SetWeapon(17, 1500);
 }
 }
[/noae][/noae][/noae]

Buddy

Buddy

=RK=MarineForce

#2


Class:
spree = false;
OnPlayerPart
if(stats[player.ID].spree == true) Message("[#cc0000]" + player.Name + " spree has ended by disconnecting.");
OnPlayerJoin

player.Score = 0;
OnPlayerDeath
player.Score = 0;
OnPlayerKill

killer.Score++;
 stats[player.ID].spree = true;
if (killer.Score == 5) Message("[#000cc00] " + player.Name + " [#ffff00] Just Made a spree");
else if (killer.Score == 5) Message("[#00cc00] " + killer.Name + " [#ffff00] is on a killing spree of [5] ");
else if (killer.Score == 10) Message("[#00cc00] " + killer.Name + " [#ffff00] is on a killing spree of [ " + player.Score + "] ");
else if (killer.Score == 15) Message("[#00cc00] " + killer.Name + " [#ffff00] is on a killing spree of [ " + player.Score + "] ");
else if (killer.Score == 25) Message("[#00cc00] " + killer.Name + " [#ffff00] is on a killing spree of [ " + player.Score + "] ");
else if (killer.Score == 30) Message("[#00cc00] " + killer.Name + " [#ffff00] is on a killing spree of [ " + player.Score + "] ");
else if (killer.Score == 35) Message("[#00cc00] " + killer.Name + " [#fff00] is on a killing spree of [ " + player.Score + "] ");
else if (killer.Score == 40) Message("[#00cc00] " + killer.Name + " [#ffff00] is on a killing spree of [ " + player.Score + "] ");
else if (killer.Score == 45) Message("[#00cc00] " + killer.Name + " [#ffff00] is on a killing spree of [ " + player.Score + "] ");
else if (killer.Score == 50) Message("[#00cc00] " + killer.Name + " [#ffff00] is on a killing spree of [ " + player.Score + "] ");
or else you can use this too.
killer.Score++;
stats[player.ID].spree = true;
if (killer.Score < 5) Message("[#00cc00] " + killer.Name + " [#fff00] is on a killing spree of [ " + player.Score + "] ");
OnPlayerSpawn
stats[player.ID].spree = false;
player.Score = 0;




OnPlayerSpawn

player.World = 50;
 Announce( "Spawn-Protection", player,0);
 NewTimer( "spro", 4000, 1, player.ID );
 NewTimer( "kl", 1000, 1, player.ID );
 NewTimer( "mn", 2000, 1, player.ID );
 NewTimer( "op", 3000, 1, player.ID );

Functions
function spro(player)
{
local player = FindPlayer(player);
player.World = 1;
Announce( "Spawn-Protection disabled", player , 0 )
}

function kl(p)
 {
 local p = FindPlayer(p);
if(p){
 Announce( "3", p , 0 );
 }
 }
 
 function mn(p){
 local p = FindPlayer(p);
if(p){
 Announce( "2", p , 0 );
 }
 }
 function op(p)
 {
 local p = FindPlayer(p);
  if(p){
 Announce( "1", p , 0 );
 }
 }


Hello Guyz in this Score System you can get many solutions from your server yep, but this is best for 2 teams  i maded it for cubans and haitians for my server so i m sharing it to all. Thanks to Mahmoud Tornado for giving me idea.
You can add many teams like this:
RC_Team_Score <- 0;
RB_Team_Score <- 0;
if you want to reset the score of both teams use this.
if( cmd == "resetscore" )
{
RC_Team_Score <- 0;
RB_Team_Score <- 0;
Message("[#CCFFF00] " + player.Name + " reset the score of both teams");
}
RC_Team_Score <- 0;
RB_Team_Score <- 0;
OnScriptLoad:
NewTimer( "ct", 1000, 0 );

OnPlayer Kill:
if(player.Team == 1)
{
RC_Team_Score++;
Message(" [#CCFF00] [Cubans] Got a Score by Killing Haitians Player +1" );
ct(player);
}
if(player.Team == 2)
{
RB_Team_Score++;
Message(" [#00cc00] [Haitians] Got a Score by Killing Cubans Player +1" );
ct(player);
}
if(RC_Team_Score >= 50)
{
Announce( "~y~Team-Cubans ~w~ win the game", player , 3 )
}
if(RB_Team_Score >= 50)
{
Announce( "~p~Team-Haitains~w~ win the game", player , 3 )
}/code]

[code]function ct(player)
{
for (local i=0; i<GetMaxPlayers(); i++)
{
local player=FindPlayer(i);
if(player)
 Announce( "~w~[~y~"+RC_Team_Score+" ~p~"+RB_Team_Score+"~w~]", player,  5  );
}
}

OnPlayerCommands
if(cmd=="setscorec")
{
        if ( text && IsNum( text ) )
        {               
RC_Team_Score = text.tointeger();
MessagePlayer( "[#ffffff][ADMIN][#00ff00] Set the score: [#f2f2f2]"+RC_Team_Score+"[#00ff00] of Cubans",player);
Announce( "~y~["+RC_Team_Score+"] ~p~["+RB_Team_Score+"] ", player,  5  );
}
        else MessagePlayer( "[#ffffff] Type /ssrc <score>" , player );
    }

if(cmd=="setscoreh")
{
        if ( text && IsNum( text ) )
        {               
RC_Team_Score = text.tointeger();
MessagePlayer( "[#ffffff][ADMIN][#00ff00] Set the score: [#f2f2f2]"+RC_Team_Score+"[#00ff00] of Haitians",player);
Announce( "~y~["+RC_Team_Score+"] ~p~["+RB_Team_Score+"] ", player,  5  );
}
        else MessagePlayer( "[#ffffff] Type /ssrc <score>" , player );
    }

SHy^

Nice,but can't you make these all in a file?

=RK=MarineForce

#4
DI TIMING SYSTEM

so you guys thinking how can we make timer?

its the best ez waya to make timer:

ITS HELP YOU ALOT IN A GOOD GAMEMODE!

example

add this onscriptload.

g_timer <- 0;
NewTimer( "g_timer", 1000, 0);
function rounds()
{

if ( g_timer == 180 )
{
Message(" Round Has Been Ended Due To Time Over");
g_timer = 0;                                             
}
Announce( "~y~ TIME : " + g_timer + " ", player , 1 )
g_timer++;
}

}

how to minus time:

g_timer --;
how to plus time:

g_timer++;
how to reset time:

[code]g_timer = 0;
how to set time:

Command:
if(cmd=="settime")
{
        if ( text && IsNum( text ) )
        {               
g_timer = text.tointeger();
MessagePlayer( "[#ffffff][ADMIN][#00ff00] Set the Time: [#ffbb00]"+g_timer+"",player);
}
}

You can add many times for example
etc <- 0;
g_xx <- 0;
g_pp <- 0;

IF YOU ADDED IT IN ONSCRIPTLOAD BUT IF U ADD (PLAYER) IT WILL WONT WORK! THATS PROB add it onroundstart etc. you can STOP THE ANNOUNCE BY g_timer.Stop()

umar4911

Quote from: =RK=MarineForce on May 10, 2020, 04:46 AMDI TIMING SYSTEM

so you guys thinking how can we make timer?

its the best ez waya to make timer:

ITS HELP YOU ALOT IN A GOOD GAMEMODE!

example

add this onscriptload.

g_timer <- 0;
NewTimer( "g_timer", 1000, 0);
function rounds()
{

if ( g_timer == 180 )
{
Message(" Round Has Been Ended Due To Time Over");
g_timer = 0;                                             
}
Announce( "~y~ TIME : " + g_timer + " ", player , 1 )
g_timer++;
}

}

how to minus time:

g_timer --;
how to plus time:

g_timer++;
how to reset time:

[code]g_timer = 0;
how to set time:

Command:
if(cmd=="settime")
{
        if ( text && IsNum( text ) )
        {               
g_timer = text.tointeger();
MessagePlayer( "[#ffffff][ADMIN][#00ff00] Set the Time: [#ffbb00]"+g_timer+"",player);
}
}

You can add many times for example
etc <- 0;
g_xx <- 0;
g_pp <- 0;

IF YOU ADDED IT IN ONSCRIPTLOAD BUT IF U ADD (PLAYER) IT WILL WONT WORK! THATS PROB add it onroundstart etc. you can STOP THE ANNOUNCE BY g_timer.Stop()
tbh cancer. You're having timer every second. I prefer you creating a countdown in client side. This will reduce the lag a lot. Using functions, you can even change the time, end and do whatever you want without adding lag to the server.
RT Member | Asian City Scripter | CTB Contributor | VKs Contributor | European City Contributor | EAD Scripter

habi

#6
Quote from: =RK=MarineForce on May 10, 2020, 04:46 AMg_timer <- 0;
NewTimer( "g_timer", 1000, 0);
This might not work


NicusorN5

Quote from: habi on May 10, 2020, 12:36 PM
Quote from: =RK=MarineForce on May 10, 2020, 04:46 AMg_timer <- 0;
NewTimer( "g_timer", 1000, 0);
This might not work


Tbh it might even crash the server, I'm too lazy to test this myself.

=RK=MarineForce

brah. i m using 3 timers like this why my server not crash xd.

and idk about cilent side...

DiscorD: MarineFOrce#4119

check out my server: 49.12.15.63:9994