Mark and Recall
#1

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?

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;
}
Reply


Messages In This Thread
Mark and Recall - by Rhemsis - 11.02.2010, 19:31
Re: Mark and Recall - by woot - 11.02.2010, 19:34
Re: Mark and Recall - by Grim_ - 11.02.2010, 19:35
Re: Mark and Recall - by Rhemsis - 11.02.2010, 19:44
Re: Mark and Recall - by Grim_ - 11.02.2010, 19:48
Re: Mark and Recall - by Streetplaya - 11.02.2010, 19:57
Re: Mark and Recall - by Grim_ - 11.02.2010, 19:58
Re: Mark and Recall - by Rhemsis - 11.02.2010, 20:02
Re: Mark and Recall - by Grim_ - 11.02.2010, 20:07
Re: Mark and Recall - by Rhemsis - 11.02.2010, 20:15
Re: Mark and Recall - by Grim_ - 11.02.2010, 20:49
Re: Mark and Recall - by Rhemsis - 12.02.2010, 01:05
Re: Mark and Recall - by Daren_Jacobson - 12.02.2010, 03:01

Forum Jump:


Users browsing this thread: 2 Guest(s)