Recent Posts
41
Script Showroom / Re: Proper Mute System
« on October 8th, 06:02 PM by MRSK143 »
Quote from imranaltan on October 8th, 06:00 PM
nice job thx
Thanks bro
42
Script Showroom / Re: Proper Mute System
« on October 8th, 06:00 PM by imranaltan »
nice job thx
43
Script Showroom / Proper Mute System
« on October 8th, 05:45 PM by MRSK143 »
Hi Guyz I have made a proper mute system

Features:
This Is An auto mute system and manual mute system you can mute anyone if you're admin and also you can mute anyone with timer mute cmd the player will be unmuted automatically after the given time and if player do spamming   the player will be muted automatically and he will be unmuted in 30 seconds so enjoy the code ;)

Here is the source code

Put This Code in the top of main.nut

Code: [Select]
class MuteClass
{
MuteIndex = 0;
Timer = 0;
Muted = false;
}

Put This Code onScriptLoad

Code: [Select]
Mute <- array(GetMaxPlayers(), null); print("Mute System has been loaded successfully by MR_SK");

Put this code in onPlayerJoin

Code: [Select]
Mute[player.ID] = MuteClass();

Put this code onPlayerChat

Code: [Select]
if(Mute[player.ID].Muted == true && Mute[player.ID].Timer == 0){MessagePlayer("You Are Currently Muted!", player);return 0;}

if(Mute[player.ID].Muted == true && Mute[player.ID].Timer >0)
{
MessagePlayer("You Are Currently Muted For "+Mute[player.ID].Timer+" Mini Seconds!", player);return 0;
}

Mute[player.ID].MuteIndex += 1;

if(Mute[player.ID].MuteIndex == 4){Message("Auto Muted "+player.Name+" Time 30 seconds Reason: spamming"); Mute[player.ID].Muted = true; Mute[player.ID].Timer =  3000; NewTimer( "Unmute", 30000, 1, player.ID ); return 0;}

NewTimer( "RemoveMuteIndex", 3000, 1, player.ID );

Here are the commands

Code: [Select]
else if(cmd == "mute")
{
if(player.Name == "MR_SK") /*You Can use any thing here like checking if you are admin or not*/
{
if(text)
{
local plr = GetPlayer( GetTok( text, " ", 1 ) ), reason = GetTok( text, " ", 2, NumTok( text, " " ) );
if(plr)
{
if(reason)
{
if(Mute[plr.ID].Muted == false)
{
Mute[plr.ID].Muted = true;
Message("Admin: "+player.Name+" Has muted "+plr.Name+" Reason: "+reason+"");
}
else MessagePlayer("[#db0000]The player Is not muted yet!", player);
}
else MessagePlayer("[#db0000]You must the type the reason to mute the player!", player);
}
else MessagePlayer("[#db0000]The Requested User Is Not Present In Game!", player);
}
else MessagePlayer( "Syntax; /" + cmd + " <Player/ID> <Reason>", player );
}
else MessagePlayer("[#db0000]Unknown command.", player);
}

else if(cmd == "unmute")
{
if(player.Name == "MR_SK") /*You Can use any thing here like checking if you are admin or not*/
{
if(text)
{
local plr = GetPlayer( GetTok( text, " ", 1 ) );
if(plr)
{
if(Mute[plr.ID].Muted == true)
{
Mute[plr.ID].Muted = false;
Message("Admin: "+player.Name+" Has unmuted "+plr.Name+"");
}
else MessagePlayer("[#db0000]The player Is not muted yet!", player);
}
else MessagePlayer("[#db0000]the player is not present in game!", player);
}
else MessagePlayer( "Syntax; /" + cmd + " <Player/ID>", player );
}
else MessagePlayer("[#db0000]Unknown command.", player);
}

else if(cmd == "timermute")
{
if(player.Name == "MR_SK") /*You Can use any thing here like checking if you are admin or not*/
{
if(text)
{
local plr = GetPlayer( GetTok( text, " ", 1 ) ), time = GetTok( text, " ", 2 ), reason = GetTok( text, " ", 3, NumTok( text, " " ) );
if(plr)
{
if(time)
{
if(IsNum(time))
{
if(reason)
{
if(Mute[plr.ID].Muted == false)
{
Mute[plr.ID].Muted = true;
Message("Admin: "+player.Name+" Has muted "+plr.Name+" Time: "+time.tointeger()+" Mini Seconds Reason: "+reason+"");
NewTimer( "Unmute", time.tointeger(), 1, player.ID );
Mute[player.ID].Timer = time.tointeger();
}
else MessagePlayer("[#db0000]The player Is not muted yet!", player);
}
else MessagePlayer("[#db0000]You must the type the reason to mute the player!", player);
}
else MessagePlayer("[#db0000]The time must be in numbers!", player);
}
else MessagePlayer("[#db0000]You must type the time for muting player!", player);
}
else MessagePlayer("[#db0000]The Requested User Is Not Present In Game!", player);
}
else MessagePlayer( "Syntax; /" + cmd + " <Player/ID> <Time> <Reason>", player );
}
else MessagePlayer("[#db0000]Unknown command.", player);
}

