tele player and vehicle
#1

Hi all got a bit of a bug. Im tring to teleport a player and there vehicle what it does but the player ends up outside the car after they teleport any help would be great.

Код:
if(dialogid == TUNES)
		{
		if(response == 1)
			{
			switch(listitem)
			{
				case 0:
				{
					GameTextForPlayer(playerid,"~b~Transfender",3000,1);
					SetVehiclePos(GetPlayerVehicleID(playerid),1041.7133,-1037.8425,31.4627); // Teleports the vehicle
					SetPlayerPos(playerid,1041.7133,-1037.8425,31.4627); // teleports the player
				}
Reply
#2

pawn Код:
if(dialogid == TUNES)
        {
        if(response)
        {
            switch(listitem)
            {
                case 0:
                {
                    GameTextForPlayer(playerid,"~b~Transfender",3000,1);
                    new vid = GetPlayerVehicleID(playerid);
                    SetVehiclePos(vid,1041.7133,-1037.8425,31.4627); // Teleports the vehicle
                    SetPlayerPos(playerid,1041.7133,-1037.8425,31.4627); // teleports the player
                    PutPlayerInVehicle(playerid, vid, 0);
                }
Reply
#3

Код:
if(dialogid == TUNES)
		{
		if(response == 1)
			{
			switch(listitem)
			{
				case 0:
				{
					GameTextForPlayer(playerid,"~b~Transfender",3000,1);
					SetVehiclePos(GetPlayerVehicleID(playerid),1041.7133,-1037.8425,31.4627); // Teleports the vehicle
					
				}
[/QUOTE]

Remove SetPlayerPos it automaticly removes the player from his vehicle
Reply
#4

a little request how would i make this into a stock so i dont hve to type that out for every teleport.
Reply
#5

pawn Код:
stock SetPlayerAndVehiclePos(playerid, Float:x, Float:y, Float:z)
{
    new seat = GetPlayerVehicleSeat(playerid);
    new vehicleid = GetPlayerVehicleID(playerid);
    SetVehiclePos(vehicleid, x, y, z);
    PutPlayerInVehicle(playerid, vehicleid, seat);
    return 1;
}
Reply
#6

Quote:
Originally Posted by manchestera
Посмотреть сообщение
a little request how would i make this into a stock so i dont hve to type that out for every teleport.
pawn Код:
stock TeleportVehicleWithVehicle(playerid, float:X, float:Y, float:Z)
{
      new vehicleid = GetPlayerVehicleID(playerid);
      SetVehiclePos(vehicleid, X, Y, Z);
      PutPlayerInVehicle(playerid, vehicleid, 0);
}
Reply
#7

Thanks Guys tried to rep you Pharrel but wouldnt let me, and repped you ice cube.
Reply
#8

No problem
Reply
#9

Got two error Pharrel had ago but the eror list got longer and longer lol
Код:
C:\Users\GTA ONLY\My Samp Server\gamemodes\MySQL.pwn(859) : error 017: undefined symbol "vehicleid"
C:\Users\GTA ONLY\My Samp Server\gamemodes\MySQL.pwn(1083) : warning 217: loose indentation
C:\Users\GTA ONLY\My Samp Server\gamemodes\MySQL.pwn(1117) : warning 217: loose indentation
C:\Users\GTA ONLY\My Samp Server\gamemodes\MySQL.pwn(1132) : warning 217: loose indentation
C:\Users\GTA ONLY\My Samp Server\gamemodes\MySQL.pwn(1430) : error 001: expected token: ";", but found "-identifier-"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


2 Errors.
Reply
#10

Quote:
Originally Posted by manchestera
Посмотреть сообщение
Got two error Pharrel had ago but the eror list got longer and longer lol
Код:
C:\Users\GTA ONLY\My Samp Server\gamemodes\MySQL.pwn(859) : error 017: undefined symbol "vehicleid"
C:\Users\GTA ONLY\My Samp Server\gamemodes\MySQL.pwn(1083) : warning 217: loose indentation
C:\Users\GTA ONLY\My Samp Server\gamemodes\MySQL.pwn(1117) : warning 217: loose indentation
C:\Users\GTA ONLY\My Samp Server\gamemodes\MySQL.pwn(1132) : warning 217: loose indentation
C:\Users\GTA ONLY\My Samp Server\gamemodes\MySQL.pwn(1430) : error 001: expected token: ";", but found "-identifier-"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


2 Errors.
Have you tryed the one I posted?[/I]
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)