Raised This Month: $ Target: $400
 0% 

How can I fix it?


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 10-22-2014 , 19:54   Re: How can I fix it?
Reply With Quote #5

Quote:
Originally Posted by Jhob94 View Post
new allow_maps[][][] = {
{ "hd_harlem", "Hidden City" },
{ "de_dust2", "Dust2" }
}

Try:

new allow_maps[][][] = {
{ "", "" },
{ "hd_harlem", "Hidden City" },
{ "de_dust2", "Dust2" }
}

Because the first line is 0 andyour first index is 1. Thats the problem i guess
No. That is wrong.

Quote:
Originally Posted by csaba1998 View Post
This works perfectly, when the map is hd_harlem.
But I change map to de_dust2, don't work.

Code:
new allow_maps[][][] = {
	{ "hd_harlem", "Hidden City" },  
        { "de_dust2",  "Dust2"       }       
}

public plugin_init()
{
        register_dictionary(DICTIONARY)

        new map_name[32], buffer[128], index
	get_mapname(map_name, 31)

        for(index=0;index<sizeof(allow_maps);index++)
	{
		if(equali(map_name, allow_maps[index][0]))
                {
                        Patch_MapName(allow_maps[index][1])
                        break
                }

                else
                {
                        formatex(buffer, sizeof(buffer), "%L", LANG_SERVER, "HIDDEN_WRONG_MAP")
			set_fail_state(buffer)
                        return
                }
               
	}
}
Take a second to run through the execution of the code in your head. What happens when the map is de_dust2 and the for loop starts? What happens (especially when it checks to see if the map is hd_harlem)?
__________________

Last edited by fysiks; 10-22-2014 at 20:01.
fysiks is offline
 



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 17:44.


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