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

compile error


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Johnoclock
Member
Join Date: Oct 2014
Location: denmark
Old 09-05-2015 , 09:46   compile error
Reply With Quote #1

//// speed admin.sp
//
// speed admin.sp(33) : error 100: function prototypes do not match
// speed admin.sp(35) : warning 217: loose indentation
// speed admin.sp(74) : warning 217: loose indentation
// speed admin.sp(80) : warning 217: loose indentation
// speed admin.sp(89) : warning 217: loose indentation
// speed admin.sp(114) : warning 217: loose indentation
//
// 1 Error.
//
// Compilation Time: 1,33 sec
// ----------------------------------------

i fix it thx guys

Last edited by Johnoclock; 09-05-2015 at 13:18.
Johnoclock is offline
KissLick
Veteran Member
Join Date: Nov 2012
Location: void
Old 09-05-2015 , 11:05   Re: compile error
Reply With Quote #2

Quote:
Originally Posted by john96dk View Post
// speed admin.sp(33) : error 100: function prototypes do not match
Find the problem:
  1. function prototypes do not match - Arguments in the function calling are wrong
  2. Line 33 in admin.sp: RegAdminCmd("voicemenu", MedicCall, ADMFLAG_SLAY);
  3. Look at RegAdminCmd at API site -> native RegAdminCmd(const String:cmd[], ConCmd:callback, adminflags, const String:description[]="", const String:group[]="", flags=0);
  4. Compare args:
    1. "voicemenu" is OK
    2. MedicCall
      1. From API site -> functag public Action:ConCmd(client, args);
      2. And yours -> public Action:MedicCall(client, String:command[], args)
      3. So it's not OK
Solve the problem:
You must use functag public Action:ConCmd(client, args); header for your MedicCall callback.
But you can notice, that MedicCall and AddCommandListener use different headers, so you must separate them.

P.S.: As you nicely asked us for help, I nicely answered you and you are welcome :-)

Last edited by KissLick; 09-05-2015 at 11:06.
KissLick is offline
WildCard65
Veteran Member
Join Date: Aug 2013
Location: Canada
Old 09-05-2015 , 11:31   Re: compile error
Reply With Quote #3

voicemenu is a command I believe TF2 registers so I think you need to listen for the command instead of re-registering it.

Kisslick, the "function prototype doesn't match" error means the function signature doesn't match. A function's signature includes the return type as well as number of params + their types.
__________________

Last edited by WildCard65; 09-05-2015 at 11:31.
WildCard65 is offline
Johnoclock
Member
Join Date: Oct 2014
Location: denmark
Old 09-05-2015 , 11:42   Re: compile error
Reply With Quote #4

Quote:
Originally Posted by KissLick View Post
Find the problem:

[/LIST]Solve the problem:
You must use functag public Action:ConCmd(client, args); header for your MedicCall callback.
But you can notice, that MedicCall and AddCommandListener use different headers, so you must separate them.

P.S.: As you nicely asked us for help, I nicely answered you and you are welcome :-)
sorry how do i do dat becose im use the callmedic so the AddCommandListener is look for then player are call after a medic
Johnoclock is offline
Johnoclock
Member
Join Date: Oct 2014
Location: denmark
Old 09-05-2015 , 12:24   Re: compile error
Reply With Quote #5

but i just want to make så only ppl with a adminflag can use it
Johnoclock is offline
TheUnderTaker
Senior Member
Join Date: Dec 2013
Location: Israel
Old 09-06-2015 , 07:12   Re: compile error
Reply With Quote #6

Quote:
Originally Posted by john96dk View Post
but i just want to make så only ppl with a adminflag can use it
Send code, I will fix for you, if you don't want make it public so sent me in pm.
__________________
SourcePawn, C# and C++ Programmer.

My plugin list
TheUnderTaker is offline
Johnoclock
Member
Join Date: Oct 2014
Location: denmark
Old 09-06-2015 , 13:45   Re: compile error
Reply With Quote #7

Quote:
Originally Posted by TheUnderTaker View Post
Send code, I will fix for you, if you don't want make it public so sent me in pm.
i fix it with

else if(!CheckCommandAccess(client, "generic_admin", ADMFLAG_GENERIC, false))

dat work
Johnoclock 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 19:37.


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