Help me, teleport command. - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Help me, teleport command. (
/showthread.php?tid=446516)
Help me, teleport command. -
volcaN131 - 26.06.2013
Hey guys, I made a teleport command script which teleports you to the co-ordinates you chose.
PHP код:
if(strcmp(cmd, "/xgoto", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(PlayerInfo[playerid][pAdmin] < 5)
{
SendClientMessage(playerid,COLOR_GRAD2,"Permission Denied.");
return 1;
}
}
new Float:x, Float:y, Float:z;
new string[100];
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "Usage: /xgoto <X Float> <Y Float> <Z Float>");
return 1;
}
return 1;
}
It's not working, please help me to find the mistake and how I can fix it?
Thanks in advance, volcaN131.
Re: Help me, teleport command. -
SMW - 26.06.2013
try this :
pawn Код:
CMD:xgoto(playerid, params[]){
if(PlayerInfo[playerid][pAdmin] >= 5){
new Float: pos[3], int;
if(sscanf(params, "fffd", pos[0], pos[1], pos[2], int)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /gotoco [x coordinate] [y coordinate] [z coordinate] [interior]");
SendClientMessage(playerid, COLOR_GRAD2, "You have been teleported to the coordinates specified.");
SetPlayerPos(playerid, pos[0], pos[1], pos[2]);
SetPlayerInterior(playerid, int);
}
return 1;
}
}
Re: Help me, teleport command. -
volcaN131 - 26.06.2013
Where should I paste it man?
Re: Help me, teleport command. -
SMW - 26.06.2013
try to use ZCMD dude ..
paste it anywhere outside other method / function in ur script ..