Raised This Month: $ Target: $400
 0% 

How can I extend the list const BOOT[]


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
CsIosefin
Senior Member
Join Date: Aug 2009
Old 08-17-2010 , 13:13   How can I extend the list const BOOT[]
Reply With Quote #1

How do I read the entire line, I read only the first in line ... why?
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)
	}
}
CsIosefin is offline
RedRobster
Veteran Member
Join Date: Apr 2010
Location: Your Closet
Old 08-17-2010 , 13:16   Re: How can I extend the list const BOOT[]
Reply With Quote #2

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.
RedRobster is offline
CsIosefin
Senior Member
Join Date: Aug 2009
Old 08-17-2010 , 13:24   Re: How can I extend the list const BOOT[]
Reply With Quote #3

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)
	}
}
CsIosefin is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 08-17-2010 , 13:41   Re: How can I extend the list const BOOT[]
Reply With Quote #4

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.
__________________
Bugsy is offline
CsIosefin
Senior Member
Join Date: Aug 2009
Old 08-17-2010 , 13:49   Re: How can I extend the list const BOOT[]
Reply With Quote #5

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 ...
CsIosefin is offline
Hunter-Digital
Veteran Member
Join Date: Aug 2006
Location: In the Game [ro]
Old 08-17-2010 , 15:57   Re: How can I extend the list const BOOT[]
Reply With Quote #6

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.
__________________
Hunter-Digital 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 21:56.


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