Really stuck with trucker..
#1

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

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");
                            }
                        }
                    }
                }
If you need any more code just ask

Thanks
Reply
#2

Why does no one ever help please
Reply
#3

That wont work properly because that code will just be loaded when the player enters the vehicle.
Also, I have no idea why are you looping all players to get their position if you dont even use it...
Anyway, I want to help you, so tell me more about that job system and I'll give you a little help with it.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)