Checkpoint not being destroyed
#1

Hello,

Im trying to make it so when i get in the icecream truck,
It destroys the checkpoint around it, It kills the timer but dosent destroy the checkpoint,

Anyone know why?

Thanks

Code: http://pastebin.com/A5N1Kq1i
Reply
#2

that should work:
pawn Код:
#include <a_samp>
#include <streamer>

forward UpdateCheckpoint();

new IceCream;
new IceCreamPos;

new Update;

main()
{
}

public OnGameModeInit()
{
    SetGameModeText("Blank Script");
   
    AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
   
    IceCream = AddStaticVehicle(423, 290.9179, -1517.5056, 24.6192, 235.9560, 1, 56); // icetruck
   
    Update = SetTimer("UpdateCheckpoint", 100, 1);
    return 1;
}

public OnPlayerStateChange(playerid, newstate, oldstate)
{
    new vehicleid = GetPlayerVehicleID(playerid);
   
    if(newstate == PLAYER_STATE_DRIVER)
    {
      if(vehicleid == IceCream)
      {
            KillTimer(Update);
      }
    }
    return 1;
}

public UpdateCheckpoint()
{
    new Float:x, Float:y, Float:z;
    GetVehiclePos(IceCream, x, y, z);
    IceCreamPos = CreateDynamicCP(x, y, z, 5.0, -1, -1, -1, 500000);
}

public Update
{
    DestroyDynamicCP(IceCreamPos);
}
Reply
#3

Quote:
Originally Posted by ~Ricky~
that should work:
pawn Код:
#include <a_samp>
#include <streamer>

forward UpdateCheckpoint();

new IceCream;
new IceCreamPos;

new Update;

main()
{
}

public OnGameModeInit()
{
    SetGameModeText("Blank Script");
   
    AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
   
    IceCream = AddStaticVehicle(423, 290.9179, -1517.5056, 24.6192, 235.9560, 1, 56); // icetruck
   
    Update = SetTimer("UpdateCheckpoint", 100, 1);
    return 1;
}

public OnPlayerStateChange(playerid, newstate, oldstate)
{
    new vehicleid = GetPlayerVehicleID(playerid);
   
    if(newstate == PLAYER_STATE_DRIVER)
    {
      if(vehicleid == IceCream)
      {
            KillTimer(Update);
      }
    }
    return 1;
}

public UpdateCheckpoint()
{
    new Float:x, Float:y, Float:z;
    GetVehiclePos(IceCream, x, y, z);
    IceCreamPos = CreateDynamicCP(x, y, z, 5.0, -1, -1, -1, 500000);
}

public Update
{
    DestroyDynamicCP(IceCreamPos);
}
I dont think it will, And i checked it and it dosent Also brings errors
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)