Cop System

Started by =RK=MarineForce, Jul 22, 2018, 09:38 AM

Previous topic - Next topic

=RK=MarineForce

Hello Guyz Today i m make a Cop System and some commands . so i m sharing it with You There are some more bugs i m sry for it .. i will remove that. i think its bad for you .. this is my first system its cop . its simple i think .

1. Commands

else if (cmd == "arrest") {
    if( !text ) MessagePlayer("[#ff0000]Error - /"+cmd+" Name/id", player );
    else if ( (player.Skin == 1) ||  ( player.Skin ==2 ) ) {
        local plr = text != "" ? IsNum( text ) ? FindPlayer( text.tointeger() ) : FindPlayer( text ) : player;
        if( !plr )MessagePlayer("Error - Unknown player", player );
       if (plr.Skin == 126 ) MessagePlayer(" This player is not surrender You can't arrest him ",player);  /// if this cmd is bug so remove this line .///
        else if ( plr.WantedLevel == 1 ) return MessagePlayer( RED+" This Player is Not Wanted",player );
            else if ( DistanceFromPoint( player.Pos.x, player.Pos.y , plr.Pos.x, plr.Pos.y ) < 5 ) {         //DistanceFromPoint( float x1, float y1, float x2, float y2 )
                plr.Pos = Vector(  380.759,-504.493, 9.39562 );
                NewTimer( "arresttime", 30000, 1, plr.ID );
plr.WantedLevel(0);
           
 
                Message( RED+"Cop "+player.Name+GREEN+" has Arrested "+LGREEN+plr.Name );
     MessagePlayer( RED+"You will be released from jail in thirty seconds",plr );
gate2.MoveTo(Vector(384.108, -505.87, 9.65089), 2500 );
               
                }
            else MessagePlayer(""+ plr.Name +" is far away.", player );
            }
            else MessagePlayer( " You need to be a cop",player );
        }

else if (cmd == "unarrest")
{
if ( (player.Skin == 1) ||  ( player.Skin ==2 ) )
{
if( !text ) MessagePlayer(" [#00ff00] Error - /"+cmd+" Name/id", player );
 local plr = text != "" ? IsNum( text ) ? FindPlayer( text.tointeger() ) : FindPlayer( text ) : player;
  if( !plr )MessagePlayer("Error - Unknown player", player );
plr.Pos = Vector(384.157, -506.481, 9.39822); Message(" [#ff0000]VCPD " + player.Name + " Relaise  " + plr.Name + "  From Jail");
}
else MessagePlayer(" [#00ff00] You need be in cop to use this cmd  ", player);
}

 
else if (cmd == "sus")
{
if ( (player.Skin == 1) ||  ( player.Skin ==2 ) )
{
if( !text ) MessagePlayer(" [#00ff00] Error - /"+cmd+" Name/id", player );
 local plr = text != "" ? IsNum( text ) ? FindPlayer( text.tointeger() ) : FindPlayer( text ) : player;
 if( !plr )MessagePlayer("Error - Unknown player", player );
 else if ( DistanceFromPoint( player.Pos.x, player.Pos.y , plr.Pos.x, plr.Pos.y ) < 250 ) {         //DistanceFromPoint( float x1, float y1, float x2, float y2 )
 Message(" [#00ffff] VCPD " + player.Name + " Suspected " + plr.Name + " ");
 Message(" (megaphone) [#0000ff] " + plr.Name + " surrender & we will open fire on you ");
 plr.WantedLevel(2);

 }
 else MessagePlayer(""+ plr.Name +" is far away.", player );
 }
 else MessagePlayer(" [#00ff00] You need be in cop to use this cmd  ", player);
}


else if ( cmd == "sur")
{
 player.IsFrozen = true;
 player.SetAnim(0,161);
player.Skin == 126;
Message(" [#0000ff] " + player.Name + " is surrendered ");
}

2. Functions
[code]function arresttime(p)
{
local plr = FindPlayer(p);
if (plr)
gate2.MoveTo(Vector(386.61, -503.117, 9.39561), 2500 );
MessagePlayer( RED+"**You have been released from jail",plr );
Message( RED+"** " + plr.Name + " Have been released From jail ");
}
On Player Pickup


    if ( pickup.Model == 375 )
      {
if ( player.WantedLevel > 1 )
{
player.Skin = 2;
player.Colour = RGB( 51, 51, 255 );
player.SetWeapon( 19, 70 );
player.SetWeapon( 25, 150 );
player.SetWeapon( 26, 150 );
}
else MessagePlayer(" You need to clean ur wanted level to join cop duty ", player);  // updated  there can be bug in new update i untested it so u can remove that if its called bug
}

    if ( pickup.Model == 508 )
      {
player.Skin = 2;
player.Colour = RGB( 51, 51, 255 );
player.SetWeapon( 19, 70 );
player.SetWeapon( 25, 150 );
player.SetWeapon( 26, 150 );
}

pickups put it on Scriptload

