28.06.2012, 17:42
Well i am making a trucker job and im pretty much trying to make it like this..
If a player goes in a certain area and he has NOT got a trailer the truck will respawn and he will be told to try again and get a trailer this time but i just cant do it either way i have tried everything please help me
If you need any more code just ask
Thanks
If a player goes in a certain area and he has NOT got a trailer the truck will respawn and he will be told to try again and get a trailer this time but i just cant do it either way i have tried everything please help me
pawn Код:
if(newstate == PLAYER_STATE_DRIVER && oldstate == PLAYER_STATE_ONFOOT)
{
new engine, lights, alarm, doors, bonnet, boot, objective;
if(Jobs[Player[playerid][Job]][JobType] != 8 && Jobs[Player[playerid][Job2]][JobType] != 8)
{
new carid = GetPlayerVehicleID(playerid);
new carmodel = GetVehicleModel(carid);
if(carmodel == 403 || carmodel == 591)
{
RemovePlayerFromVehicle(playerid);
SendClientMessage(playerid, WHITE, "You must have the trucker job to drive this vehicle");
}
}
else
{
if(Jobs[Player[playerid][Job]][JobType] == 8 || Jobs[Player[playerid][Job2]][JobType] == 8)
{
new Float:X, Float:Y, Float:Z;
new carid = GetPlayerVehicleID(playerid);
new carmodel = GetVehicleModel(carid);
if(carmodel == 403 || carmodel == 591)
{
GetVehicleParamsEx(carid, engine, lights, alarm, doors, bonnet, boot, objective);
SetVehicleParamsEx(carid, 1, lights, alarm, doors, bonnet, boot, 0);
SendClientMessage(playerid, WHITE, "Please pick up a trailer");
for(new i=0;i<MAX_PLAYERS;i++)
{
GetPlayerPos(i, X, Y, Z);
if(IsTrailerAttachedToVehicle(carid))
{
SendClientMessage(playerid, WHITE, "Please pick up a trailer first");
SetVehicleToRespawn(carid);
if(GetVehicleTrailer(GetPlayerVehicleID(playerid)) == trailerone)
{
SendClientMessage(playerid, WHITE, "Working");
}
}
}
}
Thanks