equali & or
hi
Code:
what is wrong about this code? |
Code:
|
the server says:
Code:
changelevel failed: 'de_' not found on serverCode:
|
Or, to stay consistent with what you were doing originally...
Code:
|
@atambo
your code will also print the echo if map name is: "dust_de_italy" to check for first chars: Code:
if (equali(mapname,"cs_",3) || equali(mapname,"de_",3) || equali(mapname,"as_",3) )get_mapname(mapname2,3) : will get the first 3 chars of a mapname but have you ever seen a map called "de_" no its rather "de_dust" so: Code:
new mapname[33]why you want to get mapname and change to that map ? it is like the command : "restart" |
Your code doesn't work because you're creating the mapname variable with a length of 4. Try 32.
Presumably you have other problems too as you have mapname and mapname2 being used in this code snippet. |
thank you guys! now it getting all clearer for me!
|
get_mapname returns the number of characters that you tell it to. If you tell it to get 3 characters, it will. You don't have to get all of it and limit the checking in equali.
|
For those who don't know:
Code:
Code:
|
No they aren't. The first could find "cs_" anywhere in the map name where as the second will only find it if the map name starts with "cs_". That's a big difference.
Totally made up map name: de_tics_assault containi would erroneously think this is a "cs" map while equali would correctly identify it. |
| All times are GMT -4. The time now is 15:46. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.