OnPlayerEnterDynamicCP [+REP]
#8

The Checkpoint has to be toggled. I mean, you have to use TogglePlayerDynamicCP(playerid,checkpointid,(true/false)).

Checkpoint has to be created in OnGameModeInit(). After that, you have to make sure, that stream distance is not far enough from player.

In example:
Код:
new carcp, car;
OnGameModeInit()
{
   //array = CreateDynamicCP(x,y,z,size,virtualworld,interior,playerid(-1 for all), strdistance);
     carcp = CreateDynamicCP(-2000,-1000,20,1.0,0,0,-1,5000.0);
     return 1;
}

OnPlayerSpawn(playerid)
{
     // TogglePlayerDynamicCP(playerid,checkpointid,toggle);
     TogglePlayerDynamicCP(playerid,carcp,true);
     return 1;
}

OnPlayerEnterDynamicCP(playerid,checkpointid)
{
     if(checkpointid == carcp)
     {
         //array  CreateVehicle(modelid,x,y,z,rotation,color1,color2,respawn delay);
            car = CreateVehicle(522,-2000,-1000,20,60,6,0,120);
            TogglePlayerDynamicCP(playerid,carcp,false);
     }
     return 1;
}
OnVehicleDeath(vehicleid)
{
     if(vehicleid == car) return DestroyVehicle(car);
     return 1;
}
OnPlayerDeath(playerid)
{
     TogglePlayerDynamicCP(playerid,carcp,false);
     return 1;
}
Reply


Messages In This Thread
OnPlayerEnterDynamicCP [+REP] - by EliteApple - 22.01.2014, 03:18
Re: OnPlayerEnterDynamicCP [+REP] - by Copfan5 - 22.01.2014, 03:29
Re: OnPlayerEnterDynamicCP [+REP] - by EliteApple - 22.01.2014, 03:54
Re: OnPlayerEnterDynamicCP [+REP] - by Scenario - 22.01.2014, 05:02
Re: OnPlayerEnterDynamicCP [+REP] - by ]Rafaellos[ - 22.01.2014, 05:26
Re: OnPlayerEnterDynamicCP [+REP] - by VishvaJeet - 22.01.2014, 06:07
Re: OnPlayerEnterDynamicCP [+REP] - by EliteApple - 22.01.2014, 19:26
Re: OnPlayerEnterDynamicCP [+REP] - by laimalgirdas - 11.02.2015, 08:08

Forum Jump:


Users browsing this thread: 2 Guest(s)