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

[CS:GO] Function with 2 Vars


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Screeaam..
Senior Member
Join Date: Jun 2010
Location: Poland
Old 03-05-2015 , 19:35   [CS:GO] Function with 2 Vars
Reply With Quote #1

I need make something like:

When VariableA have value 10, 20, 30, 40, 50 etc VariableB value will be 1 ,2 , 3, 4, 5 etc.

For example:
When VariableA has value = 34, VariableB will have value 3.
When VariableA has value = 68, VariableB will have value 6.

How to do this? VariableA can have max value 300.

Last edited by Screeaam..; 03-05-2015 at 19:36.
Screeaam.. is offline
WildCard65
Veteran Member
Join Date: Aug 2013
Location: Canada
Old 03-05-2015 , 19:40   Re: [CS:GO] Function with 2 Vars
Reply With Quote #2

PHP Code:
int vA GetRandomInt(0300);
int vB vA 10//Should truncate since it's storing into an int. 
Note, requires SM 1.7 to compile the snippet
__________________

Last edited by WildCard65; 03-05-2015 at 20:00.
WildCard65 is offline
splewis
Veteran Member
Join Date: Feb 2014
Location: United States
Old 03-05-2015 , 19:49   Re: [CS:GO] Function with 2 Vars
Reply With Quote #3

I'm think he's asking how to divide by 10 and truncate the result.

Pretty sure that happens automatically in sourcepawn anyway (like almost every other language).
__________________

Last edited by splewis; 03-05-2015 at 19:50.
splewis is offline
WildCard65
Veteran Member
Join Date: Aug 2013
Location: Canada
Old 03-05-2015 , 20:00   Re: [CS:GO] Function with 2 Vars
Reply With Quote #4

Quote:
Originally Posted by splewis View Post
I'm think he's asking how to divide by 10 and truncate the result.

Pretty sure that happens automatically in sourcepawn anyway (like almost every other language).
Updated my snippet
__________________
WildCard65 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 14:04.


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