SA-MP Forums Archive
PutPlayerInVehicle - 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)
+--- Thread: PutPlayerInVehicle (/showthread.php?tid=636125)



PutPlayerInVehicle - Thanks - 20.06.2017

Hello everyone... i have a problem... There are no warrings/errors but Im making Put Player in the vehicle after player spawned but its not worked why please help

Код:
public OnPlayerSpawn(playerid)
{
	SetPlayerPos(playerid, 3653.7000000,385.7999900,4.0000000);
	PutPlayerInVehicle(playerid, 411, 0);
	return 1;
}
Vehicles Created:-

PHP код:
 AddStaticVehicle(4113580.9910,379.1254,4.0638,89.428701);
    
AddStaticVehicle(4113566.8286,385.8127,4.0285,89.428701);
    
AddStaticVehicle(4113547.2163,379.4239,4.0535,24.254701);
    
AddStaticVehicle(4113534.8005,382.5328,4.0535,69.254701);
    
AddStaticVehicle(4113531.4321,412.8508,4.0285,358.728301);
    
AddStaticVehicle(4113537.2339,426.5377,4.0285,358.728301);
    
AddStaticVehicle(4113544.9231,436.9366,4.0285,358.728301);
    
AddStaticVehicle(4113573.8999,437.8935,17.9285,358.999801);
    
AddStaticVehicle(411,3561.3486,442.2957,17.6555,0.5572,0,1); //
    
AddStaticVehicle(411,3561.9719,541.9423,17.6555,359.7692,0,1); //
    
AddStaticVehicle(411,3556.6824,610.9128,3.7908,88.4578,0,1); //
    
AddStaticVehicle(411,3538.3037,592.4351,3.7555,176.1072,0,1); //
    
AddStaticVehicle(411,3535.7075,618.8910,3.7806,254.3293,0,1); //
    
AddStaticVehicle(411,3590.9514,624.5386,3.7556,270.5785,0,1); //
    
AddStaticVehicle(411,3655.1255,624.3456,3.7555,267.2310,0,1); //
    
AddStaticVehicle(411,3740.2300,624.5956,3.7904,270.1866,0,1); //
    
AddStaticVehicle(411,3744.8740,580.4565,13.9317,178.5053,0,1); // 



Re: PutPlayerInVehicle - Whatname - 20.06.2017

because you use vehicle ID 411 and its probably doesnt exist

Код:
AddStaticVehicle(411, 3580.9910,379.1254,4.0638,89.4287, 0, 1); ID1
    AddStaticVehicle(411, 3566.8286,385.8127,4.0285,89.4287, 0, 1); ID 2
    AddStaticVehicle(411, 3547.2163,379.4239,4.0535,24.2547, 0, 1); ID 3 etc..
    AddStaticVehicle(411, 3534.8005,382.5328,4.0535,69.2547, 0, 1); 
    AddStaticVehicle(411, 3531.4321,412.8508,4.0285,358.7283, 0, 1); 
    AddStaticVehicle(411, 3537.2339,426.5377,4.0285,358.7283, 0, 1); 
    AddStaticVehicle(411, 3544.9231,436.9366,4.0285,358.7283, 0, 1); 
    AddStaticVehicle(411, 3573.8999,437.8935,17.9285,358.9998, 0, 1); 
    AddStaticVehicle(411,3561.3486,442.2957,17.6555,0.5572,0,1); // 
    AddStaticVehicle(411,3561.9719,541.9423,17.6555,359.7692,0,1); // 
    AddStaticVehicle(411,3556.6824,610.9128,3.7908,88.4578,0,1); // 
    AddStaticVehicle(411,3538.3037,592.4351,3.7555,176.1072,0,1); // 
    AddStaticVehicle(411,3535.7075,618.8910,3.7806,254.3293,0,1); // 
    AddStaticVehicle(411,3590.9514,624.5386,3.7556,270.5785,0,1); // 
    AddStaticVehicle(411,3655.1255,624.3456,3.7555,267.2310,0,1); // 
    AddStaticVehicle(411,3740.2300,624.5956,3.7904,270.1866,0,1); // 
    AddStaticVehicle(411,3744.8740,580.4565,13.9317,178.5053,0,1); //
PHP код:
PutPlayerInVehicle(playeridvehicleid /*not the model of the vehicle the ID of the vehicle*/state); 
also why setting playerpos if you put him in vehicle

just use PutPlayerInVehicle that's it.


Re: PutPlayerInVehicle - Loinal - 20.06.2017

Quote:
Originally Posted by Thanks
Посмотреть сообщение
Hello everyone... i have a problem... There are no warrings/errors but Im making Put Player in the vehicle after player spawned but its not worked why please help

Код:
public OnPlayerSpawn(playerid)
{
	SetPlayerPos(playerid, 3653.7000000,385.7999900,4.0000000);
	PutPlayerInVehicle(playerid, 411, 0);
	return 1;
}
Vehicles Created:-

PHP код:
 AddStaticVehicle(4113580.9910,379.1254,4.0638,89.428701);
    
AddStaticVehicle(4113566.8286,385.8127,4.0285,89.428701);
    
AddStaticVehicle(4113547.2163,379.4239,4.0535,24.254701);
    
AddStaticVehicle(4113534.8005,382.5328,4.0535,69.254701);
    
AddStaticVehicle(4113531.4321,412.8508,4.0285,358.728301);
    
AddStaticVehicle(4113537.2339,426.5377,4.0285,358.728301);
    
AddStaticVehicle(4113544.9231,436.9366,4.0285,358.728301);
    
AddStaticVehicle(4113573.8999,437.8935,17.9285,358.999801);
    
AddStaticVehicle(411,3561.3486,442.2957,17.6555,0.5572,0,1); //
    
AddStaticVehicle(411,3561.9719,541.9423,17.6555,359.7692,0,1); //
    
AddStaticVehicle(411,3556.6824,610.9128,3.7908,88.4578,0,1); //
    
AddStaticVehicle(411,3538.3037,592.4351,3.7555,176.1072,0,1); //
    
AddStaticVehicle(411,3535.7075,618.8910,3.7806,254.3293,0,1); //
    
AddStaticVehicle(411,3590.9514,624.5386,3.7556,270.5785,0,1); //
    
AddStaticVehicle(411,3655.1255,624.3456,3.7555,267.2310,0,1); //
    
AddStaticVehicle(411,3740.2300,624.5956,3.7904,270.1866,0,1); //
    
AddStaticVehicle(411,3744.8740,580.4565,13.9317,178.5053,0,1); // 
Just add a vehicle and add the player into it


Re: PutPlayerInVehicle - Whatname - 20.06.2017

he think that 411 is the vehicle ID while it's the model of the vehicle not the ID


Re: PutPlayerInVehicle - Vince - 20.06.2017

Will the game just have to guess which of the seventeen Infernuses (Inferni?) to put the player in? Does that seem logical to you at all?


Re: PutPlayerInVehicle - Whatname - 20.06.2017

Quote:
Originally Posted by Vince
Посмотреть сообщение
Will the game just have to guess which of the seventeen Infernuses (Inferni?) to put the player in? Does that seem logical to you at all?
no thats what i try to explain him


Re: PutPlayerInVehicle - Thanks - 20.06.2017

Wow Thanks its worked but If there are many players joined the derby then all players will be in 1Car? or i shoud use

Like this? or its automacily put him in another cars?
PutPlayerInVehicle(playerid, 1, 0);
PutPlayerInVehicle(playerid, 2, 0);
PutPlayerInVehicle(playerid, 3, 0);