03.03.2010, 06:02
Quote:
Originally Posted by Serafim_sd
перед SetPlayerPos(playerid, x+0.5, y, z+1.0); поставь PutPlayerInVehicle(playerid,vehicleID,1);
|
Originally Posted by Serafim_sd
перед SetPlayerPos(playerid, x+0.5, y, z+1.0); поставь PutPlayerInVehicle(playerid,vehicleID,1);
|
Originally Posted by ^Faus
Тоже самое
как то не парюсь, трамвай боты водят, а я на крышах езжу. |
Originally Posted by ^Faus
Просто у нас скрипт посадки от damospiderman, лень писать свой.
|
public OnPlayerStateChange(playerid, newstate, oldstate)
{
static bool:playerintram[MAX_PLAYERS];
if(newstate==PLAYER_STATE_DRIVER || newstate==PLAYER_STATE_PASSENGER)
{
new vehicleid = GetPlayerVehicleID(playerid);
if( GetVehicleModel(vehicleid)==449 )
playerintram[playerid]=true;
}
if((oldstate==PLAYER_STATE_DRIVER || oldstate==PLAYER_STATE_PASSENGER) && (newstate==PLAYER_STATE_ONFOOT || newstate==PLAYER_STATE_SPECTATING || newstate==PLAYER_STATE_WASTED))
{
if( playerintram[playerid] )
playerintram[playerid]=false,
SetCameraBehindPlayer(playerid);
}
return 1;
}
#include <a_samp> public OnFilterScriptInit() { CreateVehicle(449,2208.1348,-1673.2509,14.3531,165.3176,5,5,100); SetPlayerPos(0,2208.1348,-1673.2509,17.3531); }
Originally Posted by Geryy
Quote:
|
if(newkeys == KEY_SECONDARY_ATTACK) // садится в RC транспорт, поезда и трамваи { if(IsPlayerInAnyVehicle(playerid)) // фикс камеры для трамвая и других RC машин { new Float:x, Float:y, Float:z; GetPlayerPos(playerid, x, y, z); for(new veh; veh<MAX_VEHICLES; veh++) { GetVehiclePos(veh, x, y, z); if(IsPlayerInRangeOfPoint(playerid, 5.0, x, y, z)) { new model = GetVehicleModel(veh); switch(model) { case 441, 449, 464, 501, 465, 564, 594: SetCameraBehindPlayer(playerid); } } } } if(!IsPlayerInAnyVehicle(playerid)) { new Float:x, Float:y, Float:z; GetPlayerPos(playerid, x, y, z); for(new veh; veh<MAX_VEHICLES; veh++) { GetVehiclePos(veh, x, y, z); if(IsPlayerInRangeOfPoint(playerid, 5.0, x, y, z)) { new model = GetVehicleModel(veh); switch(model) { case 441, 449, 464, 501, 465, 564, 594: PutPlayerInVehicle(playerid, veh, 0); } } } }else{ new model = GetVehicleModel(GetPlayerVehicleID(playerid)); switch(model) { case 441, 449, 464, 501, 465, 564, 594: { new Float:x, Float:y, Float:z; GetPlayerPos(playerid, x, y, z); SetPlayerPos(playerid, x, y, z+0.5); SetCameraBehindPlayer(playerid); } } } }
Через 2 года от последнего сообщения, и вы думаете ваш пост актуален? |
Vehicle[MAX_PLAYERS];
public OnPlayerStateChange(playerid, newstate, oldstate)
{
new vid;
if(newstate == PLAYER_STATE_DRIVER || newstate == PLAYER_STATE_PASSENGER){
vid = GetPlayerVehicleID(playerid);
Vehicle[playerid] = vid;
return 1;
}
else
if(oldstate == PLAYER_STATE_DRIVER || oldstate == PLAYER_STATE_PASSENGER){
if(GetVehicleModel(Vehicle[playerid]) == 449) SetCameraBehindPlayer(playerid);
Vehicle[playerid] = -1;
return 1;
}
return 1;
}
Тогда надо выкладывать хороший код, тут код не оптимизирован. |
#define D_TRAM 449
new last_vehicle[MAX_PLAYERS];
public OnPlayerStateChange(playerid, newstate, oldstate)
{
if(newstate == 2)
{
last_vehicle[playerid] = GetVehicleModel(GetPlayerVehicleID(playerid));
}
if(newstate == 1 && oldstate == 2 && last_vehicle[playerid] == D_TRAM)
{
SetCameraBehindPlayer(playerid);
}
return 1;
}