Server Crashes When I Type Login [password]
#1

Here are the Errors

Код:
C:\Documents and Settings\Chris\My Documents\HayZaticFreeRoam\filterscripts\HZadmin1.pwn(101) : error 017: undefined symbol "PlayerInfo"
C:\Documents and Settings\Chris\My Documents\HayZaticFreeRoam\filterscripts\HZadmin1.pwn(101) : warning 215: expression has no effect
C:\Documents and Settings\Chris\My Documents\HayZaticFreeRoam\filterscripts\HZadmin1.pwn(101) : error 001: expected token: ";", but found "]"
C:\Documents and Settings\Chris\My Documents\HayZaticFreeRoam\filterscripts\HZadmin1.pwn(101) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Chris\My Documents\HayZaticFreeRoam\filterscripts\HZadmin1.pwn(101) : fatal error 107: too many error messages on one line

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


4 Errors.
Here Is The Code

Код:
public OnPlayerDisconnect(playerid, reason)
{
    new name[MAX_PLAYER_NAME], file[256];
    GetPlayerName(playerid, name, sizeof(name));
    format(file, sizeof(file), SERVER_USER_FILE, name);
    if(gPlayerLogged[playerid] == 1)
    {
        dini_IntSet(file, "Score", PlayerInfo[playerid][pScore]);
        dini_IntSet(file, "Money", PlayerInfo[playerid][pCash]);
        dini_IntSet(file, "AdminLevel",PlayerInfo[playerid][pAdminLevel]);
    }
    gPlayerLogged[playerid] = 0;
    }
	return 1;
}
Reply
#2

Have you placed the necessary folders in the /scriptfiles directory?
Reply
#3

Of Course
Reply
#4

Post Edited* New Problem
Reply
#5

Suggestion, paste your login code and indicate line 101.
Reply
#6

1. At the end of the first line put a ";"
2. Make sure PlayerInfo is defined at the top of the script.
Reply
#7

Quote:
Originally Posted by Tee
Посмотреть сообщение
Suggestion, paste your login code and indicate line 101.
Line 101 is

Код:
dini_IntSet(file, "Score", PlayerInfo[playerid][pScore]);
Login
Код:
public OnPlayerConnect(playerid)
{
    gPlayerLogged[playerid] = 0;
    new name[MAX_PLAYER_NAME], file[256];
    GetPlayerName(playerid, name, sizeof(name));
    format(file, sizeof(file), SERVER_USER_FILE, name);
    if (!dini_Exists(file))
    {
        ShowPlayerDialog(playerid, 1, DIALOG_STYLE_INPUT, "Hi your not registered", "Welcome, your not registered mate, input your registration pw below", "Register", "Leave");
    }
    if(fexist(file))
    {
        ShowPlayerDialog(playerid, 2, DIALOG_STYLE_INPUT, "Hi your registered", "Fucken awesome mate, your registered :D. Inpute your pw below", "Login", "Leave");
    }
	return 1;
}
Quote:
Originally Posted by Too
Посмотреть сообщение
1. At the end of the first line put a ";"
2. Make sure PlayerInfo is defined at the top of the script.
There is already a ;
Reply
#8

Looks as if you forgot to define:
pawn Код:
new PlayerInfo[MAX_PLAYERS][gPlayerInfo];
Just add this uptop your script and it should work.
Reply
#9

Quote:
Originally Posted by HydraX
Посмотреть сообщение
Looks as if you forgot to define:
pawn Код:
new PlayerInfo[MAX_PLAYERS][gPlayerInfo];
Just add this uptop your script and it should work.
I Just Get Different Errors But Now I Got 2 And One Of Them Is Because Of The Code!

