Vice City Multiplayer

VC:MP 0.3 => mIRC/pawn Scripting => Snippet Showroom => Topic started by: mrockxkingbutt on December 16, 2012, 06:37:42 pm

Title: :( Cuff/ :) Uncuff commands
Post by: mrockxkingbutt on December 16, 2012, 06:37:42 pm
use this cmd
this is cuff
[pawn]   else if ( strcmp( cmd, "cuff", true ) == 0 )
   {
      new reason[ 256 ], szMsg[ 128 ], plr;
      tmp = strtok( cmdtext, idx ), reason = strtok( cmdtext, idx ), plr = FindPlayerIDFromString( tmp );
      if ( !IsLoggedIn( playerid ) ) SendClientMessage( playerid, COLOR_RED, "Please log-in to your account." );
      else if ( !strlen(reason) ) SendClientMessage( playerid, COLOR_RED, "USAGE: /c cuff [Nick/ID] reason" );
        else if ( plr == INACTIVE_PLAYER_ID ) SendClientMessage( playerid, COLOR_RED, "Error: Unknown player" );
      else
      {
         format( szMsg, sizeof( szMsg ), "Admin %s cuffed player:[ %s ] Reason:[ %s ]", gPlayers[ playerid ], gPlayers[ plr ], cmdtext[ strlen( tmp ) +7 ] );
         SendClientMessageToAll( COLOR_GREEN, szMsg );
      TogglePlayerControllable( plr, 0 );
  }
      return 1;
   }[/pawn]
this is uncuff
[pawn]   else if ( strcmp( cmd, "uncuff", true ) == 0 )
   {
      new reason[ 256 ], szMsg[ 128 ], plr;
      tmp = strtok( cmdtext, idx ), reason = strtok( cmdtext, idx ), plr = FindPlayerIDFromString( tmp );
      if ( !IsLoggedIn( playerid ) ) SendClientMessage( playerid, COLOR_RED, "Please log-in to your account." );
      else if ( !strlen(reason) ) SendClientMessage( playerid, COLOR_RED, "USAGE: /c uncuff [Nick/ID] reason" );
        else if ( plr == INACTIVE_PLAYER_ID ) SendClientMessage( playerid, COLOR_RED, "Error: Unknown player" );
      else
      {
         format( szMsg, sizeof( szMsg ), "Admin %s uncuffed player:[ %s ] Reason:[ %s ]", gPlayers[ playerid ], gPlayers[ plr ], cmdtext[ strlen( tmp ) +7 ] );
         SendClientMessageToAll( COLOR_GREEN, szMsg );
      TogglePlayerControllable( plr, 1 );
  }
      return 1;
      }   [/pawn]
enjoy
Title: Re: Cuff cmds (NEED REPORT BUGS)
Post by: kitt85711 on December 17, 2012, 08:19:27 am
The player dies because your practically drowning them with those coordinates. "-556.0719, -739.7675, 4.7610,0,0"
Title: Re: Cuff cmds (NEED REPORT BUGS)
Post by: sseebbyy on December 17, 2012, 05:37:47 pm
The player dies because your practically drowning them with those coordinates. "-556.0719, -739.7675, 4.7610,0,0"

Where you saw that ? I don't see any SetPlayerPos  ???
Title: Re: :( Cuff/ :) Uncuff commands
Post by: mrockxkingbutt on December 17, 2012, 06:04:59 pm
do you like it hey can you give me the function that only works when i am near to a player to cuff him