31.03.2012, 15:56
Maybe try this.
Also make sure you have a global variable named new draggedtimer[MAX_PLAYERS];
pawn Код:
CMD:drag( playerid, params[] )
{
new ID, string[64], string2[64];
if ( sscanf( params, "u", ID ) ) return(SendClientMessage( playerid, COLOR_WHITE, "CMD:/drag [playerid]" ) );
if ( !PlayerCuffed[ID] ) return(SendClientMessage( playerid, COLOR_WHITE, "This player must first be cuffed" ) );
if ( !Dragged[ID] && !Dragging[playerid] )
{
Dragged[ID] = 1;
Dragging[playerid] = 1;
format( string, sizeof(string), "You are being dragged by %s.", RemoveUnderScore( playerid ) );
format( string2, sizeof(string2), " You are dragging %s.", RemoveUnderScore( ID ) );
SendClientMessage( playerid, PURPLE, string2 );
SendClientMessage( ID, PURPLE, string );
draggedtimer[ID] = SetTimerEx( "Dragging1", 1000, true, "dd", playerid, ID );
} else {
Dragged[ID] = 0;
Dragging[playerid] = 0;
SendClientMessage( playerid, PURPLE, "You have stopped dragging your target." );
SendClientMessage( ID, PURPLE, "You aren't being dragged anymore." );
KillTimer( draggedtimer[ID] );
}
return(1);
}