03.03.2011, 23:42
hello, was wondering how I know playerid a User ...
and as I turn the player back to where it left last time?
and as I turn the player back to where it left last time?
GetPlayerID( const name[ ], partofname=true/false );
CMD:goto( playerid, params[ ] )
{
if( !IsPlayerAdmin( playerid ) ) return false;
new id; if( sscanf( params, "u", id ) ) return SendClientMessage( playerid, 0xAAAAAA, "Usage: /goto [ID]" );
if( id == INVALID_PLAYER_ID ) return SendClientMessage( playerid, 0xAAAAAA, "Invalid ID" );
new Float:pos[ 2 ];
GetPlayerPos( id, pos[ 0 ], pos[ 1 ], pos[ 2 ] );
SetPlayerPos( playerid, pos[ 0 ], pos[ 1 ], pos[ 2 ] );
new string[ 128 ];
new name[ 24 ]; GetPlayerName( id, name, 24 );
format( string, sizeof string, "You have teleported to %s", name );
return SendClientMessage( playerid, 0xAAAAAA, string );
}