CreatePickup(375, Vector( -663.642, 755.534, 11.1044 ));
 CreatePickup(508, Vector( 508.699, 514.077, 12.109  ));
 CreatePickup(508, Vector( 399.177, -469.343, 11.7388 ));

Remember Put all in main.nut

untested i change admin cmd to wanted.

else if ( ( cmd == "wanted" ) || ( cmd == "admins" ) )
{
if( stats[ player.ID ].Log == false && stats[ player.ID ].Reg == false ) MessagePlayer( "You Need Login or Register First.", player );
else {
local plr, b;
for( local i = 0; i <= GetMaxPlayers(); i++ )
{
plr = FindPlayer( i );
if ( ( plr ) && ( plr.WantedLevel >= 1 )
{
if ( b ) b = b + ", " + plr.Name + " - plr.WantedLevel"
else b = plr.Name + " - " + WantedLevel( plr ) + ""
}
}
if ( b ) Message( " Wanted Players: [#FF8C00]" + b + "  " );
else Message( " No one wanted player" );
Message( " Requested By " + player.Name +"" );
}
}

Argent cmds

else if ( cmd == "ckick")
{
local plr = FindPlayer(text);
if(!text) MessagePlayer(" /" + cmd + " <Nick> ", player);
if ( player.Skin == 2 ) MessagePlayer(" You need to be a swat to kick a cop from duty ",player);
if ( !plr.Skin == 1 ) MessagePlayer(" He's isn't in cop duty ", player);
else{
plr.Skin == 126;
MessagePlayer(" You have been kicked from cop duty by  argent " + player.Name + " ",player);
MessagePlayer(" You kicked " + plr.Name + " From Cop Duty ",plr);
plr.Disarm();
}
}



else if ( cmd == "cdisarm")
{
local plr = FindPlayer(text);
if(!text) MessagePlayer(" /" + cmd + " <Nick> ", player);
if ( player.Skin == 2 ) MessagePlayer(" You need to be a argent  to disarm a cop ",player);
if ( !plr.Skin == 1 ) MessagePlayer(" He's isn't in cop duty ", player);
else{
MessagePlayer(" You have been Disarmed from cop duty by  argent " + player.Name + " ",player);
plr.Disarm();
}
}

else if ( cmd == "cpromote")
{
local plr = FindPlayer(text);
if(!text) MessagePlayer(" /" + cmd + " <Nick> ", player);
if ( player.Skin == 2 ) MessagePlayer(" You need to be a argent  to Promote a cop ",player);
if ( !plr.Skin == 1 ) MessagePlayer(" He's isn't in cop duty ", player);
else{
MessagePlayer(" You have been Promoted to Swat by  argent " + player.Name + " ",player);
plr.Skin == 2;
plr.Cash == 15000;
}
}




You can Make a Rank Agent from admin levels.


i'm Updating System i thinks it got some bugs u can fix it i untested new update

GoldRick


=RK=MarineForce

Can u tell me their is bug?

VK.Jona83Killer

Good work Marine!

=RK=MarineForce

their no bug Thanks

Mohamed Boubekri

GooD JoB, You are now best.
| What now ? | Not yet ! |
Morrocan:- [ 🇲🇦 ].

=RK=MarineForce

can u make it BEST PLZ

Namir


John

After typing /arrest John It teleports me to the jail but it does not close the Jail cell door.

Xhefri

#9
Well to move an object you first need to create it.
gate2 = CreateObject( 3685, 1, 384.173, -505.719, 9.69561, 255 );

=RK=MarineForce

i created it but i forget post it to vc-mp forum

NicusorN5

Quote from: Mohamed on Jul 23, 2018, 09:15 PMGooD JoB, You are now best.
No shit sherlock, he just made a few cmds, and that's it, he's the best scripter over there.

 Let's see him make a zombie vcmp server with animated objects.

Mahmoud Tornado

Quote from: Athanatos on Jan 21, 2019, 03:43 PMNo shit sherlock, he just made a few cmds, and that's it, he's the best scripter over there.
Hey Athanatos, he was a newbie, we was telling him to make the scripts with himself, and he was asking us a lot.
So, it's nice to see him doing script with himself, Mohamed proud of him.

Quote from: Mohamed on Jul 23, 2018, 09:15 PMGooD JoB, You are now best.
There's a different in Best and The Best, you surely know it, so you used it here.
Quote from: Athanatos on Jan 21, 2019, 03:43 PMhe's the best scripter over there.
Finally, Your zombie server is cool i saw it.

NicusorN5

Quote from: Mahmoud Tornado on Jan 25, 2019, 09:09 AMFinally, Your zombie server is cool i saw it.

Thanks, I plan adding GUI interfaces and revival system too :P

Xhefri

Quote from: Athanatos on Jan 25, 2019, 09:26 AM
Quote from: Mahmoud Tornado on Jan 25, 2019, 09:09 AMFinally, Your zombie server is cool i saw it.

Thanks, I plan adding GUI interfaces and revival system too :P

You should make random pickups like guns ,armour, health and things like that at the end of every wave.