|
发表于 2008-8-20 14:34:46
|
显示全部楼层
来自 中国–广东–深圳
回复: 关于get_user_wstats命令的数据来源?
应该是csx模块的..
[php]
static cell AMX_NATIVE_CALL get_user_wstats(AMX *amx, cell *params) /* 4 param */
{
int index = params[1];
CHECK_PLAYERRANGE(index);
int weapon = params[2];
if (weapon<0||weapon>=MAX_WEAPONS+MAX_CWEAPONS){
MF_LogError(amx, AMX_ERR_NATIVE, "Invalid weapon id %d", weapon);
return 0;
}
CPlayer* pPlayer = GET_PLAYER_POINTER_I(index);
if (pPlayer->weapons[weapon].shots){
cell *cpStats = MF_GetAmxAddr(amx,params[3]);
cell *cpBodyHits = MF_GetAmxAddr(amx,params[4]);
CPlayer::PlayerWeapon* stats = &pPlayer->weapons[weapon];
cpStats[0] = stats->kills;
cpStats[1] = stats->deaths;
cpStats[2] = stats->hs;
cpStats[3] = stats->tks;
cpStats[4] = stats->shots;
cpStats[5] = stats->hits;
cpStats[6] = stats->damage;
for(int i = 1; i < 8; ++i)
cpBodyHits = stats->bodyHits;
return 1;
}
return 0;
}
[/php] |
|