Race Checkpoint Bug.
#1

okay, first off i set a checkpoint on my trucking mission to somewhere then when the player enters the first cp it sets the last cp somewhere else, but the last cp is bugged if u reach in like 5 radius of the cp it disappears and when u go far away u can see it. so u cant enter it to call the callback.

first code.

pawn Код:
stock CreateTruckMission(playerid, MissionPText[],MissionDOText[],Item[],Float:Startx, Float:Starty, Float:Startz, Float:Endx, Float:Endy, Float:Endz/*,&TrailerX,&TrailerY,&TrailerZ*/)
{
    DisablePlayerRaceCheckpoint(playerid);
    strmid(PlayerInfo[playerid][MissionPickupText],MissionPText,false,strlen(MissionPText),35);
    strmid(PlayerInfo[playerid][MissionDropoffText],MissionDOText,false,strlen(MissionDOText),35);
    strmid(PlayerInfo[playerid][DeliveryItem],Item,false,strlen(Item),25);
    PlayerInfo[playerid][Lastx] = Endx;
    PlayerInfo[playerid][Lasty] = Endy;
    PlayerInfo[playerid][Lastz] = Endz;
    PlayerInfo[playerid][MissionX] = Startx;
    PlayerInfo[playerid][MissionY] = Starty;
    PlayerInfo[playerid][MissionZ] = Startz;
    PlayerInfo[playerid][TMission] = 1;
    SetPlayerRaceCheckpoint(playerid, 0, Startx, Starty, Startz, Endx, Endy, Endz, 7);
    new destination[MAX_ZONE_NAME];
    Get2DZone(destination,Startx, Starty, Startz);
    strmid(PlayerInfo[playerid][Destination],destination,false,strlen(destination),strlen(destination)+1);
    TextDrawShowForPlayer(playerid,MissionBox);
    new str[256];
    format(str,sizeof(str),"~g~Truck Delivery~n~~n~~y~Destination:~n~~w~%s~n~~n~You Will Earn Less If Your Vehicle Is ~r~Damaged~w~.~n~Type ~y~/Cancel~w~ To Cancel The Mission.",destination);
    TextDrawSetString(MissionText,str);
    TextDrawShowForPlayer(playerid,MissionText);
    SetTimerEx("HideDraw", 15000, false, "i", playerid);
    new string[128];
    format(string, sizeof(string), "Mission: Is To Deliver %s From The %s To The %s.",Item,PlayerInfo[playerid][MissionPickupText], PlayerInfo[playerid][MissionDropoffText]);
    SendClientMessage(playerid, White, string);
    new Float:mx = PlayerInfo[playerid][MissionX],Float:my = PlayerInfo[playerid][MissionY],Float:mz = PlayerInfo[playerid][MissionZ];
    format(string, sizeof(string), "~b~Truck Delivery~w~ - Time:~g~%s~n~~b~Destination~w~:%s~n~~b~Distance~w~:%0.1f~n~~b~Item~w~:%s", TimeConvert(PlayerInfo[playerid][DeliveryTimer]),destination,GetPlayerDistanceToPoint(playerid, mx, my, mz),PlayerInfo[playerid][DeliveryItem]);
    TextDrawSetString(JailTimeText[playerid],string);
    TextDrawShowForPlayer(playerid,JailTimeText[playerid]);
    PlayerInfo[playerid][DeliveryTimer] = 900;
    GameTextForPlayer(playerid,"~g~Truck Delivery Job~n~Started",3500,3);
    return 1;
}
next
pawn Код:
public OnPlayerEnterRaceCheckpoint(playerid)
{
    if(PlayerInfo[playerid][TMission] == 1)
    {
        DisablePlayerRaceCheckpoint(playerid);
        GameTextForPlayer(playerid, "~w~Loading The Goods...~n~~w~Please Wait", 2500, 3);
        SetTimerEx("Loading", 1500, false, "d" , playerid);
    }
next
pawn Код:
public Loading(playerid)
{
    TogglePlayerControllable(playerid, 1);
    PlayerInfo[playerid][TMission] = 2;
    new destination[MAX_ZONE_NAME];
    Get2DZone(destination,PlayerInfo[playerid][Lastx], PlayerInfo[playerid][Lasty], PlayerInfo[playerid][Lastz]);
    TextDrawShowForPlayer(playerid,MissionBox);
    new str[256];
    format(str,sizeof(str),"~g~Truck Delivery~n~~n~~y~Destination:~n~~w~%s~n~%s Picked up! Deliver It Now~n~You Will Earn Less If Your Vehicle Is ~r~Damaged~w~.~n~Type ~y~/Cancel~w~ To Cancel The Mission.",destination,PlayerInfo[playerid][DeliveryItem]);
    TextDrawSetString(MissionText,str);
    TextDrawShowForPlayer(playerid,MissionText);
    SetTimerEx("HideDraw", 30000, false, "i", playerid);

    SetPlayerRaceCheckpoint(playerid, 1, PlayerInfo[playerid][Lastx], PlayerInfo[playerid][Lasty], PlayerInfo[playerid][Lastx], PlayerInfo[playerid][MissionX], PlayerInfo[playerid][MissionY], PlayerInfo[playerid][MissionZ], 7);
    //MissionCp[playerid] = CreateDynamicRaceCP(1, PlayerInfo[playerid][Lastx], PlayerInfo[playerid][Lasty], PlayerInfo[playerid][Lastx], PlayerInfo[playerid][MissionX], PlayerInfo[playerid][MissionY], PlayerInfo[playerid][MissionZ],7,GetPlayerVirtualWorld(playerid),GetPlayerInterior(playerid),playerid,99999);

    PlayerInfo[playerid][MissionX] = PlayerInfo[playerid][Lastx];
    PlayerInfo[playerid][MissionY] = PlayerInfo[playerid][Lasty];
    PlayerInfo[playerid][MissionZ] = PlayerInfo[playerid][Lastz];
    return 1;
}

Reply
#2

bump. (8char)
Reply
#3

Another 12 Hour+ Bump..
Reply
#4

sorry for the epic bump but i rlly need help on this ):
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)