12.07.2013, 14:16
(
Последний раз редактировалось Vexus; 12.07.2013 в 23:09.
)
[SOLVED]
new UserTruck[MAX_PLAYERS];
public OnPlayerConnect(playerid)
{
UserTruck[playerid] = INVALID_VEHICLE_ID;
return 1;
}
// When a player starts his job and is put inside the truck:
UserTruck[playerid] = GetPlayerVehicleID(playerid);
// When a player attempts to return a truck:
if(UserTruck[playerid] == GetPlayerVehicleID(playerid))
{
// What should happen if the truck is his?
}
else
{
// What should happen if the truck's ID doesn't match the player's truck ID? Maybe an error message for the player?
}
Let me tell if I understood right. You would like to create a trucking job and would like people who wants to be a trucker to be put in the pre-specified truck automatically, right ? If it's right what do you want us to do ? Put them inside or specifying the truck's idea ? I might be a bit helpless as i am in phone right now.
Edit: Seems like i completely messed lol. I am helpless in making a private truck for yourself. Sorry. |
Maybe something like this? It's just the basic structure, then you have to customize it:
pawn Код:
pawn Код:
pawn Код:
|
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
//if(!IsATruck(vehicleid)) return 1; Perhaps you don't want all vehicles to be restricted?
if(!ispassenger && UserTruck[playerid] != vehicleid)
{
new Float:position[3];
GetPlayerPos(playerid,position[0],position[1],position[2]);
SetPlayerPos(playerid,position[0],position[1],position[2]+0.4);
}
return 1;
}