11.02.2015, 08:08
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:
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; }