Introduction:


- Hello, today I'm gonna show you today how to make a simple /Goto Command .
- After start, you need to have SSCANF and ZCMD.


Let's start:


- After downloaded and put includes in "pawno/include" folder, we can start scripting. So we need to add that includes, at the top of script:

Code:
#include <a_samp>
#include <zcmd>
#include <sscanf>


- Then, after adding includes, we scroll down, down, and we there we will made /goto command !

Code:
CMD:goto(playerid,params[]) // This it's /Goto command. You can change in your wanted command !
{ // We open brackelet
new ID; // This it's player's ID wich we will teleport !
new Float; // This it's position X position of that player !
new Float:Y; // This it's position Y position of that player !
new Float:Z; // This it's position z position of that player !
new Float:A; // This the Facing Angle position of that player !
if(sscanf(params,"i", ID)) return SendClientMessage(playerid,-1,"{FF0000}AdmUsage: {15FF00}/Goto [PlayerID]"); // He will saw this on screen, if he write just /Goto . Will show to him Correct Usage !
GetPlayerPos(ID, X,Y,Z); // Will get that player Position X,Y,Z !
GetPlayerFacingAngle(ID, A); // Will get that player Facing Angle position !
SetPlayerPos(playerid, X,Y,Z); // Will set the player who type /Goto [ID] to specified player !
SetPlayerFacingAngle(playerid, A); // Will set exactlly that Facing Angle of specified player !
SendClientMessage(playerid, -1, "{FF0000}Cmd: {15FF00}You teleported to specified player !"); // He will saw a message. "You teleported to specified player"
return 1; // Return value !
} // Close brackelet to show we finished command !

All Code:


Code:
#include <a_samp>
#include <zcmd>
#include <sscanf>

CMD:goto(playerid,params[])
{
new ID;
new Float;
new Float:Y;
new Float:Z;
new Float:A;
if(sscanf(params,"i", ID)) return SendClientMessage(playerid,-1,"{FF0000}AdmUsage: {15FF00}/Goto [PlayerID]");
GetPlayerPos(ID, X,Y,Z);
GetPlayerFacingAngle(ID, A);
SetPlayerPos(playerid, X,Y,Z);
SetPlayerFacingAngle(playerid, A);
SendClientMessage(playerid, -1, "{FF0000}Cmd: {15FF00}You teleported to specified player !");
return 1;
}