SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help > Help Archive

 
 
Thread Tools Display Modes
Old 07/06/2010, 06:47 PM   #1
NewTorran
Huge Clucker
 
Join Date: May 2010
Posts: 415
Reputation: 4
Default Checkpoint not being destroyed

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
NewTorran is offline  
Old 07/06/2010, 06:51 PM   #2
~Ricky~
Big Clucker
 
~Ricky~'s Avatar
 
Join Date: May 2010
Posts: 113
Reputation: 0
Default Re: Checkpoint not being destroyed

that should work:
pawn Code:
#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);
}
~Ricky~ is offline  
Old 07/06/2010, 08:30 PM   #3
NewTorran
Huge Clucker
 
Join Date: May 2010
Posts: 415
Reputation: 4
Default Re: Checkpoint not being destroyed

Quote:
Originally Posted by ~Ricky~
that should work:
pawn Code:
#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
NewTorran is offline  
 

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
how can I when a object is destroyed move to another ??? RobShakur Help Archive 2 09/02/2010 03:48 PM
[HELP]Door which destroyed only by explosion akis_tze Help Archive 1 28/12/2009 08:21 AM
[HELP]Door which destroyed only by explosion akis_tze Help Archive 0 27/12/2009 11:26 PM
Textdraws not getting destroyed ? am0k Help Archive 3 04/09/2009 09:57 PM


All times are GMT. The time now is 11:15 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.