SA-MP Forums Archive
putplayerinvehicle problem - 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: putplayerinvehicle problem (/showthread.php?tid=128778)



putplayerinvehicle problem - jaksimaksi - 19.02.2010

I have a problem with this command:

Код:
	dcmd_stunt(playerid,params[])
{
	#pragma unused params
{
    PutPlayerInVehicle(playerid, stuntcar, 0);
   	SetPlayerPos(playerid,-2402.2542,734.2985,35.0156);
   	SetPlayerVirtualWorld(playerid,5);
   	}
	  new string[256];
  		new pName[30];
   	GetPlayerName(playerid, pName, 30);
   	format(string, 280, " %s in stunt", pName);
   	SendClientMessageToAll(ORRANGE, string);
   	}
    return 1;
when i type /stunt i dont get in the nrg-500, where is the problem?


Re: putplayerinvehicle problem - ¤Adas¤ - 19.02.2010

PutPlayerInVehicle must be at the end. When you use PutPlayerInVehicle and then SetPlayerPos, player will be removed from his vehicle. When the position in your SetPlayerPos is the same as the position of the vehicle, just remove it. Else use SetVehiclePos.


Re: putplayerinvehicle problem - jaksimaksi - 19.02.2010

Its possible to put player in vehicle with set player pos...

my code looks like that:
Код:
	dcmd_stunt(playerid,params[])
{
	#pragma unused params
 {
   	SetPlayerPos(playerid,-2402.2542,734.2985,35.0156);
   	SetPlayerVirtualWorld(playerid,5);
   	}
	  new string[256];
  		new pName[30];
   	GetPlayerName(playerid, pName, 30);
   	format(string, 280, "[/stunt] %s Prisijungл б stunt юaidimа", pName);
   	SendClientMessageToAll(ORRANGE, string);
    PutPlayerInVehicle(playerid, stuntcar, 0);
   	return 1;
   	}
But player is not puting in the nrg, what wrong?


Re: putplayerinvehicle problem - kLx - 19.02.2010

Do you have
Код:
new stuntcar = CreateVehicle(......);
?


Re: putplayerinvehicle problem - jaksimaksi - 19.02.2010

yes


Re: putplayerinvehicle problem - ¤Adas¤ - 19.02.2010

And do you have SetVehicleVirtualWorld(vehicleid, 5)?


Re: putplayerinvehicle problem - jaksimaksi - 19.02.2010

hm, now i done that, when i type /stunt i get in nrg but not in my seted player pos
I get to farm..


Re: putplayerinvehicle problem - BlackFoX - 19.02.2010

Код:
dcmd_stunt(playerid,params[])
{
#pragma unused params
new string[64],pName[MAX_PLAYER_NAME];
GetPlayerName(playerid, pName, sizeof pName);
format(string, sizeof string, "[/stunt] %s Prisijungл б stunt юaidimа", pName);
SendClientMessageToAll(ORRANGE, string);
new stuntcar = CreateVehicle(......); // Change it by yourself
PutPlayerInVehicle(playerid, stuntcar, 0);
SetPlayerPos(playerid,-2402.2542,734.2985,35.0156);
SetPlayerVirtualWorld(playerid,5);
return LinkVehicleToVirtualWorld(....); // Change it by yourself
}



Re: putplayerinvehicle problem - jaksimaksi - 19.02.2010

Quote:
Originally Posted by BlackFoX_UD_
Код:
dcmd_stunt(playerid,params[])
{
#pragma unused params
new string[64],pName[MAX_PLAYER_NAME];
GetPlayerName(playerid, pName, sizeof pName);
format(string, sizeof string, "[/stunt] %s Prisijungл б stunt юaidimа", pName);
SendClientMessageToAll(ORRANGE, string);
new stuntcar = CreateVehicle(......); // Change it by yourself
PutPlayerInVehicle(playerid, stuntcar, 0);
SetPlayerPos(playerid,-2402.2542,734.2985,35.0156);
SetPlayerVirtualWorld(playerid,5);
return LinkVehicleToVirtualWorld(....); // Change it by yourself
}
still not working, btw linkvehicletovirtualworld? wtf? do u mean setvehicleto virtualworld? i tryed this stuff, but it's still not working


Re: putplayerinvehicle problem - BlackFoX - 19.02.2010

Sorry Sa-mp dont Contains a Function like this i forget it xD