Work prolem - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Work prolem (
/showthread.php?tid=585867)
Work prolem -
DerickClark - 17.08.2015
When i type /work then go to the checkpoint says i need a trailer, i have a trailer. still sending the messages
I want the player current trailer to go in the checkpoint.
OnPlayerEnterCheckpoint
Код:
new t = GetPlayerVehicleID(playerid);//Explained earlier
if(!IsTrailerAttachedToVehicle(t)) return SendClientMessage(playerid,-1, "You need a trailer to unload!");//This line checks wether the player has a trailer attached to their truck.
if(GetPlayerTeam(playerid) == 1)
{
if(IsPlayerInAnyVehicle(playerid))
{
switch(truck_PlayerJob[playerid])
{
case 1:
{
truck_PlayerJob[playerid] = -1;
TogglePlayerControllable(playerid, 0);
SetTimerEx("Trucker2", 15000, false, "i", playerid);
new loading[MAX_PLAYERS];
format(loading,sizeof(loading), "~y~Loading... ~g~Please wait");
TextDrawSetString(Work[playerid], loading);
}
case 2, 3:
{
truck_PlayerJob[playerid] = 3;
TogglePlayerControllable(playerid, 0);
SetTimerEx("Trucker3", 15000, false, "i", playerid);
new loading[MAX_PLAYERS];
format(loading,sizeof(loading), "~y~unLoading... ~g~Please wait");
TextDrawSetString(Work[playerid], loading);
}
}
return 1;
}
}
//work command
Код:
if (GetPlayerTeam(playerid) == 1)
{
new m = GetVehicleModel(GetPlayerVehicleID(playerid));
if(m == 514 || m == 515 || m == 403 || m == 455)
{
new t = GetVehicleModel(GetVehicleTrailer(GetPlayerVehicleID(playerid)));
if (t == 435 || t == 450 || t == 584 || m == 455)
{
if (GetPlayerVehicleSeat(playerid) == 0)
{
Trucker1(playerid);
truck_PlayerJob[playerid] = 1;
Convoy++;
//PlayerInfo[playerid][pConvoy] = Convoy;
//truckchecktime =
//SetTimerEx("TruckCheck", 1000, true, "i", playerid);
}
else
{
SendClientMessage(playerid, COLOR_LIGHTGREEN, "You are not the driver of this vehicle");
}
}
else
{
SendClientMessage(playerid, COLOR_LIGHTGREEN, "You do not have a trailer one!");
}
}
else
{
SendClientMessage(playerid, COLOR_LIGHTGREEN, "You are not in a truck!");
}
}
Re: Work prolem -
GloomY - 17.08.2015
Give me this: IsTrailerAttachedToVehicle
Re: Work prolem -
DerickClark - 17.08.2015
Still doing it, i need to current trailer and truck for the checkpoint
Re: Work prolem -
GloomY - 17.08.2015
PHP код:
new t = GetPlayerVehicleID(playerid), m = GetVehicleModel(t);//Explained earlier
    if(!IsTrailerAttachedToVehicle(m)) return SendClientMessage(playerid,-1, "You need a trailer to unload!");//This line checks wether the player has a trailer attached to their truck.
    if(GetPlayerTeam(playerid) == 1)
    {
        if(IsPlayerInAnyVehicle(playerid))
        {
            switch(truck_PlayerJob[playerid])
            {
                case 1:
                {
                    truck_PlayerJob[playerid] = -1;
                    TogglePlayerControllable(playerid, 0);
                    SetTimerEx("Trucker2", 15000, false, "i", playerid);
                    new loading[MAX_PLAYERS];
                    format(loading,sizeof(loading), "~y~Loading... ~g~Please wait");
                    TextDrawSetString(Work[playerid], loading);
                   Â
                }
                case 2, 3:
                {
                    truck_PlayerJob[playerid] = 3;
                    TogglePlayerControllable(playerid, 0);
                    SetTimerEx("Trucker3", 15000, false, "i", playerid);
                    new loading[MAX_PLAYERS];
                    format(loading,sizeof(loading), "~y~unLoading... ~g~Please wait");
                    TextDrawSetString(Work[playerid], loading);
                }
            }
            return 1;
        }
    }Â
Try this.
Re: Work prolem -
DerickClark - 17.08.2015
Still asking me for a trailer, i have a trailer and a truck.
Re: Work prolem -
DerickClark - 18.08.2015
Still having the same problem when the player in a truck and have a trailer then it asked if i need trailer.