Quote:
Originally Posted by thefatshizms
pawn Код:
CMD:goto(playerid, params[]) { new id; new Float:X, Float:Y, Float:Z; if(sscanf(params,"u",id)) return SendClientMessage(playerid, -1, "USAGE: /goto [id]"); GetPlayerPos(playerid, X, Y, Z); GetPlayerPos(id, X, Y, Z); SetPlayerPos(playerid, id); return 1; }
you can guess what its supposed to do, would it work?
|
Like everyone else said, no. SetPlayerPos takes in x, y and z variables to set position to, not player ids.
Also, I don't see the point in this line:
pawn Код:
GetPlayerPos(playerid, X, Y, Z);
A line later, you overwrite it with the position of the target id - you never need the player's position anyways.
Try this, this should be ok:
pawn Код:
CMD:goto(playerid, params[])
{
//Target id:
new id;
//Variables for target id's position:
new Float:X, Float:Y, Float:Z;
if(sscanf(params,"u",id)) return SendClientMessage(playerid, -1, "USAGE: /goto [id]");
//Get position of target id:
GetPlayerPos(id, X, Y, Z);
//Set player's position to their position.
SetPlayerPos(playerid, X, Y, Z);
//..
return 1;
}