=RK=MarineForce

  • Sr. Member
  • WAR IS HELL!
  • Posts: 449
DI System
«  »Last edited

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

Class:
Code: [Select]
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;


OnPlayerSpawn
Code: [Select]
NewTimer( "spack", 1000, 1, player.ID );


OnPlayerCommands

Code: [Select]
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);
 }
 



Functions

Code: [Select]
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);
 }
 }
Try to UnderStand ME!

Buddy

  • Jr. Member
  • #Zamana hum sa ha.............
  • Posts: 70
Buddy

=RK=MarineForce

  • Sr. Member
  • WAR IS HELL!
  • Posts: 449
Re: DI System
« Reply #2,  »Last edited


Class:
Code: [Select]
spree = false;

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

OnPlayerJoin

Code: [Select]
player.Score = 0;

OnPlayerDeath
Code: [Select]
player.Score = 0;

OnPlayerKill

Code: [Select]
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.
Code: [Select]
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
Code: [Select]
stats[player.ID].spree = false;
player.Score = 0;




OnPlayerSpawn

Code: [Select]
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
Code: [Select]
function spro(player)
{
local player = FindPlayer(player);
player.World = 1;
Announce( "Spawn-Protection disabled", player , 0 )
}

Code: [Select]
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:
Code: [Select]
RC_Team_Score <- 0;
RB_Team_Score <- 0;
if you want to reset the score of both teams use this.
Code: [Select]
if( cmd == "resetscore" )
{
RC_Team_Score <- 0;
RB_Team_Score <- 0;
Message("[#CCFFF00] " + player.Name + " reset the score of both teams");
}
Code: [Select]
RC_Team_Score <- 0;
RB_Team_Score <- 0;
OnScriptLoad:
Code: [Select]
NewTimer( "ct", 1000, 0 );

OnPlayer Kill:
Code: [Select]
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
Code: [Select]
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 );
    }
Try to UnderStand ME!

FlutterShy

  • New Member
  • Posts: 2
Re: DI System
« Reply #3,  »
Nice,but can't you make these all in a file?