removed <xmod> compatibility from csstats as requested by SniperBeamer
This commit is contained in:
@ -273,170 +273,6 @@ static cell AMX_NATIVE_CALL get_statsnum(AMX *amx, cell *params)
|
||||
return g_rank.getRankNum();
|
||||
}
|
||||
|
||||
static cell AMX_NATIVE_CALL register_cwpn(AMX *amx, cell *params){ // name,logname,melee=0
|
||||
int i;
|
||||
bool bFree = false;
|
||||
for ( i=MAX_WEAPONS;i<MAX_WEAPONS+MAX_CWEAPONS;i++){
|
||||
if ( !weaponData[i].ammoSlot ){
|
||||
bFree = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if ( !bFree ){
|
||||
MF_PrintSrvConsole("No More Custom Weapon Slots!\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
int iLen;
|
||||
char *szName = MF_GetAmxString(amx, params[1], 0, &iLen);
|
||||
char *szLogName = MF_GetAmxString(amx, params[3], 0, &iLen);
|
||||
|
||||
strcpy(weaponData[i].name,szName);
|
||||
strcpy(weaponData[i].logname,szLogName);
|
||||
weaponData[i].ammoSlot = 1;
|
||||
weaponData[i].melee = params[2] ? true:false;
|
||||
|
||||
return i;
|
||||
}
|
||||
|
||||
static cell AMX_NATIVE_CALL custom_wpn_dmg(AMX *amx, cell *params){ // wid,att,vic,dmg,hp=0
|
||||
int weapon = params[1];
|
||||
if ( weapon < MAX_WEAPONS || weapon >= MAX_WEAPONS+MAX_CWEAPONS || !weaponData[weapon].ammoSlot ){ // only for custom weapons
|
||||
MF_RaiseAmxError(amx,AMX_ERR_NATIVE);
|
||||
MF_PrintSrvConsole("Weapon ID Is Not Valid!\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
int att = params[2];
|
||||
if (att<1||att>gpGlobals->maxClients){
|
||||
MF_RaiseAmxError(amx,AMX_ERR_NATIVE);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int vic = params[3];
|
||||
if (vic<1||vic>gpGlobals->maxClients){
|
||||
MF_RaiseAmxError(amx,AMX_ERR_NATIVE);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int dmg = params[4];
|
||||
if ( dmg<1 ){
|
||||
MF_RaiseAmxError(amx,AMX_ERR_NATIVE);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int aim = params[5];
|
||||
if ( aim < 0 || aim > 7 ){
|
||||
MF_RaiseAmxError(amx,AMX_ERR_NATIVE);
|
||||
return 0;
|
||||
}
|
||||
|
||||
CPlayer* pAtt = GET_PLAYER_POINTER_I(att);
|
||||
CPlayer* pVic = GET_PLAYER_POINTER_I(vic);
|
||||
|
||||
pVic->pEdict->v.dmg_inflictor = NULL;
|
||||
pAtt->saveHit( pVic , weapon , dmg, aim );
|
||||
|
||||
if ( !pAtt ) pAtt = pVic;
|
||||
int TA = 0;
|
||||
if ( (pVic->teamId == pAtt->teamId) && ( pVic != pAtt) )
|
||||
TA = 1;
|
||||
g_damage_info.exec( pAtt->index, pVic->index, dmg, weapon, aim, TA );
|
||||
|
||||
if ( pVic->IsAlive() )
|
||||
return 1;
|
||||
|
||||
pAtt->saveKill(pVic,weapon,( aim == 1 ) ? 1:0 ,TA);
|
||||
g_death_info.exec( pAtt->index, pVic->index, weapon, aim, TA );
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
static cell AMX_NATIVE_CALL custom_wpn_shot(AMX *amx, cell *params){ // player,wid
|
||||
int index = params[2];
|
||||
if (index<1||index>gpGlobals->maxClients){
|
||||
MF_RaiseAmxError(amx,AMX_ERR_NATIVE);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int weapon = params[1];
|
||||
if ( weapon < MAX_WEAPONS || weapon >= MAX_WEAPONS+MAX_CWEAPONS || !weaponData[weapon].ammoSlot ){
|
||||
MF_RaiseAmxError(amx,AMX_ERR_NATIVE);
|
||||
MF_PrintSrvConsole("Weapon ID Is Not Valid!\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
CPlayer* pPlayer = GET_PLAYER_POINTER_I(index);
|
||||
pPlayer->saveShot(weapon);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
static cell AMX_NATIVE_CALL get_wpnname(AMX *amx, cell *params){
|
||||
int id = params[1];
|
||||
if (id<0 || id>=MAX_WEAPONS+MAX_CWEAPONS ){
|
||||
MF_RaiseAmxError(amx,AMX_ERR_NATIVE);
|
||||
MF_PrintSrvConsole("Weapon ID Is Not Valid!\n");
|
||||
return 0;
|
||||
}
|
||||
return MF_SetAmxString(amx,params[2],weaponData[id].name,params[3]);
|
||||
}
|
||||
|
||||
static cell AMX_NATIVE_CALL get_wpnlogname(AMX *amx, cell *params){
|
||||
int id = params[1];
|
||||
if (id<0 || id>=MAX_WEAPONS+MAX_CWEAPONS ){
|
||||
MF_RaiseAmxError(amx,AMX_ERR_NATIVE);
|
||||
MF_PrintSrvConsole("Weapon ID Is Not Valid!\n");
|
||||
return 0;
|
||||
}
|
||||
return MF_SetAmxString(amx,params[2],weaponData[id].logname,params[3]);
|
||||
}
|
||||
|
||||
static cell AMX_NATIVE_CALL is_melee(AMX *amx, cell *params){
|
||||
int id = params[1];
|
||||
if (id<0 || id>=MAX_WEAPONS+MAX_CWEAPONS ){
|
||||
MF_RaiseAmxError(amx,AMX_ERR_NATIVE);
|
||||
MF_PrintSrvConsole("Weapon ID Is Not Valid!\n");
|
||||
return 0;
|
||||
}
|
||||
if ( id = 29 )
|
||||
return 1;
|
||||
return weaponData[id].melee ? 1:0;
|
||||
}
|
||||
|
||||
static cell AMX_NATIVE_CALL register_forward(AMX *amx, cell *params){ // forward
|
||||
int iFunctionIndex;
|
||||
switch( params[1] ){
|
||||
case 0:
|
||||
if( MF_AmxFindPublic(amx, "client_damage", &iFunctionIndex) == AMX_ERR_NONE )
|
||||
g_damage_info.put( amx , iFunctionIndex );
|
||||
else
|
||||
MF_RaiseAmxError(amx,AMX_ERR_NATIVE);
|
||||
return 0;
|
||||
break;
|
||||
case 1:
|
||||
if( MF_AmxFindPublic(amx, "client_death", &iFunctionIndex) == AMX_ERR_NONE )
|
||||
g_death_info.put( amx , iFunctionIndex );
|
||||
else
|
||||
MF_RaiseAmxError(amx,AMX_ERR_NATIVE);
|
||||
return 0;
|
||||
break;
|
||||
default:
|
||||
MF_RaiseAmxError(amx,AMX_ERR_NATIVE);
|
||||
return 0;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
static cell AMX_NATIVE_CALL get_maxweapons(AMX *amx, cell *params){
|
||||
return MAX_WEAPONS+MAX_CWEAPONS;
|
||||
}
|
||||
|
||||
static cell AMX_NATIVE_CALL get_stats_size(AMX *amx, cell *params){
|
||||
return 8;
|
||||
}
|
||||
|
||||
AMX_NATIVE_INFO stats_Natives[] = {
|
||||
{ "get_stats", get_stats},
|
||||
{ "get_stats2", get_stats2},
|
||||
@ -451,19 +287,6 @@ AMX_NATIVE_INFO stats_Natives[] = {
|
||||
{ "get_user_wstats", get_user_wstats},
|
||||
{ "reset_user_wstats", reset_user_wstats },
|
||||
|
||||
// Custom Weapon Support
|
||||
{ "custom_weapon_add", register_cwpn },
|
||||
{ "custom_weapon_dmg", custom_wpn_dmg },
|
||||
{ "custom_weapon_shot", custom_wpn_shot },
|
||||
|
||||
{ "xmod_get_wpnname", get_wpnname },
|
||||
{ "xmod_get_wpnlogname", get_wpnlogname },
|
||||
{ "xmod_is_melee_wpn", is_melee },
|
||||
{ "xmod_get_maxweapons", get_maxweapons },
|
||||
{ "xmod_get_stats_size", get_stats_size },
|
||||
|
||||
{ "register_statsfwd",register_forward },
|
||||
|
||||
///*******************
|
||||
{ NULL, NULL }
|
||||
};
|
||||
|
Reference in New Issue
Block a user