custom weapon natives/code update

This commit is contained in:
Lukasz Wlasinksi 2004-08-04 10:42:29 +00:00
parent 245932a825
commit ee2c5c4f8b
5 changed files with 27 additions and 29 deletions

View File

@ -61,13 +61,11 @@ native get_statsnum();
native get_user_stats2(index,stats[4]);
native get_stats2(index,stats[4]);
/*
* Custom weapons support ( like: gasnades, lasers )
*/
native register_cwpn( name[] );
native custom_wpn_dmg( wId,att,vic,dmg,hitplace=0 );
native custom_wpn_shot( index,wid );
native get_custom_wpnname( wId,name[],len );
/* Custom weapons support ( like: gasnades, lasers ) */
native reg_custom_weapon( wpnname[],melee = 0,logname[]="" );
native custom_weapon_dmg( weapon, att, vic, damage, hitplace );
native custom_weapon_shot( weapon,index ); // weapon id , player id
native get_custom_wpnname( weapon,szName[],len );
/*
* Forwards

View File

@ -351,13 +351,13 @@ static cell AMX_NATIVE_CALL custom_wpn_dmg(AMX *amx, cell *params){ // wid,att,v
}
static cell AMX_NATIVE_CALL custom_wpn_shot(AMX *amx, cell *params){ // player,wid
int index = params[1];
int index = params[2];
if (index<1||index>gpGlobals->maxClients){
MF_RaiseAmxError(amx,AMX_ERR_NATIVE);
return 0;
}
int weapon = params[2];
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");
@ -419,9 +419,9 @@ AMX_NATIVE_INFO stats_Natives[] = {
{ "reset_user_wstats", reset_user_wstats },
// Custom Weapon Support
{ "register_cwpn", register_cwpn },
{ "custom_wpn_dmg", custom_wpn_dmg },
{ "custom_wpn_shot", custom_wpn_shot },
{ "reg_custom_weapon", register_cwpn },
{ "custom_weapon_dmg", custom_wpn_dmg },
{ "custom_weapon_shot", custom_wpn_shot },
{ "get_custom_wpnname", get_custom_wpnname },
{"register_statsfwd",register_forward },

View File

@ -333,12 +333,12 @@ static cell AMX_NATIVE_CALL register_cwpn(AMX *amx, cell *params){ // name,logna
int iLen;
char *szName = MF_GetAmxString(amx, params[1], 0, &iLen);
char *szLogName = MF_GetAmxString(amx, params[2], 0, &iLen);
char *szLogName = MF_GetAmxString(amx, params[3], 0, &iLen);
strcpy(weaponData[i].name,szName);
strcpy(weaponData[i].logname,szLogName);
weaponData[i].needcheck = true;
weaponData[i].melee = params[3] ? true:false;
weaponData[i].melee = params[2] ? true:false;
return i;
}
@ -407,13 +407,13 @@ static cell AMX_NATIVE_CALL cwpn_dmg(AMX *amx, cell *params){ // wid,att,vic,dmg
}
static cell AMX_NATIVE_CALL cwpn_shot(AMX *amx, cell *params){ // player,wid
int index = params[1];
int index = params[2];
if (index<1||index>gpGlobals->maxClients){
MF_RaiseAmxError(amx,AMX_ERR_NATIVE);
return 0;
}
int weapon = params[2];
int weapon = params[1];
if ( weapon < DODMAX_WEAPONS-DODMAX_CUSTOMWPNS ){
MF_RaiseAmxError(amx,AMX_ERR_NATIVE);
return 0;
@ -439,9 +439,9 @@ AMX_NATIVE_INFO stats_Natives[] = {
{ "reset_user_wstats", reset_user_wstats },
// Custom Weapon Support
{ "reg_custom_wpn", register_cwpn },
{ "custom_wpn_dmg", cwpn_dmg },
{ "custom_wpn_shot", cwpn_shot },
{ "reg_custom_weapon", register_cwpn }, // name,melee,logname
{ "custom_weapon_dmg", cwpn_dmg },
{ "custom_weapon_shot", cwpn_shot },
{ NULL, NULL }
};

View File

@ -332,13 +332,13 @@ static cell AMX_NATIVE_CALL cwpn_dmg(AMX *amx, cell *params){ // wid,att,vic,dmg
}
static cell AMX_NATIVE_CALL cwpn_shot(AMX *amx, cell *params){ // player,wid
int index = params[1];
int index = params[2];
if (index<1||index>gpGlobals->maxClients){
MF_RaiseAmxError(amx,AMX_ERR_NATIVE);
return 0;
}
int weapon = params[2];
int weapon = params[1];
if ( weapon < TFCMAX_WEAPONS-TFCMAX_CUSTOMWPNS ){
MF_RaiseAmxError(amx,AMX_ERR_NATIVE);
return 0;
@ -363,9 +363,9 @@ AMX_NATIVE_INFO stats_Natives[] = {
{ "reset_user_wstats", reset_user_wstats },
// Custom Weapon Support
{ "reg_custom_wpn", register_cwpn },
{ "custom_wpn_dmg", cwpn_dmg },
{ "custom_wpn_shot", cwpn_shot },
{ "reg_custom_weapon", register_cwpn },
{ "custom_weapon_dmg", cwpn_dmg },
{ "custom_weapon_shot", cwpn_shot },
{ NULL, NULL }
};

View File

@ -332,13 +332,13 @@ static cell AMX_NATIVE_CALL cwpn_dmg(AMX *amx, cell *params){ // wid,att,vic,dmg
}
static cell AMX_NATIVE_CALL cwpn_shot(AMX *amx, cell *params){ // player,wid
int index = params[1];
int index = params[2];
if (index<1||index>gpGlobals->maxClients){
MF_RaiseAmxError(amx,AMX_ERR_NATIVE);
return 0;
}
int weapon = params[2];
int weapon = params[1];
if ( weapon < TSMAX_WEAPONS-TSMAX_CUSTOMWPNS ){
MF_RaiseAmxError(amx,AMX_ERR_NATIVE);
return 0;
@ -363,9 +363,9 @@ AMX_NATIVE_INFO stats_Natives[] = {
{ "reset_user_wstats", reset_user_wstats },
// Custom Weapon Support
{ "reg_custom_wpn", register_cwpn },
{ "custom_wpn_dmg", cwpn_dmg },
{ "custom_wpn_shot", cwpn_shot },
{ "reg_custom_weapon", register_cwpn },
{ "custom_weapon_dmg", cwpn_dmg },
{ "custom_weapon_shot", cwpn_shot },
{ NULL, NULL }
};