Код:
C:\Documents and Settings\Chris\My Documents\HayZaticFreeRoam\filterscripts\HZadmin1.pwn(21) : error 009: invalid array size (negative, zero or out of bounds)
C:\Documents and Settings\Chris\My Documents\HayZaticFreeRoam\filterscripts\HZadmin1.pwn(108) : error 010: invalid function or declaration
Код:
#include <a_samp>
#include <dini>
#include <Zcmd>
#include <dudb>
#pragma unused ret_memcpy
#define dcmd(%1,%2,%3) if (!strcmp((%3)[1], #%1, true, (%2)) && ((((%3)[(%2) + 1] == '\0') && (dcmd_%1(playerid, ""))) || (((%3)[(%2) + 1] == ' ') && (dcmd_%1(playerid, (%3)[(%2) + 2]))))) return 1
#define FILTERSCRIPT
#define GREY 0xAFAFAFAA
#define GREEN 0x33AA33AA
#define COLOR_YELLOW 0xFFFF00AA
#define COLOR_RED 0xE60000FF
#define WHITE 0xFFFFFFAA
#define LIGHTBLUE 0x33CCFFAA
#define ORANGE 0xFF9900AA
#define gPlayerInfo
#if defined FILTERSCRIPT
new PlayerInfo[MAX_PLAYERS][gPlayerInfo];//This Here is Line 21

enum gPInfo
{
    Logged,
    Regged,
    Level,
    pAdminLevel,
    pCash,
    pScore,
};
new PInfo[MAX_PLAYERS][gPInfo];
new gPlayerLogged[MAX_PLAYERS];
#define SERVER_USER_FILE "HZad
And

Код:
public OnPlayerDisconnect(playerid, reason)
{
    new name[MAX_PLAYER_NAME], file[256];
    GetPlayerName(playerid, name, sizeof(name));
    format(file, sizeof(file), SERVER_USER_FILE, name);
    if(gPlayerLogged[playerid] == 1)
    {
        dini_IntSet(file, "Score", PlayerInfo[playerid][pScore]);
        dini_IntSet(file, "Money", PlayerInfo[playerid][pCash]);
        dini_IntSet(file, "AdminLevel",PlayerInfo[playerid][pAdminLevel]);
    }
    gPlayerLogged[playerid] = 0;
    }
	return 1;//This is Line 108
}
}
Reply
#10

Compare your code with the one I have below.

pawn Код:
#include <a_samp>
#include <dini>
#include <Zcmd>
#include <dudb>
#pragma unused ret_memcpy
#define dcmd(%1,%2,%3) if (!strcmp((%3)[1], #%1, true, (%2)) && ((((%3)[(%2) + 1] == '\0') && (dcmd_%1(playerid, ""))) || (((%3)[(%2) + 1] == ' ') && (dcmd_%1(playerid, (%3)[(%2) + 2]))))) return 1
#define FILTERSCRIPT
#define GREY 0xAFAFAFAA
#define GREEN 0x33AA33AA
#define COLOR_YELLOW 0xFFFF00AA
#define COLOR_RED 0xE60000FF
#define WHITE 0xFFFFFFAA
#define LIGHTBLUE 0x33CCFFAA
#define ORANGE 0xFF9900AA
#define gPlayerInfo
#if defined FILTERSCRIPT
new PlayerInfo[MAX_PLAYERS][gPlayerInfo];//This Here is Line 21

enum gPInfo
{
    Logged,
    Regged,
    Level,
    pAdminLevel,
    pCash,
    pScore,
};
new PInfo[MAX_PLAYERS][gPInfo];
new gPlayerLogged[MAX_PLAYERS];
#define SERVER_USER_FILE "HZad" >>>>>>//You did not have a closing quotation mark "HZad".<<<<< (Remove this when you are ready to compile it)
pawn Код:
public OnPlayerDisconnect(playerid, reason)
{
    new name[MAX_PLAYER_NAME], file[256];
    GetPlayerName(playerid, name, sizeof(name));
    format(file, sizeof(file), SERVER_USER_FILE, name);
    if(gPlayerLogged[playerid] == 1)
    {
        dini_IntSet(file, "Score", PlayerInfo[playerid][pScore]);
        dini_IntSet(file, "Money", PlayerInfo[playerid][pCash]);
        dini_IntSet(file, "AdminLevel",PlayerInfo[playerid][pAdminLevel]);
    }
    gPlayerLogged[playerid] = 0;
    // You had a bracket here. It should not be.
    return 1;//This is Line 108
}
// You had a bracket here. It should not be.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)