CMD:goto(playerid,params[]) { new ID; new Float:X; 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; } |
CMD:tele(playerid, params[]) { if(isnull(params)) // IF you didn't type any parameter... then It'll show you the option. { //then SendClientMessage(playerid, -1, "* Usage: /tele [input]"); //send this message SendClientMessage(playerid, -1, " *** LS,SF,LV"); // Locations you can TP to return 1; } if(strcmp(params,"ls",true) == 0) //if player types the parameter "ls" { //then SetPlayerPos(playerid, 0, 0, 0); // sets the player's position to this coordinates. } else if (strcmp(params,"sf",true) == 0) //else if player types the params "sf" { //then SetPlayerPos(playerid, 0, 0, 0); // sets the player's position to this coordinates. } else if (strcmp(params,"lv",true) == 0) //else if player types the params "lv" { //then SetPlayerPos(playerid, 0, 0, 0);// sets the player's position to this coordinates. } return 1; // returns as true }
CMD:goto(playerid,params[]) { new ID, // Float:X, Float:Y, Float:Z, Float:A; if(sscanf(params,"i", ID)) return SendClientMessage(playerid,-1,"* Usage: /goto [player]"); // Refer to my previous explaination. GetPlayerPos(ID, X,Y,Z); // Getting position of the player you want to TP to. GetPlayerFacingAngle(ID, A); // Getting his facing angle. SetPlayerPos(playerid, X,Y+5,Z); // Setting your position , playerid refers to you & ID refers to the player you're wanting to TP to. SetPlayerFacingAngle(playerid, A); // setting your facing angle SendClientMessage(playerid, -1, " You have successfully been teleported."); return 1; }
i don't need goto/teleport commands, it's example, read the again
![]() |
if(!strcmp(cmdtext[4],"goto",true) || !strcmp(cmdtext[4],"tele",true))