SA-MP Forums Archive
Why Will This Teleport Not Work? (maybe paste the correct here) - 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: Why Will This Teleport Not Work? (maybe paste the correct here) (/showthread.php?tid=72191)



Why Will This Teleport Not Work? (maybe paste the correct here) - BP13 - 06.04.2009

I need a teleport setup in this format:

Код:
// Command: /dive3
	if(strcmp(cmdtext, "/dive3", true)==0)
	{
 	new vehicleid = GetPlayerVehicleID(playerid);
 	new State = GetPlayerState(playerid);
 	if(IsPlayerInAnyVehicle(playerid) && State == PLAYER_STATE_DRIVER)
 	{
  return SetVehiclePos(vehicleid,2064.3633,2442.2717,165.6172),
  GameTextForPlayer(playerid, "~w~Dive Jump ~G~3", 5000, 5);
 	}
 	SetPlayerPos(playerid,2064.3633,2442.2717,165.6172);
 	GameTextForPlayer(playerid, "~w~Dive Jump ~G~3", 5000, 5);
	return 1;
}

but the tele I need to add is in this format


Код:
if (!strcmp("/skroad", cmdtext, true))
	{
	 	SetPlayerPosWithVehicle(playerid, 3893.8152, -1623.4252, 1442.5, 360, cmdtext);
		return 1;
when I paste the location on the top one I get

[
Код:
sub]C:\PROGRA~1\SA-MPS~1\FILTER~1\xObjectz.pwn(489) : error 017: undefined symbol "SetPlayerPosWithVehicle"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.
is SetPlayerPosWithVheicle in a include? on the other file I got this tele from is (INC):

Код:
#include <a_samp>
#include <dini>
#include <dudb>




Re: Why Will This Teleport Not Work? (maybe paste the correct here) - BP13 - 06.04.2009

anyone?


Re: Why Will This Teleport Not Work? (maybe paste the correct here) - NeRoSiS - 06.04.2009

I see your using a generator judging by your indentation, here is how it should look.

Код:
  if(strcmp(cmdtext,"/dive3",true)==0)
	{
		new vehicleid = GetPlayerVehicleID(playerid);
		new State = GetPlayerState(playerid);
		if(IsPlayerInAnyVehicle(playerid) && State == PLAYER_STATE_DRIVER)
		{
			GameTextForPlayer(playerid, "~w~Dive Jump ~G~3", 5000, 5);
			return SetVehiclePos(vehicleid,2064.3633,2442.2717,165.6172);
		}
		SetPlayerPos(playerid,2064.3633,2442.2717,165.6172);
		GameTextForPlayer(playerid, "~w~Dive Jump ~G~3", 5000, 5);
		return 1;
	}
If hes on foot it teleports him, if hes in a vehicle it teleports him nd vehicle, if you want it so you can ONLY teleport in a vehilce, set it up like this.


Код:
  if(strcmp(cmdtext,"/skroad",true)==0)
	{
		new vehicleid = GetPlayerVehicleID(playerid);
		new State = GetPlayerState(playerid);
		if(IsPlayerInAnyVehicle(playerid) && State == PLAYER_STATE_DRIVER)
		{
			GameTextForPlayer(playerid, "SKROAD", 5000, 5);
			return SetVehiclePos(vehicleid,3893.8152, -1623.4252, 1442.5);
		}
		GameTextForPlayer(playerid, "You are not in a vehicle!", 5000, 5);
		return 1;
	}
Hope that explains it.


Re: Why Will This Teleport Not Work? (maybe paste the correct here) - BP13 - 09.04.2009

Thanks it did


Re: Why Will This Teleport Not Work? (maybe paste the correct here) - OmeRinG - 09.04.2009

this is an undone generator by me it makes a teleport in seconds with car/without car or however you like it (full version probably won't be released):
http://www.fileflyer.com/view/lcUPZAR
enjoy...


Re: Why Will This Teleport Not Work? (maybe paste the correct here) - Badger(new) - 09.04.2009

i generally prefer to write my own teleports since they need to work in certain ways. and it's pretty easy.