And Here Are the functions

Code: [Select]
function RemoveMuteIndex(plr)
{
local player = FindPlayer(plr);
if(player){Mute[player.ID].MuteIndex = 0;}
}

function Unmute(plr)
{
local player = FindPlayer(plr);
if(player){Message("Auto Unmuted "+player.Name+""); Mute[player.ID].Muted = false; Mute[player.ID].Timer = 0;}
}

function GetPlayer( plr )
{
    if ( plr )
    {
        if ( IsNum( plr ) )
        {
            plr = FindPlayer( plr.tointeger() );
            if ( plr ) return plr;
            else return false;
        }
    else
        {     
            plr = FindPlayer( plr );
            if ( plr ) return plr;
            else return false;
        }
    }
    else return false;
}

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 NumTok(string, separator)
{
    local tokenized = split(string, separator);
    return tokenized.len();
}

Tested!
44
if ( cmd== "fps" )
{
MessagePlayer("[#ffffff] " + player.Name + " [#ffff00]FPS " + player.FPS +  "[#ffff00].",player);
}

if ( cmd== "ping" )
{
MessagePlayer("[#ffffff] " + player.Name + " [#ffff00]PING " + player.Ping +  "[#ffff00].",player);
}

if( cmd == "a" )
 {
  if(!text)
  {
   MessagePlayer("[#6666FF]Anims' list: [#FFFF81](/a) stop, watcha, lean, talk, wave, die^, fall^, fallback^, :o, apply, bu!, arg^, carwback, wback, elbow^, rollback, boss, crawling, rollinfront, falling, roll, beware, idk, look, dumb, aim^, drown, handsup, wut, fu, phone, sit, stand, sell, hm?, onfoot, db^, heal, lay, bored, riot, dance, drunk",player);
   MessagePlayer("[#6666FF]READ ME -> The symbol ^ means the anim has more options. Example: /a dance, /a dance 2, /a dance 3.",player);
  }
  else
  {
   switch(text)
   {
    case "stop":
     player.SetAnim(0,29);
     break;
    case "watcha":
     player.SetAnim(0,7);
     break;
    case "lean":
     player.SetAnim(0,9);
     break;
    case "talk":
     player.SetAnim(0,11);
     break;
    case "wave":
     player.SetAnim(0,12);
     break;
    case "die":
     player.SetAnim(0,17);
     break;
    case "die 2":
     player.SetAnim(0,13);
     break;
    case "fall":
     player.SetAnim(0,25);
     break;
    case "fall 2":
     player.SetAnim(0,37);
     break;
    case "fallback":
     player.SetAnim(0,27);
     break;
    case "fallback 2":
     player.SetAnim(0,43);
     break;
    case "oo":
     player.SetAnim(0,44);
     break;
    case "apply":
     player.SetAnim(0,62);
     break;
    case "bu!":
     player.SetAnim(0,67);
     break;
    case "arg":
     player.SetAnim(0,112);
     break;
    case "arg 2":
     player.SetAnim(0,113);
     break;
    case "carwback":
     player.SetAnim(0,114);
     break;
    case "wback":
     player.SetAnim(0,118);
     break;
    case "elbow":
     player.SetAnim(0,123);
     break;
    case "elbow 2":
     player.SetAnim(0,124);
     break;
    case "rollback":
     player.SetAnim(0,126);
     break;
    case "boss":
     player.SetAnim(0,130);
     break;
    case "crawling":
     player.SetAnim(0,133);
     break;
    case "rollinfront":
     player.SetAnim(0,135);
     break;
    case "falling":
     player.SetAnim(0,144);
     break;
    case "roll":
     player.SetAnim(0,147);
     break;
    case "beware":
     player.SetAnim(0,151);
     break;
    case "idk":
     player.SetAnim(0,152);
     break;
    case "look":
     player.SetAnim(0,153);
     break;
    case "dumb":
     player.SetAnim(0,154);
     break;
    case "aim":
     player.SetAnim(0,155);
     break;
    case "aim 2":
     player.SetAnim(0,157);
     break;
    case "aim 3":
     player.SetAnim(0,160);
     break;
    case "drown":
     player.SetAnim(0,156);
     break;
    case "handsup":
     player.SetAnim(0,161);
     break;
    case "wut":
     player.SetAnim(0,162);
     break;
    case "fu":
     player.SetAnim(0,163);
     break;
    case "phone":
     player.SetAnim(0,166);
     break;
    case "sit":
     player.SetAnim(0,169);
     break;
    case "stand":
     player.SetAnim(0,168);
     break;
    case "sell":
     player.SetAnim(0,171);
     break;
    case "hm?":
     player.SetAnim(0,172);
     break;
    case "onfoot":
     player.SetAnim(3,192);
     break;
    case "db":
     player.SetAnim(3,201);
     break;
    case "db 2":
     player.SetAnim(3,202);
     break;
    case "db 3":
     player.SetAnim(3,203);
     break;
    case "heal":
     player.SetAnim(24,214);
     break;
    case "lay":
     player.SetAnim(25,210);
     break;
    case "bored":
     player.SetAnim(26,215);
     break;
    case "bored 2":
     player.SetAnim(26,216);
     break;
    case "bored 3":
     player.SetAnim(26,217);
     break;
    case "bored 4":
     player.SetAnim(26,218);
     break;
    case "riot":
     player.SetAnim(27,219);
     break;
    case "riot 2":
     player.SetAnim(27,220);
     break;
    case "riot 3":
     player.SetAnim(27,221);
     break;
    case "riot 4":
     player.SetAnim(27,222);
     break;
    case "riot 5":
     player.SetAnim(27,223);
     break;
    case "riot 6":
     player.SetAnim(27,224);
     break;
    case "riot 7":
     player.SetAnim(27,225);
     break;
    case "dance":
     player.SetAnim(28,226);
     break;
    case "dance 2":
     player.SetAnim(28,227);
     break;
    case "dance 3":
     player.SetAnim(28,228);
     break;
    case "dance 4":
     player.SetAnim(28,229);
     break;
    case "dance 5":
     player.SetAnim(28,230);
     break;
    case "dance 6":
     player.SetAnim(28,231);
     break;
    case "dance 7":
     player.SetAnim(28,232);
     break;
    case "drunk":
     player.SetAnim(29,210);
     break;
    default:
     MessagePlayer(">> [#FF3636]This animation doesn't exist. Type '/a' to see the list !",player);
   }
  }
 }

