Hello. i keep getting the random missions, they have to /work then /convoy 0 to join their missions.
here the code, that starts the missions
here the code, that starts the missions
Code:
CMD:convoy(playerid, params[])
{
new Playermission = PlayerInfo[playerid][StartingPoint];
if(sscanf(params, "u",playerid)) return SendClientMessage(playerid, -1, "USAGE: /convoy [playerid]");
if(GetPlayerTeam(playerid) == 1)
{
new m = GetVehicleModel(GetPlayerVehicleID(playerid));
if(m == 514 || m == 515 || m == 403)
{
new t = GetVehicleModel(GetVehicleTrailer(GetPlayerVehicleID(playerid)));
if (t == 435 || t == 450 || t == 584)
{
if (GetPlayerVehicleSeat(playerid) == 0)
{
new Text:Work[MAX_PLAYERS];
new rand = random(sizeof(trucker));
PlayerInfo[Playermission][StartingPoint] = rand;
new convoytextdraw[MAX_PLAYERS];
format(convoytextdraw,sizeof(convoytextdraw), "~g~go to %s ~w~to load your trailer with ~y~%s", trucker[rand][lpname], trucker[rand][loadname]);
TextDrawSetString(Work[playerid], convoytextdraw);
truck_PlayerJob[playerid] = 1;
}
else
{
new string[240];
format(string, 128, "That player isn't at the driver seat of the vehicle.");
SendClientMessage(playerid, 0xFFFFFFFF, string);
}
}
else
{
new string[240];
format(string, 128, "That player doesn't have the correct trailer, tell him to attach one!");
SendClientMessage(playerid, 0xFFFFFFFF, string);
}
}
else
{
new string[240];
format(string, 128, "That player isn't on a truck, tell him to get one!");
SendClientMessage(playerid, 0xFFFFFFFF, string);
}
}
return 1;
}
Code:
forward Trucker1(playerid);
public Trucker1(playerid)
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
new rand = random(sizeof(trucker));
new Text:Work[MAX_PLAYERS];
new newtext2[MAX_PLAYERS];
PlayerInfo[playerid][StartingPoint] = rand;
DisablePlayerCheckpoint(i);
SetPlayerCheckpoint(i, trucker[rand][lx], trucker[rand][ly], trucker[rand][lz], 10);
format(newtext2,sizeof(newtext2), "~w~Go to ~r~%s ~w~to load your trailer with ~g~%s", trucker[rand][lpname], trucker[rand][loadname]);
TextDrawSetString(Work[i],newtext2);
SetPVarInt(playerid, "PlayerMission", 1); // Set the Player mission.
}
}
}
Aucun commentaire:
Enregistrer un commentaire