SA-MP Forums Archive
Teleport command ain't working - 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: Teleport command ain't working (/showthread.php?tid=132032)



Teleport command ain't working - Andy_McKinley - 06.03.2010

This is my problem. The command ain't working.

pawn Код:
//deserteagle
    if(strcmp(cmdtext, "/deserteagle", true) == 0)
    {
    ResetPlayerWeapons();
    GivePlayerWeapon(playerid, 24, 1000);
      SetPlayerPos(-2672.5190,1410.3302,907.5703,272.2658,0,0,0,0,0,0);
      SetPlayerInterior(playerid, 3);
      return 1;
  }
Warnings:

Код:
D:\DOCUME~1\ANDY~1\MYDOC~1\_UF_SF~1\GAMEMO~1\_UF_SF~1.PWN(1034) : warning 202: number of arguments does not match definition
D:\DOCUME~1\ANDY~1\MYDOC~1\_UF_SF~1\GAMEMO~1\_UF_SF~1.PWN(1036) : warning 213: tag mismatch
D:\DOCUME~1\ANDY~1\MYDOC~1\_UF_SF~1\GAMEMO~1\_UF_SF~1.PWN(1036) : warning 202: number of arguments does not match definition
D:\DOCUME~1\ANDY~1\MYDOC~1\_UF_SF~1\GAMEMO~1\_UF_SF~1.PWN(1036) : warning 202: number of arguments does not match definition
D:\DOCUME~1\ANDY~1\MYDOC~1\_UF_SF~1\GAMEMO~1\_UF_SF~1.PWN(1036) : warning 202: number of arguments does not match definition
D:\DOCUME~1\ANDY~1\MYDOC~1\_UF_SF~1\GAMEMO~1\_UF_SF~1.PWN(1036) : warning 202: number of arguments does not match definition
D:\DOCUME~1\ANDY~1\MYDOC~1\_UF_SF~1\GAMEMO~1\_UF_SF~1.PWN(1036) : warning 202: number of arguments does not match definition
D:\DOCUME~1\ANDY~1\MYDOC~1\_UF_SF~1\GAMEMO~1\_UF_SF~1.PWN(1036) : warning 202: number of arguments does not match definition
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


8 Warnings.
I used /save loc in-game:
pawn Код:
AddPlayerClass(287,-2672.5190,1410.3302,907.5703,272.2658,0,0,0,0,0,0); // loc



Re: Teleport command ain't working - GaGlets(R) - 06.03.2010

Set Player interior before teleporting and..
SetPlayer pos need only X,Y,Z !!
You have X,Y,Z,Angle,wep1,ammo1,wep2,ammo2,wep3,ammo3 -
It means that you need to remove
Код:
,272.2658,0,0,0,0,0,0
Full code
Код:
  //deserteagle
  if(strcmp(cmdtext, "/deserteagle", true) == 0)
  {
      SetPlayerInterior(playerid, 3);
	  SetPlayerPos(-2672.5190,1410.3302,907.5703);
      ResetPlayerWeapons();
      GivePlayerWeapon(playerid, 24, 1000);
	  return 1;
  }



Re: Teleport command ain't working - Andy_McKinley - 06.03.2010

Quote:
Originally Posted by GaGlets®
Set Player interior before teleporting and..
SetPlayer pos need only X,Y,Z !!
You have X,Y,Z,Angle,wep1,ammo1,wep2,ammo2,wep3,ammo3 -
It means that you need to remove
Код:
,272.2658,0,0,0,0,0,0
Full code
Код:
  //deserteagle
  if(strcmp(cmdtext, "/deserteagle", true) == 0)
  {
      SetPlayerInterior(playerid, 3);
	  SetPlayerPos(-2672.5190,1410.3302,907.5703);
      ResetPlayerWeapons();
      GivePlayerWeapon(playerid, 24, 1000);
	  return 1;
  }
Код:
D:\DOCUME~1\ANDY~1\MYDOC~1\_UF_SF~1\GAMEMO~1\_UF_SF~1.PWN(1035) : warning 213: tag mismatch
D:\DOCUME~1\ANDY~1\MYDOC~1\_UF_SF~1\GAMEMO~1\_UF_SF~1.PWN(1035) : warning 202: number of arguments does not match definition
D:\DOCUME~1\ANDY~1\MYDOC~1\_UF_SF~1\GAMEMO~1\_UF_SF~1.PWN(1036) : warning 202: number of arguments does not match definition
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


3 Warnings.
Btw, your command isn't working.



Re: Teleport command ain't working - aircombat - 06.03.2010

that's the right code

Код:
    if(strcmp(cmdtext, "/deserteagle", true) == 0)
	  {
      ResetPlayerWeapons(playerid); // added playerid
      GivePlayerWeapon(playerid, 24, 1000);
	  SetPlayerPos(playerid,-2672.5190,1410.3302,907.5703); // format should be SetPlayerPos(playerid,x,y,z);
	  SetPlayerInterior(playerid, 3);
	  return 1;
      }
________
LovelyWendie


Re: Teleport command ain't working - GaGlets(R) - 06.03.2010

Quote:
Originally Posted by [AC
Etch ]
that's the right code

Код:
    if(strcmp(cmdtext, "/deserteagle", true) == 0)
	 {
      ResetPlayerWeapons(playerid); // added playerid
      GivePlayerWeapon(playerid, 24, 1000);
	  SetPlayerPos(playerid,-2672.5190,1410.3302,907.5703); // format should be SetPlayerPos(playerid,x,y,z);
	  SetPlayerInterior(playerid, 3);
	  return 1;
      }
ohh yes forgot playerid XDD


Re: Teleport command ain't working - Andy_McKinley - 06.03.2010

Quote:
Originally Posted by [AC
Etch ]
that's the right code

Код:
    if(strcmp(cmdtext, "/deserteagle", true) == 0)
	 {
      ResetPlayerWeapons(playerid); // added playerid
      GivePlayerWeapon(playerid, 24, 1000);
	  SetPlayerPos(playerid,-2672.5190,1410.3302,907.5703); // format should be SetPlayerPos(playerid,x,y,z);
	  SetPlayerInterior(playerid, 3);
	  return 1;
      }
Thanks, this one works and now I know how to do it next time !


Re: Teleport command ain't working - aircombat - 06.03.2010

Quote:
Originally Posted by DarkPhoenix
Quote:
Originally Posted by [AC
Etch ]
that's the right code

Код:
    if(strcmp(cmdtext, "/deserteagle", true) == 0)
	  {
      ResetPlayerWeapons(playerid); // added playerid
      GivePlayerWeapon(playerid, 24, 1000);
	  SetPlayerPos(playerid,-2672.5190,1410.3302,907.5703); // format should be SetPlayerPos(playerid,x,y,z);
	  SetPlayerInterior(playerid, 3);
	  return 1;
      }
urw
Thanks, this one works and now I know how to do it next time !
________
ANAL PLUG


Re: Teleport command ain't working - GaGlets(R) - 06.03.2010

BTW - Rset and give weapons AFTER TELEPORT !! LOL


Re: Teleport command ain't working - aircombat - 06.03.2010

Quote:
Originally Posted by GaGlets®
BTW - Rset and give weapons AFTER TELEPORT !! LOL
it doesnt matter lol , cause no one can do half of the command and don't teleport xD
________
Lamborghini Gallardo Specifications