21.07.2012, 22:13
Hello. I am creating a trucker job, and this are my trucks:
When entering a truck, you need to have the job.
At the moment, I am at the Stock IsATruck. How can I use the new truck; to define a truck in a stock?
pawn Код:
new truck;
truck = AddStaticVehicle(499,2173.2202,-2636.8081,13.5392,158.1144,0,0); //
truck = AddStaticVehicle(499,2180.8071,-2636.3555,13.5342,163.4434,0,0); //
truck = AddStaticVehicle(499,2203.1370,-2633.4329,13.5391,269.3954,0,0); //
truck = AddStaticVehicle(499,2203.8774,-2643.7749,13.5436,267.2371,0,0); //
truck = AddStaticVehicle(499,2246.7744,-2675.3079,13.5442,0.2894,0,0); //
truck = AddStaticVehicle(499,2250.3147,-2675.2898,13.5448,0.2894,0,0); //
truck = AddStaticVehicle(499,2253.5308,-2675.2732,13.5453,0.2894,0,0); //
truck = AddStaticVehicle(499,2258.2942,-2675.2493,13.5461,0.2894,0,0); //
truck = AddStaticVehicle(499,2263.0957,-2675.2251,13.5469,0.2894,0,0); //
truck = AddStaticVehicle(499,2247.6970,-2650.8284,13.5422,92.7948,0,0); //
truck = AddStaticVehicle(499,2247.3877,-2644.5051,13.5842,92.7948,0,0); //
truck = AddStaticVehicle(499,2247.0117,-2636.8062,13.6353,92.7948,0,0); //
truck = AddStaticVehicle(499,2246.6838,-2630.0957,13.6799,92.7948,0,0); //
truck = AddStaticVehicle(499,2210.8445,-2597.9141,13.5346,268.8778,0,0); //
truck = AddStaticVehicle(499,2204.6855,-2569.6677,13.5392,267.5470,0,0); //
pawn Код:
public OnPlayerStateChange(playerid, newstate, oldstate) {
if(newstate == 2) {
if(IsATruck(GetPlayerVehicleID(playerid) && pInfo[playerid][pJob] == 1))
{ // if you are in a truck
SendClientMessage(playerid, COLOR_YELLOW, "You've entered an Ocean Dock truck. /loadtruck to load some goods."); // return this message.
} else if(pInfo[playerid][pJob] != 1)
{
RemovePlayerFromVehicle(playerid);
SendClientMessage(playerid, COLOR_GREY, "You are not a trucker.");
}
}
return 1;
}