11.02.2010, 19:31
I'm attempting to make two commands, /mark, and /recall.
/mark gets your current position and saves it.
/recall sets your position to the saved /mark location.
When I type /mark, everything seems to go fine, but upon /recall, I am teleported to the coordinates 0,0,0 which leads to an endless fall seeing as how 0,0,0 is underground.
The code is below, anyone know what I did wrong?
/mark gets your current position and saves it.
/recall sets your position to the saved /mark location.
When I type /mark, everything seems to go fine, but upon /recall, I am teleported to the coordinates 0,0,0 which leads to an endless fall seeing as how 0,0,0 is underground.
The code is below, anyone know what I did wrong?
pawn Код:
if(strcmp(cmdtext, "/mark", true) == 0)
if(PlayerAdminLevel[playerid] == 1337)
{
new Float:p[3];
GetPlayerPos(playerid,p[0],p[1],p[2]);
new tempx[MAX_PLAYERS];
new tempy[MAX_PLAYERS];
new tempz[MAX_PLAYERS];
p[0]=tempx[playerid];
p[1]=tempy[playerid];
p[2]=tempz[playerid];
Markx[playerid]=tempx[playerid];
Marky[playerid]=tempy[playerid];
Markz[playerid]=tempz[playerid];
SendClientMessage(playerid, COLOR_ERROR, "Tether Set!");
return 1;
}
if(strcmp(cmdtext, "/recall", true) == 0)
if(PlayerAdminLevel[playerid] == 1337)
{
SetPlayerPos(playerid,Markx[playerid],Marky[playerid],Markz[playerid]);
SendClientMessage(playerid, COLOR_ERROR, "Teleported to marker!");
return 1;
}