14.08.2017, 07:23
Hello, through the AddStaticVehicleEx function, I created a streetcar, but I can't getting into it.
Is there a solution? Can you drive the streetcar?
Is there a solution? Can you drive the streetcar?
PutPlayerInVehicle(playerid,449,0);
public OnPlayerEnterVehicle(playerid,vehicleid,ispassenger) { if(ispassenger) //This explains itself { PutPlayerInVehicle(playerid,vehicleid,1); //Put the player with id 'playerid' in the vehicle with id 'vehicleid' in seat id 1 (front passenger) } else { PutPlayerInVehicle(playerid,vehicleid,0); //Put the player with id 'playerid' in the vehicle with id 'vehicleid' in seat id 0 (driver) } return 1; }
Just remove this from OnPlayerEnterVehicle(playerid,vehicleid,ispassenge r):
Код:
PutPlayerInVehicle(playerid,449,0); BUT if you think you need it you can do this: Код:
public OnPlayerEnterVehicle(playerid,vehicleid,ispassenger) { if(ispassenger) //This explains itself { PutPlayerInVehicle(playerid,vehicleid,1); //Put the player with id 'playerid' in the vehicle with id 'vehicleid' in seat id 1 (front passenger) } else { PutPlayerInVehicle(playerid,vehicleid,0); //Put the player with id 'playerid' in the vehicle with id 'vehicleid' in seat id 0 (driver) } return 1; } PS: You also have an error in stock GetModelVehicle(vname[]), a VARIABLE NAME can ONLY start with a letter. Vince explained this thing here: https://sampforum.blast.hk/showthread.php?tid=631607 PS2: Also don't use the stock keyword very much, Vince explained why here: "Stop the abuse of stock" |