Skip to content

Instantly share code, notes, and snippets.

@m0k1
Created May 28, 2015 15:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save m0k1/acca27c8f899525ad472 to your computer and use it in GitHub Desktop.
Save m0k1/acca27c8f899525ad472 to your computer and use it in GitHub Desktop.
xgoto by m0k1
#include <sscanf2> // By Y_Less, 2.8.2: http://forum.sa-mp.com/showthread.php?t=570927
#include <YSI\y_commands> // By Y_Less, f4d85a8: http://forum.sa-mp.com/showthread.php?t=570884
#include <YSI\y_master> // By Y_Less, f4d85a8: http://forum.sa-mp.com/showthread.php?t=570884
YCMD:xgoto(playerid, params[], help)
{
new string[256], Float:x,Float:y,Float:z;
if(sscanf(params, "fff", x,y,z)) return SendClientMessage(playerid, -1, ""#SMCOLOR"[SM:CMD] {FFFF00}/xgoto [x] [y] [z]");
format(string, sizeof(string), ""#SMCOLOR"[SM] {FFFF00}Portovao si se do %f %f %f", x,y,z);
SendClientMessage(playerid, COLOR_LIGHTRED2, string);
if (GetPlayerState(playerid) == 2)
{
new gTempcar = GetPlayerVehicleID(playerid);
SetVehiclePos(gTempcar, Float:x, Float:y, Float:z);
}
else
{
SetPlayerPos(playerid, Float:x, Float:y, Float:z);
}
return 1;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment