Problem script
#1

At the beginning of the script
pawn Code:
new NOUJ[32];

At OnGamemodeInit
pawn Code:
public OnGameModeInit()
if(fexist("NOUJ.cfg"))
{
    NOUJ = dini_Int("NOUJ.cfg", "Connections");
    printf("file \"NOUJ.txt\" located, variable NOUJ loaded (%s visitors)", NOUJ);
}

On enter text in TextDraw
pawn Code:
forward text(playerid);
public text(playerid)
{
    // same thing, so they won't see too much different.
    format(textdrawstring,sizeof(textdrawstring),"~w~Newest Account:~y~%s", NOUJ);
    TextDrawSetString(Textdraw2, textdrawstring);
}

At compile receive message as NOUJ be indexed (OnGamemodeInit). What do i do?
Reply
#2

Show us the error I don't understand.
Reply
#3

pawn Code:
C:\Documents and Settings\JohnnyDesktop\wdrp8.pwn(9180) : error 033: array must be indexed (variable "NOUJ")
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


1 Error.
This error is from OnGamemodeInit
pawn Code:
NOUJ = dini_Int("NOUJ.cfg", "Connections");
Reply
#4

You're using a string for a file and it is not indexed at the rest of your codes, i'm pretty sure it's not gonna work like that.
Reply
#5

You can use this:
pawn Code:
NOUJ[31] = dini_Int("NOUJ.cfg", "Connections");
It gives an error if you use 32, im not sure why.
Reply
#6

Quote:
Originally Posted by CalvinC
View Post
You can use this:
pawn Code:
NOUJ[31] = dini_Int("NOUJ.cfg", "Connections");
It gives an error if you use 32, im not sure why.
Now I no longer give error but I do not show when I enter the text from the file playing.
Reply
#7

Change string
pawn Code:
new NOUJ[32];
to int
pawn Code:
new NOUJ;
because seems you don't need a string.

also change at OnGameModeInit and text(playerid) from %s to %d because %s is for strings and %d for int.


BTW, stop asking for help in PM
Reply
#8

Quote:
Originally Posted by Raul_Ro
View Post
Change string
pawn Code:
new NOUJ[32];
to int
pawn Code:
new NOUJ;
because seems you don't need a string.

also change at OnGameModeInit and text(playerid) from %s to %d because %s is for strings and %d for int.


BTW, stop asking for help in PM
Now comes the number 0, not the text should show it.
Reply
#9

Someone can help me?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)