AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   How can I extend the list const BOOT[] (https://forums.alliedmods.net/showthread.php?t=135564)

CsIosefin 08-17-2010 13:13

How can I extend the list const BOOT[]
 
How do I read the entire line, I read only the first in line ... why? :cry:
Code:

#include <amxmodx>
#include <fakemeta>

new const BOOT[] = { "Name", "Name2" }

public plugin_init()
{
        set_task(2.0, "cmdBOOT")
}

public cmdBOOT()
{   
        new PLAYER = engfunc(EngFunc_CreateFakeClient, BOOT)

        if(pev_valid(PLAYER))
        {
                set_pev(PLAYER, pev_team, 3)
                dllfunc(DLLFunc_Think, PLAYER)
        }
}


RedRobster 08-17-2010 13:16

Re: How can I extend the list const BOOT[]
 
First of all, you have to have BOOT[][] = { } because you are using strings.

e.g.
PHP Code:

new const BOOT[][] = { "Name""Name2" 

In this example, BOOT[0] is the string "Name", and BOOT[1] is the string "Name2". BOOT[0][1] is "N" and BOOT[1][1] is "N" as well.

For the rest of it, I am not sure what you are trying to do.

CsIosefin 08-17-2010 13:24

Re: How can I extend the list const BOOT[]
 
From what I read only the first name?
Code:

#include <amxmodx>
#include <fakemeta>

new const BOOT[2][] = { "Name", "Name2" }

public plugin_init()
{
        set_task(2.0, "cmdBOOT")
}

public cmdBOOT()
{   
        new JUCATOR = engfunc(EngFunc_CreateFakeClient, BOOT)

        if(pev_valid(JUCATOR))
        {
                set_pev(JUCATOR, pev_team, 3)
                dllfunc(DLLFunc_Think, JUCATOR)
        }
}


Bugsy 08-17-2010 13:41

Re: How can I extend the list const BOOT[]
 
I don't understand what you're asking.

Use BOOT[ 0 I to reference the first name and BOOT[ 1 ] for second...as Red Robster said.

CsIosefin 08-17-2010 13:49

Re: How can I extend the list const BOOT[]
 
I am from Romania, can not speak English as you who have an English language.
We put the BOOT[2], but I still can not read both names, but first ...

Hunter-Digital 08-17-2010 15:57

Re: How can I extend the list const BOOT[]
 
Bugsy clearly told you that [1] is the second because the count starts from zero, [0].
Read the pawn tutorial on strings to fully understand what they are and next you could read the whole document.

Also, there are alot of people who can speak english even if it's not their natal language, you just need to learn it.


All times are GMT -4. The time now is 21:56.

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