SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 31/05/2020, 06:22 PM   #1
SkyFlare
Huge Clucker
 
SkyFlare's Avatar
 
Join Date: Apr 2015
Location: NZ
Posts: 221
Reputation: 43
Default Const Correctness with Pawno Compiler version 3.10.10

https://github.com/pawn-lang/compile...st-Correctness

After updating my Compiler version to 3.10.10 I have read the Wiki and the Const-Correctness Page...

Unfortunately for me, I haven't really learned about Const's and their usage.

Update, I found my Const's to add to the natives inside the Includes used, including the SAMP original Includes, I modified them to suit my use, probably would be best for someone who really knows what they are doing... to update these for the compiler.

Has anyone got some Info and or a link to a Tutorial about Consts? I still want to learn, if theres really detailed Documentation id love to read it.
__________________
Purchasable Scripting Services Available, Inbox me with your Requests.
My Project Progress Tracker
My Work
Link
Information
S-Store System V2 LinkIngame Store in Dialogs

Last edited by SkyFlare; 02/06/2020 at 04:44 AM.
SkyFlare is offline   Reply With Quote
Old 31/05/2020, 06:45 PM   #2
PatrickGTR
Little Clucker
 
PatrickGTR's Avatar
 
Join Date: Sep 2010
Location: United Kingdom
Posts: 19
Reputation: 61
Default Re: Const Correctness with Pawno Compiler version 3.10.10

Code:
preLoadAnim(playerid, const animlib[]) return ApplyAnimation(playerid,animlib,"null", 0.0, 0, 0, 0, 0, 0 );
should be
Code:
preLoadAnim(playerid, const animlib[]) return ApplyAnimation(playerid,animlib,"null", 0.0, 0, 0, 0, 0, 0 );
More information: https://github.com/pawn-lang/compile...st-Correctness
PatrickGTR is offline   Reply With Quote
Old 31/05/2020, 06:48 PM   #3
SkyFlare
Huge Clucker
 
SkyFlare's Avatar
 
Join Date: Apr 2015
Location: NZ
Posts: 221
Reputation: 43
Default Re: Const Correctness with Pawno Compiler version 3.10.10

Quote:
Originally Posted by PatrickGTR View Post
Code:
preLoadAnim(playerid, const animlib[]) return ApplyAnimation(playerid,animlib,"null", 0.0, 0, 0, 0, 0, 0 );
should be
Code:
preLoadAnim(playerid, const animlib[]) return ApplyAnimation(playerid,animlib,"null", 0.0, 0, 0, 0, 0, 0 );
More information: https://github.com/pawn-lang/compile...st-Correctness
Exactly my thoughts, but when I put that in there, I get this

Code:
error 035: argument type mismatch (argument 2)
Not to mention animlib isnt a constant unchanged value, in theory the const should be "null", 0.0, 0, 0, 0, 0, 0
__________________
Purchasable Scripting Services Available, Inbox me with your Requests.
My Project Progress Tracker
My Work
Link
Information
S-Store System V2 LinkIngame Store in Dialogs
SkyFlare is offline   Reply With Quote
Old 01/06/2020, 06:25 AM   #4
SkyFlare
Huge Clucker
 
SkyFlare's Avatar
 
Join Date: Apr 2015
Location: NZ
Posts: 221
Reputation: 43
Default Re: Const Correctness with Pawno Compiler version 3.10.10

Double Post Reason: Unresolved, need answers.

Sorry for this double post but I wouldn't do it without a reason, I really want the latest Pawn Compiler, I want to be able to code better, but without the correct knowledge or Tutorials on Const's I don't think it's possible, so for anyone else who's having problems... at this stage, Pawn compiler 3.10.8 seems to run without them warnings. so ive downgraded till it's possible to figure out consts.
__________________
Purchasable Scripting Services Available, Inbox me with your Requests.
My Project Progress Tracker
My Work
Link
Information
S-Store System V2 LinkIngame Store in Dialogs
SkyFlare is offline   Reply With Quote
Old 01/06/2020, 07:16 AM   #5
Fairuz
Huge Clucker
 
Fairuz's Avatar
 
Join Date: Sep 2015
Location: Indonesia
Posts: 467
Reputation: 89
Default Re: Const Correctness with Pawno Compiler version 3.10.10

Quote:
Originally Posted by SkyFlare View Post
Double Post Reason: Unresolved, need answers.

