Raised This Month: $203 Target: $400
 50% 

Holding user's speed and gravity


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
EpicKiller
Senior Member
Join Date: Jun 2014
Location: Constanta, Romania
Old 04-14-2015 , 16:28   Holding user's speed and gravity
Reply With Quote #1

I need to hold user's speed and gravity in a variable, so I can set them back on CurWeapon or PreFrame or whatever. So I have two variables, Speed[33] and Gravity[33]. Then two menus, one to allow the user to select his desired speed and the other one for the gravity. But I can't seem to fill the indexed variable with the actual speed value. How could I? And could you please exemplify?
__________________
~ Swiftly and with style ~
EpicKiller is offline
Send a message via Yahoo to EpicKiller Send a message via Skype™ to EpicKiller
hornet
AMX Mod X Plugin Approver
Join Date: Mar 2010
Location: Australia
Old 04-14-2015 , 20:43   Re: Holding user's speed and gravity
Reply With Quote #2

Show the code you have tried and we'll go from there.
__________________
Quote:
vBulletin Tip #42: Not much would be accomplished by merging this item with itself.
hornet is offline
EpicKiller
Senior Member
Join Date: Jun 2014
Location: Constanta, Romania
Old 04-15-2015 , 02:23   Re: Holding user's speed and gravity
Reply With Quote #3

I have reproduced the relevant part of the plugin.
Spoiler


So every line that is trying to assign UserSpeed[id] or UserGravity[id] a value returns a tag mismatch. The lines in fCurWeapon, the ones trying to set user's values to the variable's value, returns the same. At first, I've tried filling the variable by copying, but I got the same warnings. I've tried making the two variables floats, in the hope of at least reducing the warning count by two, the two in fCurWeapon. So I'm clueless. What should I do?
__________________
~ Swiftly and with style ~
EpicKiller is offline
Send a message via Yahoo to EpicKiller Send a message via Skype™ to EpicKiller
Shiina.Mashiro
Senior Member
Join Date: Sep 2014
Location: Vietnam
Old 04-15-2015 , 05:02   Re: Holding user's speed and gravity
Reply With Quote #4

User speed and gravity is float value => you got a tag mismatch
Change array type to float then try again
__________________
Shiina.Mashiro is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 04-15-2015 , 06:14   Re: Holding user's speed and gravity
Reply With Quote #5

Pawn use a tag system, this mean that you must apply corect tag over a variable in order to tell the compiler what to expect from it.

As said, speed and gravity are float values + 0 is not a float value, 0.0 is.
__________________
HamletEagle is online now
EpicKiller
Senior Member
Join Date: Jun 2014
Location: Constanta, Romania
Old 04-15-2015 , 07:07   Re: Holding user's speed and gravity
Reply With Quote #6

Oh, I see. As mentioned, I tried making it a Float, but as I tried it for a different purpose, it left some warnings behind and I thought it's just not the way. Anyway, the concept of "tag" in Pawn was unclear to me 'till now, so now I've got it figured, I'll sure keep this kind of issues away. Thank you, guys!
__________________
~ Swiftly and with style ~
EpicKiller is offline
Send a message via Yahoo to EpicKiller Send a message via Skype™ to EpicKiller
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 04-15-2015 , 07:29   Re: Holding user's speed and gravity
Reply With Quote #7

It left some warnings because you made Variable[id] = 0, and this variables were float, so it should be 0.0
__________________
HamletEagle is online now
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

Forum Jump


All times are GMT -4. The time now is 12:04.


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