Raised This Month: $ Target: $400
 0% 

setting conditions for variables to be changed for each map


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Stealth Penguin
Junior Member
Join Date: Jan 2005
Old 02-20-2005 , 10:41   setting conditions for variables to be changed for each map
Reply With Quote #1

How would I go about making a variable that would hold the map name in it? I can't seem to get the condition right. If someone could tell me that would be very helpfull. Here is what I have so far:
get_mapname(mapname,32)
Code:
    get_mapname(mapname,32)     if ( mapname = "de_aztec")     {         copy(o1n, 33, "CT Spawn")         copy(o2n, 33, "T Spawn")         copy(o3n, 33, "Int Double Doors")         c0X=float(-3237)         c0Y=float(-1233)         c0Z=float(-171)         c1X=float(2448)         c1Y=float(277)         c1Z=float(-252)         c2X=float(-1113)         c2Y=float(-1584)         c2Z=float(-188)     }
Stealth Penguin is offline
Send a message via ICQ to Stealth Penguin Send a message via AIM to Stealth Penguin Send a message via Yahoo to Stealth Penguin
EKS
Veteran Member
Join Date: Mar 2004
Location: Norway
Old 02-20-2005 , 10:43  
Reply With Quote #2

use
if(equal(MyString,"de_aztec"))
__________________
Github archive for plugins, the repos for the other c++ projects are there to.
EKS is offline
BlueRaja
Senior Member
Join Date: Nov 2004
Old 02-20-2005 , 13:55  
Reply With Quote #3

Isn't there already a plugin to use different configuation files for different maps?
__________________
STEPS IN TROUBLESHOOTING <insert anything here>:
1. Narrow down the problem to a specific condition or conditions.
2. Fix it.
BlueRaja is offline
Send a message via AIM to BlueRaja Send a message via MSN to BlueRaja
XxAvalanchexX
Veteran Member
Join Date: Oct 2004
Location: abort73.com
Old 02-20-2005 , 14:52  
Reply With Quote #4

Firstly, you have to declare the variable. Secondly, the = operator sets a value, it doesn't compare a value. And thirdly, you can't use the == operator in Small to compare strings.

Oh, and fourthly, no need to use float(integer), just put it as a float in the first place.

Code:
new mapname[32] get_mapname(mapname,31) if (equali(mapname,"de_aztec")) {     copy(o1n, 33, "CT Spawn")     copy(o2n, 33, "T Spawn")     copy(o3n, 33, "Int Double Doors")     c0X=-3237.0     c0Y=-1233.0     c0Z=-171.0     c1X=2448.0     c1Y=277.0     c1Z=-252.0     c2X=-1113.0     c2Y=-1584.0     c2Z=-188.0 }
__________________
No longer around. Thanks your support, everyone! As always:
THIS ONES FOR YOU
3000 PTS
XxAvalanchexX is offline
Stealth Penguin
Junior Member
Join Date: Jan 2005
Old 02-20-2005 , 23:16  
Reply With Quote #5

Thank you very much
Stealth Penguin is offline
Send a message via ICQ to Stealth Penguin Send a message via AIM to Stealth Penguin Send a message via Yahoo to Stealth Penguin
Stealth Penguin
Junior Member
Join Date: Jan 2005
Old 02-20-2005 , 23:36  
Reply With Quote #6

hmm, when I tried to compile that it gave me these two errors:
/home/users/amxmodx/tmp/phpOjp12V.sma(39) : error 021: symbol already defined: "get_mapname"
/home/users/amxmodx/tmp/phpOjp12V.sma(40) : error 010: invalid function or declaration

Any ideas about what to do?
Stealth Penguin is offline
Send a message via ICQ to Stealth Penguin Send a message via AIM to Stealth Penguin Send a message via Yahoo to Stealth Penguin
XxAvalanchexX
Veteran Member
Join Date: Oct 2004
Location: abort73.com
Old 02-21-2005 , 00:18  
Reply With Quote #7

You didn't put it in a public function?
__________________
No longer around. Thanks your support, everyone! As always:
THIS ONES FOR YOU
3000 PTS
XxAvalanchexX is offline
Stealth Penguin
Junior Member
Join Date: Jan 2005
Old 02-21-2005 , 14:15  
Reply With Quote #8

Ah, that fixed part of the problem but its still giving me tag mismaches.
Stealth Penguin is offline
Send a message via ICQ to Stealth Penguin Send a message via AIM to Stealth Penguin Send a message via Yahoo to Stealth Penguin
Stealth Penguin
Junior Member
Join Date: Jan 2005
Old 02-21-2005 , 15:58  
Reply With Quote #9

oh man, I thought everything was going well here until I suddenly got 27 errors, now I'm stuck. Please tell me whats wrong with the last few menus towards the bottom?
Stealth Penguin is offline
Send a message via ICQ to Stealth Penguin Send a message via AIM to Stealth Penguin Send a message via Yahoo to Stealth Penguin
XxAvalanchexX
Veteran Member
Join Date: Oct 2004
Location: abort73.com
Old 02-21-2005 , 16:19  
Reply With Quote #10

Your tag mismatches comes from creating your c* variables as integers but assigning them as floats. You have to create them as Float:c* to make them a float.
__________________
No longer around. Thanks your support, everyone! As always:
THIS ONES FOR YOU
3000 PTS
XxAvalanchexX 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:15.


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