Teleport to player.
#1

This command don't teleport to the player location.


Код:
CMD:tpto(playerid, params[])
{
	new id = isnull(params);
    if(isnull(params)) return SendClientMessage(playerid, COLOUR_WHITE, "Usage: /tpto [playerid]");
    if(!IsPlayerConnected(id)) return SendClientMessage(playerid, COLOUR_WHITE, "Player is not connected");
	else
	{
		new Float:X, Float:Y, Float:Z, Pname[24];
		GetPlayerPos(id, X, Y, Z);
		GetPlayerName(id, Pname, 24);
        SetPlayerPos(playerid, X, Y, Z);
		new String[56];
		format(String, sizeof(String), "%s teleported to you", Pname, id);
		SendClientMessage(id, COLOUR_WHITE, String);
	}
	return 1;
}
Reply
#2

Try that:
new userid;
if(sscanf(params, "u", userid)) return Your Message;
Reply
#3

try this?
PHP код:
CMD:tpto(playeridparams[])
{
    new 
id isnull(params);
    if(
isnull(params)) return SendClientMessage(playerid, -1"Usage: /tpto [playerid]");
    if(!
IsPlayerConnected(id)) return SendClientMessage(playerid, -1"Player is not connected");
    new 
Float:XFloat:YFloat:ZPname[24];
    new 
String[56];
    
GetPlayerPos(idXYZ);
    
GetPlayerName(idPname24);
    
SetPlayerPos(playeridXYZ);
    
format(Stringsizeof(String), "%s teleported to you"Pnameid);
    
SendClientMessage(id, -1String);
    return 
1;

Reply
#4

nvm. thanks.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)