// getCheckpointTargetPosition(checkpointid) SQInteger CCheckpointNatives::GetTargetPosition(SQVM * pVM) { EntityId checkpointId; sq_getentity(pVM, -1, &checkpointId); CCheckpoint * pCheckpoint = g_pCheckpointManager->Get(checkpointId); if(pCheckpoint) { CVector3 vecTargetPosition; pCheckpoint->GetTargetPosition(vecTargetPosition); sq_newtable(pVM); sq_pushinteger(pVM, 0); sq_pushfloat(pVM, vecTargetPosition.fX); sq_createslot(pVM, -3); sq_pushinteger(pVM, 1); sq_pushfloat(pVM, vecTargetPosition.fY); sq_createslot(pVM, -3); sq_pushinteger(pVM, 2); sq_pushfloat(pVM, vecTargetPosition.fZ); sq_createslot(pVM, -3); return 1; } sq_pushbool(pVM, false); return 1; }
// getCheckpointType(checkpointid) int CCheckpointModuleNatives::GetType(EntityId checkpointId) { CCheckpoint * pCheckpoint = g_pCheckpointManager->Get(checkpointId); if(pCheckpoint) { return pCheckpoint->GetType(); } return false; }
SQInteger CCheckpointNatives::GetDimension(SQVM * pVM) { EntityId checkpointId; sq_getentity(pVM, -1, &checkpointId); CCheckpoint* pCheckpoint = g_pCheckpointManager->Get(checkpointId); if(pCheckpoint) { sq_pushinteger(pVM, (SQInteger)pCheckpoint->GetDimension()); } return 1; }
// getCheckpointRadius(checkpointid) float CCheckpointModuleNatives::GetRadius(EntityId checkpointId) { CCheckpoint * pCheckpoint = g_pCheckpointManager->Get(checkpointId); if(pCheckpoint) { return pCheckpoint->GetRadius(); } return -0.1f; }
// setCheckpointTargetPosition(checkpointid, targetposition) bool CCheckpointModuleNatives::SetTargetPosition(EntityId checkpointId, CVector3 vecTargetPosition) { CCheckpoint * pCheckpoint = g_pCheckpointManager->Get(checkpointId); if(pCheckpoint) { pCheckpoint->SetTargetPosition(vecTargetPosition); return true; } return false; }
// setCheckpointRadius(checkpointid, radius) bool CCheckpointModuleNatives::SetRadius(EntityId checkpointId, float fRadius) { CCheckpoint * pCheckpoint = g_pCheckpointManager->Get(checkpointId); if(pCheckpoint) { pCheckpoint->SetRadius(fRadius); return true; } return false; }
// hideCheckpointForPlayer(checkpointid, playerid) bool CCheckpointModuleNatives::HideForPlayer(EntityId checkpointId, EntityId playerId) { CCheckpoint * pCheckpoint = g_pCheckpointManager->Get(checkpointId); if(pCheckpoint) { pCheckpoint->HideForPlayer(playerId); return true; } return false; }
// hideCheckpointForAll(checkpointid) bool CCheckpointModuleNatives::HideForAll(EntityId checkpointId) { CCheckpoint * pCheckpoint = g_pCheckpointManager->Get(checkpointId); if(pCheckpoint) { pCheckpoint->HideForWorld(); return true; } return false; }
// setCheckpointType(checkpointid, type) bool CCheckpointModuleNatives::SetType(EntityId checkpointId, int iType) { CCheckpoint * pCheckpoint = g_pCheckpointManager->Get(checkpointId); if(pCheckpoint) { pCheckpoint->SetType(iType); return true; } return false; }
// getCheckpointTargetPosition(checkpointid) CVector3 CCheckpointModuleNatives::GetTargetPosition(EntityId checkpointId) { CCheckpoint * pCheckpoint = g_pCheckpointManager->Get(checkpointId); if(pCheckpoint) { CVector3 vecTargetPosition; pCheckpoint->GetTargetPosition(vecTargetPosition); return vecTargetPosition; } return CVector3(); }
// getCheckpointRadius(checkpointid) SQInteger CCheckpointNatives::GetRadius(SQVM * pVM) { EntityId checkpointId; sq_getentity(pVM, -1, &checkpointId); CCheckpoint * pCheckpoint = g_pCheckpointManager->Get(checkpointId); if(pCheckpoint) { sq_pushfloat(pVM, pCheckpoint->GetRadius()); return 1; } sq_pushbool(pVM, false); return 1; }
// hideCheckpointForAll(checkpointid) SQInteger CCheckpointNatives::HideForAll(SQVM * pVM) { EntityId checkpointId; sq_getentity(pVM, -1, &checkpointId); CCheckpoint * pCheckpoint = g_pCheckpointManager->Get(checkpointId); if(pCheckpoint) { pCheckpoint->HideForWorld(); sq_pushbool(pVM, true); return 1; } sq_pushbool(pVM, false); return 1; }
SQInteger CCheckpointNatives::SetDimension(SQVM * pVM) { SQInteger iDimension; EntityId checkpointId; sq_getinteger(pVM, -1, &iDimension); sq_getentity(pVM, -2, &checkpointId); CCheckpoint* pCheckpoint = g_pCheckpointManager->Get(checkpointId); if(pCheckpoint) { pCheckpoint->SetDimension(iDimension); sq_pushbool(pVM, true); return 1; } sq_pushbool(pVM, false); return 1; }
// showCheckpointForPlayer(checkpointid, playerid) SQInteger CCheckpointNatives::ShowForPlayer(SQVM * pVM) { EntityId checkpointId; EntityId playerId; sq_getentity(pVM, -2, &checkpointId); sq_getentity(pVM, -1, &playerId); CCheckpoint * pCheckpoint = g_pCheckpointManager->Get(checkpointId); if(pCheckpoint) { pCheckpoint->ShowForPlayer(playerId); sq_pushbool(pVM, true); return 1; } sq_pushbool(pVM, false); return 1; }
// setCheckpointTargetPosition(checkpointid, targetposition) SQInteger CCheckpointNatives::SetTargetPosition(SQVM * pVM) { EntityId checkpointId; CVector3 vecTargetPosition; sq_getentity(pVM, -4, &checkpointId); sq_getvector3(pVM, -3, &vecTargetPosition); CCheckpoint * pCheckpoint = g_pCheckpointManager->Get(checkpointId); if(pCheckpoint) { pCheckpoint->SetTargetPosition(vecTargetPosition); sq_pushbool(pVM, true); return 1; } sq_pushbool(pVM, false); return 1; }
// setCheckpointRadius(checkpointid, radius) SQInteger CCheckpointNatives::SetRadius(SQVM * pVM) { EntityId checkpointId; float fRadius; sq_getentity(pVM, -2, &checkpointId); sq_getfloat(pVM, -1, &fRadius); CCheckpoint * pCheckpoint = g_pCheckpointManager->Get(checkpointId); if(pCheckpoint) { pCheckpoint->SetRadius(fRadius); sq_pushbool(pVM, true); return 1; } sq_pushbool(pVM, false); return 1; }
// setCheckpointType(checkpointid, type) SQInteger CCheckpointNatives::SetType(SQVM * pVM) { EntityId checkpointId;; SQInteger iType; sq_getentity(pVM, -1, &checkpointId); sq_getinteger(pVM, -1, &iType); CCheckpoint * pCheckpoint = g_pCheckpointManager->Get(checkpointId); if(pCheckpoint) { pCheckpoint->SetType(iType); sq_pushbool(pVM, true); return 1; } sq_pushbool(pVM, false); return 1; }