25.01.2011, 22:41
I really suggest you switch to ZCMD for faster and more efficient command processing.
The following code is untested:
Obviously, this is the base of the command. Adjust as necessary.
The following code is untested:
pawn Код:
if( !strcmp( cmdtext, "/slap", true ) )
{
if( !cmdtext[ 5 ] ) return 0; // No parameters entered
if( !IsPlayerConnected( strval( cmdtext[ 6 ] ) ) ) return 0; // target not connected
new Float: Pos[ 3 ];
GetPlayerPos( playerid, Pos[ 0 ], Pos[ 1 ], Pos[ 2 ] );
SetPlayerPos( strval( cmdtext[ 6 ] ), Pos[ 0 ], Pos[ 1 ], Pos[ 2 ] );
return 1;
}