SA-MP Forums Archive
[SOLVED]/maketpexit - doesn't save the VirtualWorld of the player - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: [SOLVED]/maketpexit - doesn't save the VirtualWorld of the player (/showthread.php?tid=79829)



[SOLVED]/maketpexit - doesn't save the VirtualWorld of the player - Castle - 31.05.2009

Heres the CMD: http://pastebin.com/m310979ef
Whats wrong with it, the only bug I found with it...


Re: /maketpexit - doesn't save the VirtualWorld of the player - MenaceX^ - 31.05.2009

I suggest you to debug it, then you can see if the player's position isn't correct, or the Saving part isn't correct.
pawn Код:
if(!strcmp(cmd,"/maketpexit",true)||!strcmp(cmd,"/mtpex",true))
{
  if(IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid,COLOR_GRAD1,"You can't use this while being in a car");
  if(PlayerInfo[playerid][pAdmin]<4) return error(playerid);
  tmp = strtok(cmdtext, idx);
  if(!strlen(tmp)) return SendClientMessage(playerid,COLOR_GRAD1,"[USAGE:] (/mtpex)/maketpexit [TPID]");
  new tpid = strval(tmp);
  new tpstring[128];
  new Float:mteX,Float:mteY,Float:mteZ,Float:mteA;
  GetPlayerPos(playerid,mteX,mteY,mteZ);
  GetPlayerFacingAngle(playerid,mteA);
  Teleport[tpid][tpexX]=mteX;
  Teleport[tpid][tpexY]=mteY;
  Teleport[tpid][tpexZ]=mteZ;
  Teleport[tpid][tpexA]=mteA;
  Teleport[tpid][tpexInterior]=GetPlayerInterior(playerid);
  Teleport[tpid][tpexWorld]=GetPlayerVirtualWorld(playerid);
  printf("Virtual World: %d.",Teleport[tpid][tpexWorld]);
  SaveTeleports();
  format(tpstring,sizeof(tpstring),"Dynamic Teleport %d Exit Location Set",tpid);
  SendClientMessage(playerid,COLOR_ADMINCMD,tpstring);
  return 1;
}



Re: /maketpexit - doesn't save the VirtualWorld of the player - Castle - 31.05.2009

Fixed it, saved the Virtual world into a Variable and then used the variable to save into the file and it worked.
Thanks anyways