本文整理汇总了C++中CHECK_PARAMS函数的典型用法代码示例。如果您正苦于以下问题:C++ CHECK_PARAMS函数的具体用法?C++ CHECK_PARAMS怎么用?C++ CHECK_PARAMS使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了CHECK_PARAMS函数的18个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: fd_dictfct_Address_encode
int fd_dictfct_Address_encode(void * data, union avp_value * avp_value)
{
sSS * ss = (sSS *) data;
uint16_t AddressType = 0;
size_t size = 0;
unsigned char * buf = NULL;
TRACE_ENTRY("%p %p", data, avp_value);
CHECK_PARAMS( data && avp_value );
switch (ss->ss_family) {
case AF_INET:
{
/* We are encoding an IP address */
sSA4 * sin = (sSA4 *)ss;
AddressType = 1;/* see http://www.iana.org/assignments/address-family-numbers/ */
size = 6; /* 2 for AddressType + 4 for data */
CHECK_MALLOC( buf = malloc(size) );
/* may not work because of alignment: *(uint32_t *)(buf+2) = htonl(sin->sin_addr.s_addr); */
memcpy(buf + 2, &sin->sin_addr.s_addr, 4);
}
break;
case AF_INET6:
{
/* We are encoding an IPv6 address */
sSA6 * sin6 = (sSA6 *)ss;
AddressType = 2;/* see http://www.iana.org/assignments/address-family-numbers/ */
size = 18; /* 2 for AddressType + 16 for data */
CHECK_MALLOC( buf = malloc(size) );
/* The order is already good here */
memcpy(buf + 2, &sin6->sin6_addr.s6_addr, 16);
}
break;
default:
CHECK_PARAMS( AddressType = 0 );
}
*(uint16_t *)buf = htons(AddressType);
avp_value->os.len = size;
avp_value->os.data = buf;
return 0;
}
开发者ID:ClearwaterCore,项目名称:freeDiameter,代码行数:53,代码来源:dictionary_functions.c
示例2: CHECK_PARAMS
cell AMX_NATIVE_CALL Natives::AttachDynamicAreaToVehicle(AMX *amx, cell *params)
{
CHECK_PARAMS(2, "AttachDynamicAreaToVehicle");
boost::unordered_map<int, Item::SharedArea>::iterator a = core->getData()->areas.find(static_cast<int>(params[1]));
if (a != core->getData()->areas.end())
{
if (a->second->type != STREAMER_AREA_TYPE_CIRCLE && a->second->type != STREAMER_AREA_TYPE_SPHERE)
{
Utility::logError("AttachDynamicAreaToVehicle: Only circles and spheres may be attached to vehicles");
return 0;
}
if (static_cast<int>(params[2]) != INVALID_GENERIC_ID)
{
a->second->attach = boost::intrusive_ptr<Item::Area::Attach>(new Item::Area::Attach);
a->second->attach->object = boost::make_tuple(INVALID_STREAMER_ID, STREAMER_OBJECT_TYPE_DYNAMIC, INVALID_PLAYER_ID);
a->second->attach->player = INVALID_GENERIC_ID;
a->second->attach->vehicle = static_cast<int>(params[2]);
core->getStreamer()->attachedAreas.insert(a->second);
}
else
{
if (a->second->attach)
{
if (a->second->attach->vehicle != INVALID_GENERIC_ID)
{
a->second->attach.reset();
core->getStreamer()->attachedAreas.erase(a->second);
core->getGrid()->removeArea(a->second, true);
}
}
}
return 1;
}
return 0;
}
开发者ID:ITCMatus,项目名称:samp-streamer-plugin,代码行数:35,代码来源:areas.cpp
示例3: CHECK_PARAMS
cell AMX_NATIVE_CALL Natives::Streamer_GetCellDistance(AMX *amx, cell *params)
{
CHECK_PARAMS(1, "Streamer_GetCellDistance");
float cellDistance = core->getGrid()->getCellDistance();
Utility::storeFloatInNative(amx, params[1], cellDistance);
return 1;
}
开发者ID:LVPlayground,项目名称:samp-streamer-plugin,代码行数:7,代码来源:settings.cpp
示例4: funcAttachObjectToVehicle
cell AMX_NATIVE_CALL funcAttachObjectToVehicle ( AMX* a_AmxInterface, cell* a_Params )
{
if(bScriptDebug) logprintf ( "[Call]-> funcAttachObjectToVehicle()" );
// DEPRECATED FUNCTION
logprintf ( "[Script]-> DEPRECATED FUNCTION: AttachObjectToVehicle(). Use Parent/Child Concept Instead (Read Open SA-MP Docs)." );
CHECK_PARAMS ( 8 );
uint16_t l_uint16_ObjectIndex = ( uint16_t )a_Params[ 1 ];
CDeprecatedObject* l_Object = NULL;
if ( __NetGame->objectPool && ( l_uint16_ObjectIndex < LIMIT_MAX_OBJECT ) && ( l_Object = __NetGame->objectPool->Get ( l_uint16_ObjectIndex ) ) )
{
tVector*
l_AttachedOffset = new tVector();
l_AttachedOffset->X = amx_ctof ( a_Params[ 3 ] );
l_AttachedOffset->Y = amx_ctof ( a_Params[ 4 ] );
l_AttachedOffset->Z = amx_ctof ( a_Params[ 5 ] );
tVector*
l_AttachedRotation = new tVector();
l_AttachedRotation->X = amx_ctof ( a_Params[ 6 ] );
l_AttachedRotation->Y = amx_ctof ( a_Params[ 7 ] );
l_AttachedRotation->Z = amx_ctof ( a_Params[ 8 ] );
l_Object->AttachToVehicle ( ( uint16_t )a_Params[ 2 ], l_AttachedOffset, l_AttachedRotation );
return 1;
}
return -1;
}
开发者ID:Kaperstone,项目名称:open-samp,代码行数:32,代码来源:func_amx_deprecated_object.cpp
示例5: funcStopPlayerObject
cell AMX_NATIVE_CALL funcStopPlayerObject ( AMX* a_AmxInterface, cell* a_Params )
{
if(bScriptDebug) logprintf ( "[Call]-> funcStopPlayerObject()" );
// DEPRECATED FUNCTION
//logprintf ( "[Script]-> DEPRECATED FUNCTION: StopPlayerObject(). Use ElementStop() Instead (Read Open SA-MP Docs)." );
CHECK_PARAMS ( 2 );
uint16_t l_uint16_PlayerIndex = ( uint16_t )a_Params[ 1 ];
if ( ( __NetGame->playerPool > 0 ) && ( l_uint16_PlayerIndex < 500 ) && ( __NetGame->playerPool->isCreated[ l_uint16_PlayerIndex ] ) )
{
uint16_t l_uint16_ObjectIndex = ( uint16_t )a_Params[ 2 ];
CDeprecatedObject* l_Object = NULL;
if ( __NetGame->objectPool && ( l_uint16_ObjectIndex < LIMIT_MAX_OBJECT ) && ( l_Object = __NetGame->objectPool->Get ( l_uint16_PlayerIndex, l_uint16_ObjectIndex ) ) )
{
l_Object->Stop();
RakNet::BitStream
l_BitStream;
l_BitStream.Write ( l_uint16_ObjectIndex );
l_BitStream.Write ( l_Object->GetPosition()->X );
l_BitStream.Write ( l_Object->GetPosition()->Y );
l_BitStream.Write ( l_Object->GetPosition()->Z );
__NetGame->PlayerRPC( RPC_StopObject, &l_BitStream, l_uint16_PlayerIndex, 2 );
return 1;
}
}
return -1;
}
开发者ID:Kaperstone,项目名称:open-samp,代码行数:34,代码来源:func_amx_deprecated_object.cpp
示例6: funcDestroyPlayerObject
cell AMX_NATIVE_CALL funcDestroyPlayerObject ( AMX* a_AmxInterface, cell* a_Params )
{
if(bScriptDebug) logprintf ( "[Call]-> funcDestroyPlayerObject()" );
// DEPRECATED FUNCTION
logprintf ( "[Script]-> DEPRECATED FUNCTION: DestroyPlayerObject(). Use ObjectDestroy() or ElementDestroy() Instead (Read Open SA-MP Docs)." );
CHECK_PARAMS ( 2 );
if ( ( __NetGame->playerPool > 0 ) && ( a_Params[ 1 ] < 500 ) && ( __NetGame->playerPool->isCreated[ a_Params[ 1 ] ] ) )
{
if ( __NetGame->objectPool && ( a_Params[ 2 ] < LIMIT_MAX_OBJECT ) && ( __NetGame->objectPool->Get ( ( uint16_t )a_Params[ 1 ], ( uint16_t )a_Params[ 2 ] ) ) )
{
__NetGame->objectPool->Delete ( ( uint16_t )a_Params[ 1 ], ( uint16_t )a_Params[ 2 ] );
RakNet::BitStream
l_BitStream;
l_BitStream.Write ( ( uint16_t )a_Params[ 2 ] );
__NetGame->PlayerRPC( RPC_DestroyObject, &l_BitStream, ( uint16_t )a_Params[ 1 ], 2 );
return 1;
}
}
return -1;
}
开发者ID:Kaperstone,项目名称:open-samp,代码行数:27,代码来源:func_amx_deprecated_object.cpp
示例7: funcSetObjectRot
cell AMX_NATIVE_CALL funcSetObjectRot ( AMX* a_AmxInterface, cell* a_Params )
{
if(bScriptDebug) logprintf ( "[Call]-> funcSetObjectRot()" );
// DEPRECATED FUNCTION
logprintf ( "[Script]-> DEPRECATED FUNCTION: SetObjectRot(). Use ElementSetRotation() Instead (Read Open SA-MP Docs)." );
CHECK_PARAMS ( 4 );
uint16_t l_uint16_ObjectIndex = ( uint16_t )a_Params[ 1 ];
CDeprecatedObject* l_Object = NULL;
if ( __NetGame->objectPool && ( l_uint16_ObjectIndex < LIMIT_MAX_OBJECT ) && ( l_Object = __NetGame->objectPool->Get ( l_uint16_ObjectIndex ) ) )
{
tVector*
l_VectorRotation = new tVector();
l_VectorRotation->X = amx_ctof ( a_Params[ 2 ] );
l_VectorRotation->Y = amx_ctof ( a_Params[ 3 ] );
l_VectorRotation->Z = amx_ctof ( a_Params[ 4 ] );
l_Object->SetRotation ( l_VectorRotation );
RakNet::BitStream* l_BitStream = l_Object->ComputeBitStream_SetRotation();
if ( l_BitStream )
{
__NetGame->GlobalRPC( RPC_SetObjectRotation, l_BitStream, 0xFFFFu, 2 );
return 1;
}
}
return -1;
}
开发者ID:Kaperstone,项目名称:open-samp,代码行数:32,代码来源:func_amx_deprecated_object.cpp
示例8: CHECK_PARAMS
cell AMX_NATIVE_CALL Natives::CreateDynamicRaceCP(AMX *amx, cell *params)
{
CHECK_PARAMS(13, "CreateDynamicRaceCP");
if (core->getData()->getGlobalMaxItems(STREAMER_TYPE_RACE_CP) == core->getData()->raceCheckpoints.size())
{
return 0;
}
int raceCheckpointID = Item::RaceCheckpoint::identifier.get();
Item::SharedRaceCheckpoint raceCheckpoint(new Item::RaceCheckpoint);
raceCheckpoint->amx = amx;
raceCheckpoint->raceCheckpointID = raceCheckpointID;
raceCheckpoint->originalStreamDistance = -1.0f;
raceCheckpoint->type = static_cast<int>(params[1]);
raceCheckpoint->position = Eigen::Vector3f(amx_ctof(params[2]), amx_ctof(params[3]), amx_ctof(params[4]));
raceCheckpoint->next = Eigen::Vector3f(amx_ctof(params[5]), amx_ctof(params[6]), amx_ctof(params[7]));
raceCheckpoint->size = amx_ctof(params[8]);
Utility::addToContainer(raceCheckpoint->worlds, static_cast<int>(params[9]));
Utility::addToContainer(raceCheckpoint->interiors, static_cast<int>(params[10]));
Utility::addToContainer(raceCheckpoint->players, static_cast<int>(params[11]));
raceCheckpoint->streamDistance = amx_ctof(params[12]) < STREAMER_STATIC_DISTANCE_CUTOFF ? amx_ctof(params[12]) : amx_ctof(params[12]) * amx_ctof(params[12]);
Utility::addToContainer(raceCheckpoint->areas, static_cast<int>(params[13]));
core->getGrid()->addRaceCheckpoint(raceCheckpoint);
core->getData()->raceCheckpoints.insert(std::make_pair(raceCheckpointID, raceCheckpoint));
return static_cast<cell>(raceCheckpointID);
}
开发者ID:AdditiveX,项目名称:samp-streamer-plugin,代码行数:25,代码来源:race-checkpoints.cpp
示例9: CHECK_PARAMS
cell AMX_NATIVE_CALL Natives::GetDynamicVehicleDamageStatus(AMX *amx, cell *params)
{
CHECK_PARAMS(5, "GetDynamicVehicleDamageStatus");
boost::unordered_map<int, Item::SharedVehicle>::iterator v = core->getData()->vehicles.find(static_cast<int>(params[1]));
if (v != core->getData()->vehicles.end())
{
int panels, doors, lights, tires;
boost::unordered_map<int, int>::iterator i = core->getData()->internalVehicles.find(v->first);
if (i != core->getData()->internalVehicles.end())
{
GetVehicleDamageStatus(i->second, &panels, &doors, &lights, &tires);
}
else
{
panels = v->second->panels;
doors = v->second->doors;
lights = v->second->lights;
tires = v->second->tires;
}
Utility::storeIntegerInNative(amx, params[2], panels);
Utility::storeIntegerInNative(amx, params[3], doors);
Utility::storeIntegerInNative(amx, params[4], lights);
Utility::storeIntegerInNative(amx, params[5], tires);
return 1;
}
return 0;
}
开发者ID:kurta999,项目名称:samp-streamer-plugin,代码行数:27,代码来源:vehicles.cpp
示例10: CHECK_PARAMS
cell AMX_NATIVE_CALL Natives::CreateDynamicMapIcon(AMX *amx, cell *params)
{
CHECK_PARAMS(11, "CreateDynamicMapIcon");
if (core->getData()->getGlobalMaxItems(STREAMER_TYPE_MAP_ICON) == core->getData()->mapIcons.size())
{
return 0;
}
int mapIconID = Item::MapIcon::identifier.get();
Item::SharedMapIcon mapIcon(new Item::MapIcon);
mapIcon->amx = amx;
mapIcon->mapIconID = mapIconID;
mapIcon->originalStreamDistance = -1.0f;
mapIcon->position = Eigen::Vector3f(amx_ctof(params[1]), amx_ctof(params[2]), amx_ctof(params[3]));
mapIcon->type = static_cast<int>(params[4]);
mapIcon->color = static_cast<int>(params[5]);
Utility::addToContainer(mapIcon->worlds, static_cast<int>(params[6]));
Utility::addToContainer(mapIcon->interiors, static_cast<int>(params[7]));
Utility::addToContainer(mapIcon->players, static_cast<int>(params[8]));
mapIcon->streamDistance = amx_ctof(params[9]) < STREAMER_STATIC_DISTANCE_CUTOFF ? amx_ctof(params[9]) : amx_ctof(params[9]) * amx_ctof(params[9]);
mapIcon->style = static_cast<int>(params[10]);
Utility::addToContainer(mapIcon->areas, static_cast<int>(params[11]));
core->getGrid()->addMapIcon(mapIcon);
core->getData()->mapIcons.insert(std::make_pair(mapIconID, mapIcon));
return static_cast<cell>(mapIconID);
}
开发者ID:Abyss-z94,项目名称:samp-streamer-plugin,代码行数:25,代码来源:map-icons.cpp
示例11: fd_hook_data_register
/* Get a slot in the array */
int fd_hook_data_register(
size_t permsgdata_size,
void (*permsgdata_init_cb) (struct fd_hook_permsgdata *),
void (*permsgdata_fini_cb) (struct fd_hook_permsgdata *),
struct fd_hook_data_hdl **new_handle)
{
int ret = ENOSPC, idx;
TRACE_ENTRY("%zd %p %p %p", permsgdata_size, permsgdata_init_cb, permsgdata_fini_cb, new_handle);
CHECK_PARAMS( permsgdata_size && new_handle );
CHECK_POSIX( pthread_mutex_lock(&HDH_lock) );
if (max_index < FD_HOOK_HANDLE_LIMIT) {
idx = max_index++;
ret = 0;
}
CHECK_POSIX( pthread_mutex_unlock(&HDH_lock) );
if (ret == 0) {
HDH_array[idx].pmd_size = permsgdata_size;
HDH_array[idx].pmd_init_cb = permsgdata_init_cb;
HDH_array[idx].pmd_fini_cb = permsgdata_fini_cb;
*new_handle = &HDH_array[idx];
}
return ret;
}
开发者ID:KaushikBh,项目名称:freeDiameter,代码行数:28,代码来源:hooks.c
示例12: fd_hook_register
/* Register a new hook callback */
int fd_hook_register ( uint32_t type_mask,
void (*fd_hook_cb)(enum fd_hook_type type, struct msg * msg, struct peer_hdr * peer, void * other, struct fd_hook_permsgdata *pmd, void * regdata),
void *regdata,
struct fd_hook_data_hdl *data_hdl,
struct fd_hook_hdl ** handler )
{
struct fd_hook_hdl * newhdl = NULL;
int i;
TRACE_ENTRY("%x %p %p %p %p", type_mask, fd_hook_cb, regdata, data_hdl, handler);
CHECK_PARAMS( fd_hook_cb && handler );
CHECK_MALLOC( newhdl = malloc(sizeof(struct fd_hook_hdl)) );
memset(newhdl, 0, sizeof(struct fd_hook_hdl));
newhdl->fd_hook_cb = fd_hook_cb;
newhdl->regdata = regdata;
newhdl->data_hdl = data_hdl;
for (i=0; i <= HOOK_LAST; i++) {
fd_list_init(&newhdl->chain[i], newhdl);
if (type_mask & (1<<i)) {
CHECK_POSIX( pthread_rwlock_wrlock(&HS_array[i].rwlock) );
fd_list_insert_before( &HS_array[i].sentinel, &newhdl->chain[i]);
CHECK_POSIX( pthread_rwlock_unlock(&HS_array[i].rwlock) );
}
}
*handler = newhdl;
return 0;
}
开发者ID:KaushikBh,项目名称:freeDiameter,代码行数:33,代码来源:hooks.c
示例13: CHECK_PARAMS
cell AMX_NATIVE_CALL Natives::SetDynamicObjectMaterialText(AMX *amx, cell *params)
{
CHECK_PARAMS(10, "SetDynamicObjectMaterialText");
boost::unordered_map<int, Item::SharedObject>::iterator o = core->getData()->objects.find(static_cast<int>(params[1]));
if (o != core->getData()->objects.end())
{
int index = static_cast<int>(params[2]);
o->second->materials[index].text = boost::intrusive_ptr<Item::Object::Material::Text>(new Item::Object::Material::Text);
o->second->materials[index].text->materialText = Utility::convertNativeStringToString(amx, params[3]);
o->second->materials[index].text->materialSize = static_cast<int>(params[4]);
o->second->materials[index].text->fontFace = Utility::convertNativeStringToString(amx, params[5]);
o->second->materials[index].text->fontSize = static_cast<int>(params[6]);
o->second->materials[index].text->bold = static_cast<int>(params[7]) != 0;
o->second->materials[index].text->fontColor = static_cast<int>(params[8]);
o->second->materials[index].text->backColor = static_cast<int>(params[9]);
o->second->materials[index].text->textAlignment = static_cast<int>(params[10]);
for (boost::unordered_map<int, Player>::iterator p = core->getData()->players.begin(); p != core->getData()->players.end(); ++p)
{
boost::unordered_map<int, int>::iterator i = p->second.internalObjects.find(o->first);
if (i != p->second.internalObjects.end())
{
SetPlayerObjectMaterialText(p->first, i->second, o->second->materials[index].text->materialText.c_str(), index, o->second->materials[index].text->materialSize, o->second->materials[index].text->fontFace.c_str(), o->second->materials[index].text->fontSize, o->second->materials[index].text->bold, o->second->materials[index].text->fontColor, o->second->materials[index].text->backColor, o->second->materials[index].text->textAlignment);
}
}
o->second->materials[index].main.reset();
return 1;
}
return 0;
}
开发者ID:AdditiveX,项目名称:samp-streamer-plugin,代码行数:29,代码来源:objects.cpp
示例14: funcObjectCreate
cell AMX_NATIVE_CALL funcObjectCreate ( AMX* a_AmxInterface, cell* a_Params )
{
if ( bScriptDebug ) logprintf ( "[Call]-> funcObjectCreate()" );
//playerid, model, x, y, z, rx, ry, rz, elementid
CHECK_PARAMS ( 9 );
tVector*
l_VectorPosition = new tVector();
l_VectorPosition->X = amx_ctof ( a_Params[ 3 ] );
l_VectorPosition->Y = amx_ctof ( a_Params[ 4 ] );
l_VectorPosition->Z = amx_ctof ( a_Params[ 5 ] );
tVector*
l_VectorRotation = new tVector();
l_VectorRotation->X = amx_ctof ( a_Params[ 6 ] );
l_VectorRotation->Y = amx_ctof ( a_Params[ 7 ] );
l_VectorRotation->Z = amx_ctof ( a_Params[ 8 ] );
CObject* l_Object = __ElementFactory->CreateObject ( ( uint16_t )a_Params[ 1 ], ( uint32_t )a_Params[ 2 ], l_VectorPosition, l_VectorRotation, __ElementFactory->GetElementFromIndex ( a_Params[ 9 ] ) );
if ( l_Object )
{
uint32_t l_uint32_ElementIndex = l_Object->GetElementIndex();
if ( l_uint32_ElementIndex == -1 )
return -1;
return l_uint32_ElementIndex;
}
return -1;
}
开发者ID:Kaperstone,项目名称:open-samp,代码行数:29,代码来源:func_amx_object.cpp
示例15: rtereg_out
/* The callback called on new messages */
static int rtereg_out(void * cbdata, struct msg ** pmsg, struct fd_list * candidates)
{
struct msg * msg = *pmsg;
struct avp * avp = NULL;
TRACE_ENTRY("%p %p %p", cbdata, msg, candidates);
CHECK_PARAMS(msg && candidates);
/* Check if it is worth processing the message */
if (FD_IS_LIST_EMPTY(candidates)) {
return 0;
}
/* Now search the AVP in the message */
CHECK_FCT( fd_msg_search_avp ( msg, rtereg_conf.avp, &avp ) );
if (avp != NULL) {
struct avp_hdr * ahdr = NULL;
CHECK_FCT( fd_msg_avp_hdr ( avp, &ahdr ) );
if (ahdr->avp_value != NULL) {
#ifndef HAVE_REG_STARTEND
int ret;
/* Lock the buffer */
CHECK_POSIX( pthread_mutex_lock(&mtx) );
/* Augment the buffer if needed */
if (ahdr->avp_value->os.len >= bufsz) {
CHECK_MALLOC_DO( buf = realloc(buf, ahdr->avp_value->os.len + 1),
{ pthread_mutex_unlock(&mtx); return ENOMEM; } );
开发者ID:ClearwaterCore,项目名称:freeDiameter,代码行数:31,代码来源:rtereg.c
示例16: funcDestroyObject
cell AMX_NATIVE_CALL funcDestroyObject ( AMX* a_AmxInterface, cell* a_Params )
{
if(bScriptDebug) logprintf ( "[Call]-> funcDestroyObject()" );
// DEPRECATED FUNCTION
logprintf ( "[Script]-> DEPRECATED FUNCTION: DestroyObject(). Use ObjectDestroy() or ElementDestroy() Instead (Read Open SA-MP Docs)." );
CHECK_PARAMS ( 1 );
uint16_t l_uint16_ObjectIndex = ( uint16_t )a_Params[ 1 ];
CDeprecatedObject* l_Object = NULL;
if ( __NetGame->objectPool && ( l_uint16_ObjectIndex < LIMIT_MAX_OBJECT ) && ( l_Object = __NetGame->objectPool->Get ( l_uint16_ObjectIndex ) ) )
{
__NetGame->objectPool->Delete ( l_uint16_ObjectIndex );
RakNet::BitStream
l_BitStream;
l_BitStream.Write ( l_uint16_ObjectIndex );
__NetGame->GlobalRPC( RPC_DestroyObject, &l_BitStream, 0xFFFFu, 2 );
return 1;
}
return -1;
}
开发者ID:Kaperstone,项目名称:open-samp,代码行数:27,代码来源:func_amx_deprecated_object.cpp
示例17: funcGetPlayerObjectRot
cell AMX_NATIVE_CALL funcGetPlayerObjectRot ( AMX* a_AmxInterface, cell* a_Params )
{
if(bScriptDebug) logprintf ( "[Call]-> funcGetPlayerObjectRot()" );
// DEPRECATED FUNCTION
logprintf ( "[Script]-> DEPRECATED FUNCTION: GetPlayerObjectRot(). Use ElementGetRotation() Instead (Read Open SA-MP Docs)." );
CHECK_PARAMS ( 5 );
uint16_t l_uint16_PlayerIndex = ( uint16_t )a_Params[ 1 ];
if ( ( __NetGame->playerPool > 0 ) && ( l_uint16_PlayerIndex < 500 ) && ( __NetGame->playerPool->isCreated[ l_uint16_PlayerIndex ] ) )
{
uint16_t l_uint16_ObjectIndex = ( uint16_t )a_Params[ 2 ];
CDeprecatedObject* l_Object = NULL;
if ( __NetGame->objectPool && ( l_uint16_ObjectIndex < LIMIT_MAX_OBJECT ) && ( l_Object = __NetGame->objectPool->Get ( l_uint16_PlayerIndex, l_uint16_ObjectIndex ) ) )
{
tVector* l_VectorRotation = l_Object->GetRotation();
cell* cptr;
amx_GetAddr ( a_AmxInterface, a_Params[ 3 ], &cptr);
*cptr = amx_ftoc ( l_VectorRotation->X );
amx_GetAddr ( a_AmxInterface, a_Params[ 4 ], &cptr);
*cptr = amx_ftoc ( l_VectorRotation->Y );
amx_GetAddr ( a_AmxInterface, a_Params[ 5 ], &cptr);
*cptr = amx_ftoc ( l_VectorRotation->Z );
return 1;
}
}
return 0;
}
开发者ID:Kaperstone,项目名称:open-samp,代码行数:34,代码来源:func_amx_deprecated_object.cpp
示例18: funcAttachObjectToPlayer
cell AMX_NATIVE_CALL funcAttachObjectToPlayer ( AMX* a_AmxInterface, cell* a_Params )
{
if(bScriptDebug) logprintf ( "[Call]-> funcAttachObjectToPlayer()" );
// DEPRECATED FUNCTION
logprintf ( "[Script]-> DEPRECATED FUNCTION: AttachObjectToPlayer(). Use Parent/Child Concept Instead (Read Open SA-MP Docs)." );
CHECK_PARAMS ( 8 );
uint16_t l_uint16_ObjectIndex = ( uint16_t )a_Params[ 1 ];
if ( __NetGame->objectPool && ( l_uint16_ObjectIndex < LIMIT_MAX_OBJECT ) && ( __NetGame->objectPool->Get ( l_uint16_ObjectIndex ) ) )
{
uint16_t l_uint16_PlayerIndex = ( uint16_t )a_Params[ 2 ];
if ( ( __NetGame->playerPool > 0 ) && ( l_uint16_PlayerIndex < 500 ) && ( __NetGame->playerPool->isCreated[ l_uint16_PlayerIndex ] ) )
{
RakNet::BitStream
l_BitStream;
l_BitStream.Write ( l_uint16_ObjectIndex );
l_BitStream.Write ( l_uint16_PlayerIndex );
l_BitStream.Write ( amx_ctof ( a_Params[ 3 ] ) );
l_BitStream.Write ( amx_ctof ( a_Params[ 4 ] ) );
l_BitStream.Write ( amx_ctof ( a_Params[ 5 ] ) );
l_BitStream.Write ( amx_ctof ( a_Params[ 6 ] ) );
l_BitStream.Write ( amx_ctof ( a_Params[ 7 ] ) );
l_BitStream.Write ( amx_ctof ( a_Params[ 8 ] ) );
__NetGame->AddedPlayersRPC( RPC_AttachObjectToPlayer, &l_BitStream, l_uint16_PlayerIndex, 2 );
__NetGame->PlayerRPC( RPC_AttachObjectToPlayer, &l_BitStream, l_uint16_PlayerIndex, 2 );
return 1;
}
}
return -1;
}
开发者ID:Kaperstone,项目名称:open-samp,代码行数:35,代码来源:func_amx_deprecated_object.cpp
注:本文中的CHECK_PARAMS函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论