SA-MP Forums Archive
how to tele with cars in tele dialog? - 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: how to tele with cars in tele dialog? (/showthread.php?tid=124755)



how to tele with cars in tele dialog? - Sampiscool123 - 31.01.2010

Hey,

What do i add to this code to make it tele you with the car if your in one?

Код:
if(dialogid == 4)
	{
  if(!response) return SendClientMessage(playerid, 0xFFFFFFFF, "You canceled!");
  switch(listitem)
  {
    case 0: SetPlayerPos(playerid,1322.3201,332.0854,19.4082); // Town 1
    case 1: SetPlayerPos(playerid,223.3384,-143.9687,1.5781); // Town 2
    case 2: SetPlayerPos(playerid,717.1638,-551.5009,16.1875); // Town 3
    case 3: SetPlayerPos(playerid,2268.7009,-22.5023,26.4844); // Town 4
  }
Thanks


Re: how to tele with cars in tele dialog? - thiaZ_ - 31.01.2010

pawn Код:
SetVehiclePos(GetVehicleID(playerid),Float:X,Float:Y,Float:Z);
pawn Код:
case 0:
{
  if(IsPlayerInAnyVehicle(playerid)) return SetVehiclePos(GetVehicleID(playerid),Float:X,Float:Y,Float:Z);
  SetPlayerPos(playerid,Float:X,Float:Y,Float:Z);
}




Re: how to tele with cars in tele dialog? - Sampiscool123 - 31.01.2010

Thanks very much mate i love this forum people are so helpful


Re: how to tele with cars in tele dialog? - bajskorv123 - 31.01.2010

Quote:
Originally Posted by Sampiscool123
Hey,

What do i add to this code to make it tele you with the car if your in one?

Код:
if(dialogid == 4)
	{
  if(!response) return SendClientMessage(playerid, 0xFFFFFFFF, "You canceled!");
  switch(listitem)
  {
    case 0: SetPlayerPos(playerid,1322.3201,332.0854,19.4082); // Town 1
    case 1: SetPlayerPos(playerid,223.3384,-143.9687,1.5781); // Town 2
    case 2: SetPlayerPos(playerid,717.1638,-551.5009,16.1875); // Town 3
    case 3: SetPlayerPos(playerid,2268.7009,-22.5023,26.4844); // Town 4
  }
Thanks
Try this :P
Код:
if(dialogid == 4)
{
  if(!response) return SendClientMessage(playerid, 0xFFFFFFFF, "You canceled!");
  switch(listitem)
  {
    case 0: SetPlayerPos(playerid,1322.3201,332.0854,19.4082); SetVehiclePos(GetPlayerVehicleID(playerid),1322.3201,332.0854,19.4082); // Town 1 
    case 1: SetPlayerPos(playerid,223.3384,-143.9687,1.5781); SetVehiclePos(GetPlayerVehicleID(playerid),223.3384,-143.9687,1.5781); // Town 2
    case 2: SetPlayerPos(playerid,717.1638,-551.5009,16.1875); SetVehiclePos(GetPlayerVehicleID(playerid),717.1638,-551.5009,16.1875); // Town 3
    case 3: SetPlayerPos(playerid,2268.7009,-22.5023,26.4844); SetVehiclePos(GetPlayerVehicleID(playerid),2268.7009,-22.5023,26.4844); // Town 4
  }
Quote:
Originally Posted by thiaZ_
SetVehiclePos(GetVehicleID(playerid),Flaot:X,Float:Y,Float:Z);
Lol ^^


Re: how to tele with cars in tele dialog? - thiaZ_ - 31.01.2010

just change it to "Float" omfg...


Re: how to tele with cars in tele dialog? - Sampiscool123 - 31.01.2010

It still gets errors with when i change it

Код:
case 0:
{
  SetVehiclePos(GetVehicleID(playerid),Float:X,Float:Y,Float:Z);
	if(IsPlayerInAnyVehicle(playerid)) return SetVehiclePos(GetVehicleID(playerid),Float:X,Float:Y,Float:Z);
  SetPlayerPos(playerid,Float:X,Float:Y,Float:Z);
}
error 017: undefined symbol "GetVehicleID"
error 017: undefined symbol "GetVehicleID"
error 017: undefined symbol "X"


Re: how to tele with cars in tele dialog? - ray187 - 31.01.2010

Quote:
Originally Posted by [NWA]Hannes
...
Typos are so funny aren`t they

I`d still check whether the player is in any vehicle like thiaZ_ said instead of just ignoring that.

However why would you return SetVehiclePos(GetVehicleID(playerid),Float:X,Float :Y,Float:Z); ... well whatever.

Use:

Код:
if(dialogid == 4)
{
  if(!response) return SendClientMessage(playerid, 0xFFFFFFFF, "You canceled!");
  switch(listitem)
  {
    case 0: if(IsPlayerInAnyVehicle(playerid)) SetVehiclePos(GetPlayerVehicleID(playerid),1322.3201,332.0854,19.4082); 
				else SetPlayerPos(playerid,1322.3201,332.0854,19.4082);
and so on


Re: how to tele with cars in tele dialog? - Sampiscool123 - 31.01.2010

Thanks ray and everyone who helped


Re: how to tele with cars in tele dialog? - thiaZ_ - 31.01.2010

pawn Код:
case 0:
{
  if(IsPlayerInAnyVehicle(playerid)) return SetVehiclePos(GetPlayerVehicleID(playerid),Float:X,Float:Y,Float:Z);
  SetPlayerPos(playerid,Float:X,Float:Y,Float:Z);
}
It was my mistake, it's GetPlayerVehicleID, but you have to change the positions, like you did in your example, just replace X, Y and Z with your coordinates.


Re: how to tele with cars in tele dialog? - ray187 - 31.01.2010

Again, why would you use return... what if he wanted to execute code after switch-case? Doesn`t make sense.