SA-MP Forums Archive
[question] playerid - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: [question] playerid (/showthread.php?tid=234559)



[question] playerid - JOKERBOY - 03.03.2011

hello, was wondering how I know playerid a User ...
and as I turn the player back to where it left last time?


Re: [question] playerid - Stigg - 03.03.2011

Can you make your query a little clearer ?


Re: [question] playerid - austin070 - 03.03.2011

I think he's asking how to identify a player, and how to make him spawn at last position he was at when he left.


- JOKERBOY - 04.03.2011

austin070 yes that's right!

you can help my question ?


Re: [question] playerid - Marricio - 04.03.2011

you can identify a player as playerid.
you can return a player to his old position saving the pos when the player leaves the server and when he connects again load the user file and check the pos, and then set his pos to X.


Re: [question] playerid - JOKERBOY - 04.03.2011

How i find playerid of a User?
AND
How I Faso for him to come in the last coordinate a User?


Re: [question] playerid - Mean - 04.03.2011

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 );
}



Re: [question] playerid - Sasino97 - 04.03.2011

Quote:
Originally Posted by JOKERBOY
Посмотреть сообщение
How i find playerid of a User?
AND
How I Faso for him to come in the last coordinate a User?
The playerid is not an user id, it's the id which he enters in the server.

You have to register it by creating files.


Re: [question] playerid - JOKERBOY - 04.03.2011

ok !
But how i can registres the users ?