[COMMANDS] /goto,/nogoto,/mute and /kick

Started by luchgox, Apr 26, 2017, 11:40 AM

Previous topic - Next topic

luchgox

I'm new in scripting and i dont know how to make commands (like /goto,/nogoto, /mute (for 30 seconds),/kick)..I Hope i will get from there
thumbs up in advance
Strength does not come from wining.Your struggles develop your strengths.

NicusorN5


Cool

#2
if cmd == kick
{
if player not available in server message  invalid player
else if player then kiclplayer
}
else if cmd == goto
{
if player not available in server message  invalid player
else if player not spawn then message player is not spawn
else player.pos = plr.pos
}

else if cmd == nogoto
{
player.nogoto == true
}
else if cmd == mute{
stop.player.taliking = true
}
Happy :)

kennedyarz

Quote from: Cool on Apr 26, 2017, 11:56 AMif cmd == kick
{
if player not available in server message  invalid player
else if player then kiclplayer
}
else if cmd == goto
{
if player not available in server message  invalid player
else if player not spawn then message player is not spawn
else player.pos = plr.pos
}

else if cmd == nogoto
{
player.nogoto == true
}
else if cmd == mute{
stop.player.taliking = true
}
Happy :)

WUT?


luchgox

Strength does not come from wining.Your struggles develop your strengths.

Cool

Quote from: UFt.LuchGox on Apr 26, 2017, 05:43 PMsomething requested
No one is here to Write Codes for you here and if you have some sense there is search Button and i am sure all these commands and mute function available so please Stop spamming and like a good child sit and play the game.
or download any released server and copy/paste

KAKAN

Well, seeing the the section is "Script and content requests" you should give the code to him and not give him bad remarks :P( though that never happens )
oh no

Cool

Quote from: KAKAN on Apr 27, 2017, 07:22 AMWell, seeing the the section is "Script and content requests" you should give the code to him and not give him bad remarks :P( though that never happens )
But these things already available but he is not searching :P thats why i said :P

luchgox

Strength does not come from wining.Your struggles develop your strengths.

Cool

Rofl Cant you search
anyways
Kick
else if ( cmd == "kick" ) // credits goes to Adm Devs
 {
 if ( !text ) MessagePlayer( "Error - Syntax: /kick <player> <reason>", player);
    else
    {
      local plr = GetPlayer( GetTok( text, " ", 1 ) );
      if ( !plr ) MessagePlayer( "Error - Unknown player.", player);
      else
      {
        local reason = GetTok( text, " ", 2 );
     if ( !reason ) reason = "None";
     Message( "" + plr.Name + " have been kicked. Reason: " + reason + "" );
     plr.Kick();
      }
    }
 }
Credits goes to ksna
Add this to player class
nogoto = false;onscriptload
stats <- array( GetMaxPlayers(), null );commands
else if ( cmd == "goto" ){                                                    // Working
  if ( !text ) MessagePlayer( "[Syntax] - /" + cmd + " <Player Nick/ID>", player );
  else{
   local plr = text != "" ? IsNum( text ) ? FindPlayer( text.tointeger() ) : FindPlayer( text ) : player;
   if ( !plr ) MessagePlayer( "[Error] - Unknown Player..", player );
            else if (  stats[ plr.ID ].nogoto ) MessagePlayer( "Error - You can't teleport to " + plr.Name + " because he has nogoto  enabled.", player );
   else {
    NewTimer( "go", 5000, 1, player.ID, plr.ID );
    Announce( "~y~ Teleporting...", player );
    player.IsFrozen = true;
    MessagePlayer( "You will be teleported in 5 seconds to [ " + plr.Name + " ] ", player);
   }
        }     
 }
 
 else if ( cmd == "nogoto" ) {                                            // Working
  if ( !text ) MessagePlayer( "[Syntax] - /c " + cmd + " <on/off>", player );
  else {
   if ( text == "on" ) {
   stats[ player.ID ].nogoto = true;
   MessagePlayer( "Players Can't teleport to you anymore...", player );
  }
   else if ( text == "off" ) {
    stats[ player.ID ].nogoto = false;
    MessagePlayer( "Players Can teleport to you.", player );
    }
   }
   }
mute system
http://forum.vc-mp.org/?topic=1717.msg12290#msg12290

luchgox

Strength does not come from wining.Your struggles develop your strengths.