Sorry for this double post but I wouldn't do it without a reason, I really want the latest Pawn Compiler, I want to be able to code better, but without the correct knowledge or Tutorials on Const's I don't think it's possible, so for anyone else who's having problems... at this stage, Pawn compiler 3.10.8 seems to run without them warnings. so ive downgraded till it's possible to figure out consts.
You might want to disable the warning until you figure it out,so that you can still use other features and get bug fixes
__________________
Los Santos based Cops and Robbers with many features.
178.128.82.211:7777
Fairuz is offline   Reply With Quote
Old 01/06/2020, 10:25 AM   #6
SkyFlare
Huge Clucker
 
SkyFlare's Avatar
 
Join Date: Apr 2015
Location: NZ
Posts: 221
Reputation: 43
Default Re: Const Correctness with Pawno Compiler version 3.10.10

Quote:
Originally Posted by Fairuz View Post
You might want to disable the warning until you figure it out,so that you can still use other features and get bug fixes
It's okay, I have been running the stock standard Pawno Compiler the whole time I have Scripted for SAMP Servers, all these years, so I guess going down 1 Version wont hurt me, considering its still a very large change anyway.
__________________
Purchasable Scripting Services Available, Inbox me with your Requests.
My Project Progress Tracker
My Work
Link
Information
S-Store System V2 LinkIngame Store in Dialogs
SkyFlare is offline   Reply With Quote
Old 01/06/2020, 10:34 AM   #7
hopeonxanny
Huge Clucker
 
hopeonxanny's Avatar
 
Join Date: Apr 2020
Location: SA-MP Awesomeness: 1998
Posts: 238
Reputation: 4
Default Re: Const Correctness with Pawno Compiler version 3.10.10

PHP Code:
preLoadAnim(playerid, const animlib[]) return ApplyAnimation(playeridanimlib"null"0.000000);
PreloadAnims(playerid)
{
    
preLoadAnim(playerid,"DANCING");

i have just compiled it like this, without "const" it gave me the warns, but after adding it, it worked so fine so good...
zeex 3.10.10.
__________________
hopeonxanny is offline   Reply With Quote
Old 01/06/2020, 11:54 AM   #8
NaS
High-roller
 
NaS's Avatar
 
Join Date: Mar 2008
Location: 🇩🇪
Posts: 1,801
Reputation: 635
Default Re: Const Correctness with Pawno Compiler version 3.10.10

Your issue is likely to come from the ApplyAnimation native call, rather than the preLoadAnimLib pawn function.

If you indented the code into at least two lines you could have noticed that the warning line is not the function header. The reason is the native definitions are not const correct in the original includes.
NaS is offline   Reply With Quote
Old 01/06/2020, 01:03 PM   #9
SkyFlare
Huge Clucker
 
SkyFlare's Avatar
 
Join Date: Apr 2015
Location: NZ
Posts: 221
Reputation: 43
Default Re: Const Correctness with Pawno Compiler version 3.10.10

Quote:
Originally Posted by NaS View Post
Your issue is likely to come from the ApplyAnimation native call, rather than the preLoadAnimLib pawn function.

If you indented the code into at least two lines you could have noticed that the warning line is not the function header. The reason is the native definitions are not const correct in the original includes.
Yeah, also getting warnings from other Includes too, I am guessing I have to correct the natives for all of these.
__________________
Purchasable Scripting Services Available, Inbox me with your Requests.
My Project Progress Tracker
My Work
Link
Information
S-Store System V2 LinkIngame Store in Dialogs
SkyFlare is offline   Reply With Quote
Old 01/06/2020, 02:30 PM   #10
hopeonxanny
Huge Clucker
 
hopeonxanny's Avatar
 
Join Date: Apr 2020
Location: SA-MP Awesomeness: 1998
Posts: 238
Reputation: 4
Default Re: Const Correctness with Pawno Compiler version 3.10.10

Quote:
Originally Posted by SkyFlare View Post
Yeah, also getting warnings from other Includes too, I am guessing I have to correct the natives for all of these.
or just backup first and then update them with the latest ones.
__________________
hopeonxanny is offline   Reply With Quote
Reply

Thread Tools
Display Modes

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Zeex Compiler | new version = error 035: argument type mismatch KrYpToDeN Scripting Help 2 04/01/2019 03:22 AM
Pawno not compiler AlexPalermitano97 Server Support 8 23/08/2016 01:37 PM
Pawno compiler Vegas. Scripting Help 7 17/04/2013 07:12 PM
Pawno compiler bug jaami Help Archive 2 05/03/2011 04:02 AM
[Pawno Compiler] Unable to Execute the Compiler Fabio11 Client Support 6 26/09/2010 09:37 PM


All times are GMT. The time now is 08:21 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.