how to tele with cars in tele dialog?
#1

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
Reply
#2

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);
}

Reply
#3

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

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 ^^
Reply
#5

just change it to "Float" omfg...
Reply
#6

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"
Reply
#7

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
Reply
#8

Thanks ray and everyone who helped
Reply
#9

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.
Reply
#10

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


Forum Jump:


Users browsing this thread: 1 Guest(s)