[question] playerid
#7

pawn Код:
GetPlayerID( const name[ ], partofname=true/false );
You want a CMD like GOTO [ID] ?
If so, then:
sscanf + zcmd
pawn Код:
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 );
}
Reply


Messages In This Thread
[question] playerid - by JOKERBOY - 03.03.2011, 23:42
Re: [question] playerid - by Stigg - 03.03.2011, 23:44
Re: [question] playerid - by austin070 - 03.03.2011, 23:49
[No subject] - by JOKERBOY - 04.03.2011, 00:27
Re: [question] playerid - by Marricio - 04.03.2011, 00:49
Re: [question] playerid - by JOKERBOY - 04.03.2011, 09:32
Re: [question] playerid - by Mean - 04.03.2011, 09:41
Re: [question] playerid - by Sasino97 - 04.03.2011, 11:36
Re: [question] playerid - by JOKERBOY - 04.03.2011, 11:45

Forum Jump:


Users browsing this thread: 1 Guest(s)