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