else if ( cmd == "disarm" )
     {
          player.Disarm();
        MessagePlayer("[#f28500]>> You are Disarmed", player);
     }


   else if ( cmd == "heal" )
 {
  if ( player.Health == 100 ) PrivMessage( player, "You have the health to maximum.");
  else
  {
   PrivMessage( player, "You healed successfully.");
   player.Health = 100;
 }
   }

else if ( cmd == "wep" )
     {
          local wepid = GetWeaponID( text );
          player.SetWeapon( wepid, 1000 );
          MessagePlayer( "You have been given a " + GetWeaponName( wepid ) + " with 1000 ammo.", player );
     }

   else if(cmd == "goto") {
      if(!text) MessagePlayer( "Error - Correct syntax - /goto <Name/ID>' !",player );
      else {
         local plr = FindPlayer(text);
         if(!plr) MessagePlayer( "Error - Unknown player !",player);
         else {
            player.Pos = plr.Pos;
            MessagePlayer( "[ /" + cmd + " ] " + player.Name + " was sent to " + plr.Name, player );
         }
      }
      
   }

   else if(cmd == "get") {
      if(!text) MessagePlayer( "Error - Correct syntax - /get <Name/ID>' !",player );
      else {
         local plr = FindPlayer(text);
         if(!plr) MessagePlayer( "Error - Unknown player !",player);
         else {
            plr.Pos = player.Pos;
            MessagePlayer( "[admin] " + plr.Name + " was sent to " + player.Name, player );
         }
      }
   }

   if ( cmd == "changeskin" )
   {
      if(!text)
      {
         MessagePlayer("Error: use /changeskin id",player)
         return false;
      }
      player.Skin = text.tointeger();
   }

