AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   [SOLVED] Function for new map[ 32 ] ?! (https://forums.alliedmods.net/showthread.php?t=105626)

KadiR 10-06-2009 13:47

[SOLVED] Function for new map[ 32 ] ?!
 
What does really the function:

PHP Code:

new map32 

and what does the '' 32 '' mean ? :wink:

Arkshine 10-06-2009 13:56

Re: Function for new map[ 32 ] ?!
 
It's not a function. You declare and initialize a variable named "map". It creates an array of 32 cells. An array index start to 0. eg: if you save the string "de_dust2" in this variable, map will contain the string like that :

0 : d
1 : e
2 : _
3 : d
4 : u
5 : s
6 : t
7 : 2
etc..

I'm bad to explain, see this tuto : http://forums.alliedmods.net/showthread.php?t=94381

xPaw 10-06-2009 14:00

Re: Function for new map[ 32 ] ?!
 
Variable, string.

Alucard^ 10-06-2009 14:04

Re: Function for new map[ 32 ] ?!
 
And this is good to:

http://forums.alliedmods.net/showthr...=block+numbers

KadiR 10-06-2009 14:08

Re: Function for new map[ 32 ] ?!
 
ah, thanks now I understand it :)

I wanted to run the plugin only on that map and added this after register_plugin:

PHP Code:

    new map10 ];
    
get_mapnamemapcharsmaxmap ) );
    
    if( 
equalmap"surf_ski_2" ) )
    { 

but it says every time:

Quote:

Error: Expected token: "}", but found "-end of file-"

xPaw 10-06-2009 14:12

Re: Function for new map[ 32 ] ?!
 
More code ..

Also make array size to 1 char more (11), overthise it wont run the code in that if()

KadiR 10-06-2009 14:35

Re: Function for new map[ 32 ] ?!
 
solved, thanks :)

I forgot to add another }

Arkshine 10-06-2009 14:44

Re: [SOLVED] Function for new map[ 32 ] ?!
 
You should really to take a look at the tutos section. ;)

One 10-07-2009 07:25

Re: [SOLVED] Function for new map[ 32 ] ?!
 
:)) he forgot to add an }

he had :

Code:


public plugin_init
{
code
new map bla bla
 
while
{
}
if{
}
 
}

somthing like this :P


All times are GMT -4. The time now is 22:38.

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