PInfo Problems
#1

OKay, I am just really stuck on this one...

I have been doing this tutorial, I've followed it step by step yet, I still get errors.

---------------------------------------------------------------------------

TUTORIAL:

https://sampforum.blast.hk/showthread.php?tid=174575

----------------------------------------------------------------------------

The only place I am getting errors, has to do with PInfo.

----------------------------------------------------------------------------

Here's the Code:

new PInfo[MAX_PLAYERS][gPInfo];

enum gPInfo
{
Logged,
Regged,
Level
};

----------------------------------------------------------------------------
More Code: (Here's where I get the errors)

public OnPlayerConnect(playerid)
{
PInfo[playerid][Logged] = 0;
PInfo[playerid][Regged] = 0;
PInfo[playerid][Level] = 0;
new n[MAX_PLAYER_NAME], file[256];
GetPlayerName(playerid,n,sizeof(n));
format(file,sizeof(file),"MyAdmin/Users/%s.txt",n);
if(dini_Exists(file))
{

----------------------------------------------------------------------------

Here's the Compiler Output:

C:\Users\SJC\Desktop\Mapping\GTARP\gamemodes\Admin Script.pwn(141) : error 017: undefined symbol "PInfo"
C:\Users\SJC\Desktop\Mapping\GTARP\gamemodes\Admin Script.pwn(141) : warning 215: expression has no effect
C:\Users\SJC\Desktop\Mapping\GTARP\gamemodes\Admin Script.pwn(141) : error 001: expected token: ";", but found "]"
C:\Users\SJC\Desktop\Mapping\GTARP\gamemodes\Admin Script.pwn(141) : error 029: invalid expression, assumed zero
C:\Users\SJC\Desktop\Mapping\GTARP\gamemodes\Admin Script.pwn(141) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


4 Errors.

-----------------------------------------------------------------------------

PROBLEMS:

1. Even though I have PInfo listed as a symbol, the compiler still says "Undefined Symbol"

2. It Tells me I need ";" instead of "]" on line 141. but I really don't see where it fits...

--------------------------------

I'm new to scripting, If you can tell..
Reply
#2

Try putting the enum above PInfo or better yet, use PVars.
Reply
#3

Like Backwardsman97 said put you new Pinfo under the enum (under closing enum bracket)
And about using PVars its good and bad idea

-Good
Its easy to use
-Bad
PVar is slower than enum
Reply
#4

Put new PInfo[MAX_PLAYERS][gPInfo]; after your enum
Reply
#5

Are PVars slower than enums? I read they were a hair slower than regular variables but better for memory. Enums are slower than regular variables though.
Reply
#6

Quote:
Originally Posted by Backwardsman97
Посмотреть сообщение
Are PVars slower than enums? I read they were a hair slower than regular variables but better for memory. Enums are slower than regular variables though.
Yeah, someone tested them and variables were abit quicker.
Reply
#7

A bit? nearly 15 times faster
Reply
#8

I put the PInfo new under the enum, but still get the same compiler outcome.
Reply
#9

Maybe an unclosed bracket.
Reply


Forum Jump:


Users browsing this thread: 6 Guest(s)