else if ( cmd == "report" )
{
if(!text) MessagePlayer("/report <Player> <Reason>",player);
//Here if You Like Make if player Not Registered
//Here if You Like Make if player Not Logged in
else {
local plr = GetPlayer( GetTok( text, " ", 1 ) );
if ( !plr ) MessagePlayer( "Unknow Player.", player );
{
local reason = GetTok( text, " ", 2 NumTok( text, " " ) );
if ( !reason ) MessagePlayer( "Make Reason.", player );
else if ( plr.Name==player.Name ) MessagePlayer( "You Can't Report yourself.", player );
else {
local now = date();
QuerySQL( rp, "INSERT INTO report ( Plr, Name, Reason, Day, Month, Year, Hour, Min ) VALUES ( '" + plr.Name + "', '" + player.Name + "', '" + reason + "', '" + now.day + "/', '" + now.month + "/', '" + now.year + "/', '" + now.hour + ":', '" + now.min + "' )" );
MessagePlayer("Report Successfully Inserted To DataBase",player);
Message("Player "+player.Name+" Has Report " +plr.Name+ " Reason: "+reason+"");
}
}
}
}

else if (cmd== "score")
{
MessagePlayer("[#ffffff] " + player.Name + " [#ffff00]SCORE " + player.Score +  "[#ffff00].",player);
}

else if ( cmd == "info" )
   {
      MessagePlayer( "[#ffffff]Server Name:[ " + GetServerName() + " ].", player );
      MessagePlayer( "[#ffffff]Script Deathmatch( v1.5 ) , Created by Jutt", player );
      MessagePlayer( "[#ffffff]Players:( " + GetPlayers() + "/" + GetMaxPlayers() + " ).", player );   
      MessagePlayer( "[#ffffff]Cars:( " + GetVehicleCount() + " ) ", player );   
      MessagePlayer( "[#ffffff]Game speed:( " + GetGamespeed() + " )." , player );
   }

else if ( ( cmd == "afk" ) || ( cmd == "afks" ) )
   {
      local plr, b;
      for( local i = 0; i <= GetMaxPlayers(); i++ )
      {
       plr = FindPlayer( i );
  if ( ( plr ) && ( plr.Away ) )
       {
      if ( b ) b = b + ", " + plr.Name + ""
      else b = plr.Name + ""
       }
      }
      MessagePlayer( "[#33cc00]Information: [#ffffff]Displaying List Of People Who Are Afk" , player ); 
      if ( b ) MessagePlayer( "[#33cc00]Information: [#FFFFFF]: " + b + "" , player );         
      else MessagePlayer( "[#009900][AFK][#ffffff] None " , player );
       
}

else if ( cmd == "sms" )
{
if ( !text ) MessagePlayer( "[#FF0000]> Syntax: /" + cmd + " [User] [Message]", player );
else if ( NumTok( text, " " ) < 2 ) MessagePlayer( "[#FF0000]> Syntax: /" + cmd + " [User] [Message]", player );
else {
local user = GetTok( text, " ", 1 );
local msg = GetTok( text, " ", 2, NumTok( text, " " ));
EchoNotice( user, "> sent sms from "+player.Name+": "+msg );
MessagePlayer( "[#79EF06]> Sent sms to [#FF0000]"+user+"[#79EF06]: "+msg, player );
}
}

else if ( cmd == "battle" )
{
          if ( !player.IsSpawned ) MessagePlayer( "You haven't spawned yet..", player );
            else
               {
                  player.Pos = Vector(-642.148, 776.055, 1.0518 );
                  MessagePlayer( "[#ffbb00]*** Teleport Done To  Zone ***", player );               
                }
         }



====== Credits By Jutt =============
45
Client Scripting / [Release] Re: DecUI: A declarative approach to UI development
« on October 5th, 10:54 PM by NewK »
After 2 years, more than 100 commits and a few community contributions, version 1.0.0 has been released. The code for custom components has been rewritten and now supports the creation of DecUI components dynamically. This means it supports the creation of new DecUI components without needing to add or modify any code inside DecUI so if you want to create DecUI components you dont need to know anything about DecUI internals, you just need to create a class that extends the parent DecUIComponent, register that class with DecUI and that's all. If you're familiar with React, you'll feel right at home since it's very similar.

You can see the tutorial on how to create DecUI components here

You can see the changelog here
46
Script Showroom / Re: Set Grapics Command!
« on October 5th, 08:10 PM by Athanatos »
He wrote code that works on his machine but not ours. ShAmE
47
Script Showroom / Re: Set Grapics Command!
« on October 5th, 07:26 PM by Xmair »
Quote from Jutt on October 5th, 06:33 PM
khud banai hai -- translated: made it myself
No offense but it clearly shows lmao
48
Script Showroom / Re: Set Grapics Command!
« on October 5th, 06:33 PM by Jutt »
khud banai hai
49
Script Showroom / Re: Set Grapics Command!
« on October 4th, 06:13 PM by Gito Baloch »
Kahan se copy ki?
50
Guess The District Name - https://www.youtube.com/watch?v=VO7__WsT0gw&t=1s

Brothers and Sisters, Please do like and share. 8)