SA-MP Forums Archive
PInfo Problems - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: PInfo Problems (/showthread.php?tid=212820)



PInfo Problems - Stephen_Deville - 18.01.2011

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..


Re: PInfo Problems - Backwardsman97 - 18.01.2011

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


Re: PInfo Problems - DRIFT_HUNTER - 18.01.2011

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


Re: PInfo Problems - hoodline - 18.01.2011

Put new PInfo[MAX_PLAYERS][gPInfo]; after your enum


Re: PInfo Problems - Backwardsman97 - 18.01.2011

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.


Re: PInfo Problems - WillyP - 18.01.2011

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.


Re: PInfo Problems - Joe Staff - 18.01.2011

A bit? nearly 15 times faster


Re : PInfo Problems - Stephen_Deville - 18.01.2011

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


Re: PInfo Problems - Backwardsman97 - 19.01.2011

Maybe an unclosed bracket.