[SOLVED]/maketpexit - doesn't save the VirtualWorld of the player
#1

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

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

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


Forum Jump:


Users browsing this thread: 1 Guest(s)