28.10.2014, 02:09
i also noticed some mistakes that will cause bugs to ur command so please explain a bit more further
pawn Код:
CMD:convoy(playerid, params[])
{
if (GetPlayerTeam(playerid) == 1)
{
if(PlayerInfo[playerid][pConvoy] > 0)
{
// the loop cause the randomization so i removed it
//if(PlayerInfo[i][pConvoy] == PlayerInfo[playerid][pConvoy]) //i need more explanation about this check cause convoys differs from every player the convoy++ proves it
//{
if(sscanf(params, "u",i)) return SendClientMessage(playerid, -1, "USAGE: /convoy [playerid]");
// some unnecessary brackets removed
if(i==INVALID_PLAYER_ID) return SendClientMessage(playerid,-1 "Invalid Player");
if(PlayerInfo[i][pConvoy]<1) return SendClientMessage(playerid,-1,"Targer player is not in trucker mission");
new m = GetVehicleModel(GetPlayerVehicleID(i));
if(m == 514 || m == 515 || m == 403)
{
new t = GetVehicleModel(GetVehicleTrailer(GetPlayerVehicleID(i)));
if (t == 435 || t == 450 || t == 584)
{
if (GetPlayerVehicleSeat(i) == 0)
{
// comes from ur trucker1 stock
new pmission=PlayerInfo[i][StartingPoint];
PlayerInfo[playerid][StartingPoint] = pmission;
DisablePlayerCheckpoint(playerid);
SetPlayerCheckpoint(playerid, trucker[pmission][lx], trucker[pmission][ly], trucker[pmission][lz], 10);
//truckchecktime = SetTimerEx("TruckCheck", 1000, true, "i", playerid);
}
else
{
SendClientMessage(i, WORK, "You are not the driver of this vehicle");
}
}
else
{
SendClientMessage(i, WORK, "You do not have the correct trailer, please go and attach one!");
}
}
else
{
SendClientMessage(i, WORK, "You are not in a truck, please go and get one!");
}
//}
}
}
SendMessageToAdmins(playerid, 0xB3B3B3FF, "/convoy");// ????
return 1;
}