Raised This Month: $51 Target: $400
 12% 

warning 218 and error 35


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Aear
New Member
Join Date: Oct 2022
Old 04-12-2024 , 10:09   warning 218 and error 35
Reply With Quote #1

i just try to compile this sma but i got this :
warning 218: old style prototypes used with optional semicolumns
error 035: argument type mismatch (argument 2)
im just dont know how to fix this warning and error

here warning line
public fw_SetModel(entity, const model[]);

here error line
give_item(id, THUNDERBOLT_WEAPON);


warning on line 92
and error on line 137

edit : i fix it but i got new problem after rebuild the plugin i just dont know when i spawn it inside game and try to press mouse1 its doesnt shoot nothing happened the animation doesnt run and shoot sound too just idle sound i upload the new sma hope anyone fix it
Attached Files
File Type: sma Get Plugin or Get Source (wpn_thunderbolt.sma - 53 views - 7.4 KB)

Last edited by Aear; 04-12-2024 at 15:56. Reason: add source
Aear is offline
Vaflyan
Junior Member
Join Date: Mar 2024
Old 04-12-2024 , 12:32   Re: warning 218 and error 35
Reply With Quote #2

Quote:
Originally Posted by Aear View Post
i just try to compile this sma but i got this :
warning 218: old style prototypes used with optional semicolumns
error 035: argument type mismatch (argument 2)
im just dont know how to fix this warning and error

here warning line
public fw_SetModel(entity, const model[]);

here error line
give_item(id, THUNDERBOLT_WEAPON);


warning on line 92
and error on line 137
#define THUNDERBOLT_WEAPON 123 // Replace 123 with the actual weapon ID // Have you replaced the ID of the weapon? Most likely, the error occurs due to the lack of a correct ID in the define line

An error also indicates a mismatch of arguments. Perhaps the arguments were written incorrectly
Vaflyan is offline
Aear
New Member
Join Date: Oct 2022
Old 04-12-2024 , 15:31   Re: warning 218 and error 35
Reply With Quote #3

Quote:
Originally Posted by Vaflyan View Post
#define THUNDERBOLT_WEAPON 123 // Replace 123 with the actual weapon ID // Have you replaced the ID of the weapon? Most likely, the error occurs due to the lack of a correct ID in the define line

An error also indicates a mismatch of arguments. Perhaps the arguments were written incorrectly
hello im just fixed it and rebuild the plugin based on kord ethereal
in reality no i just cant find the correct weapon id and also the the plugin works but when i spawn in it inside game
and press mouse1 its doesnt shot and no animation changed or sound just nothing i have this new problem
Aear is offline
mlibre
Veteran Member
Join Date: Nov 2015
Location: return PLUGIN_CONTINUE
Old 04-12-2024 , 17:48   Re: warning 218 and error 35
Reply With Quote #4

what changes have you made
__________________
mlibre is offline
Aear
New Member
Join Date: Oct 2022
Old 04-12-2024 , 20:44   Re: warning 218 and error 35
Reply With Quote #5

maybe the whole plugin i change before i made the plugin in my own without add include <hl_wpnmod>
so i check some other weapons that made by community like ethereal and my plugin was missing many things
you can say i try to copy some lines and edit it and when the weapon wont shot i add this

//********************************************* *
//* The main attack of a weapon is triggered. *
//********************************************* *
public Thunderbolt_PrimaryAttack(const iItem, const iPlayer, const iClip)
{
// Print a debug message to the server console
server_print("Thunderbolt_PrimaryAttack called");

// Check if the player is out of ammo
if (iClip <= 0)
{
// Print a debug message to the server console
server_print("Out of ammo");

// Play empty sound if out of ammo
wpnmod_play_empty_sound(iItem);
// Set delay before next shot
wpnmod_set_offset_float(iItem, Offset_flNextPrimaryAttack, 0.15);
return; // Exit the function
}

// Print a debug message to the server console
server_print("Firing Thunderbolt");

// Play firing sound at the player's position
engfunc(EngFunc_EmitSound, iPlayer, CHAN_AUTO, SOUND_FIRE, 0.9, ATTN_NORM, 0, PITCH_NORM);

// Set delay before next shot
wpnmod_set_offset_float(iItem, Offset_flNextPrimaryAttack, 0.1);

// Set player animation
wpnmod_set_player_anim(iPlayer, PLAYER_ATTACK1);
}

im already upload the sma if that needed in main message

and just note when i fix first plugin that doesnt have hl_wpnmod include the weapon wasnt show in items list when i type wpnmod items
this why i rebuild the plugin based on ethereal weapon plugin

Last edited by Aear; 04-12-2024 at 20:48.
Aear is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 13:09.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode