[Help] error 017: undefined symbol "PlayerInfo"
#1

Код:
public OnPlayerSpawn(playerid)
{
	// Anti F4 Bug - Logging/Registering
	if(!PlayerInfo[playerid][pLoggedIn])
	{
		SetPlayerPos(playerid, 1975.203002, 3779.311523, -50.243506);
		SetPlayerCameraPos(playerid, 1975.203002, 3779.311523, 100.243506);
		SetPlayerCameraLookAt(playerid, 1975.203002, 3779.311523, -0.243506);
	    SetSpawnInfo( playerid, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
	    new file[64];
		format(file, sizeof(file), "taikhoan/%s.ini", RPNU(playerid));
	    // Player isn't banned
		if(!dini_Exists(file))
		{
		    ShowDialog(playerid, 1);
		    return 1;
		}
		else
		{
			ShowDialog(playerid, 2);
		}
		return 1;
	}
I create Registering/Logging system but i'm stuck in this error.

Quote:

VNSLRP.pwn(159) : error 017: undefined symbol "PlayerInfo"
VNSLRP.pwn(159) : warning 215: expression has no effect
VNSLRP.pwn(159) : error 001: expected token: ";", but found "]"
VNSLRP.pwn(159) : error 029: invalid expression, assumed zero
VNSLRP.pwn(159) : fatal error 107: too many error messages on one line

Despite I have define PlayerInfo above but still error.

Код:
enum pInfo
{
	// Temp Values
	pLoggedIn,
	pSpawn,
	// Permanent Values
	pIP[16],
	pLevel,
	pMinutes,
	pHours,
	pGender,
	pAge,
	pAdmin,
	pBanned,
}
new PlayerInfo[MAX_PLAYERS][pInfo];
//I put this code below #define and #include
Reply
#2

as i can see on your code. im not sure if you can do that kind of way. but as i always do is like the same as normal variable.

Instead of
pawn Код:
if(!PlayerInfo[playerid][pLoggedIn])
Try something like this
pawn Код:
PlayerInfo[playerid][pLoggedIn] =1;  //put this on your login dialog
PlayerInfo[playerid][pLoggedIn] =0;  //put this on OnPlayerDisconnect

//to check if player is registed
if(PlayerInfo[playerid][pLoggedIn] == 1)
    return SendClientMessage(playerid, -1,"This Player Is Registered");
   
//to check if player is not registered
if(PlayerInfo[playerid][pLoggedIn] == 1)
    return SendClientMessage(playerid, -1,"This Player Is Not Registered");
Reply
#3

Try
Код:
if(!pInfo[playerid][pLoggedIn])
Reply
#4

Quote:
Originally Posted by *******12
Посмотреть сообщение
Try
Код:
if(!pInfo[playerid][pLoggedIn])
No you're wrong. because he uses PlayerInfo to define his enum. so if he does pInfo he need to change all of his PlayerInfo ---> pInfo
Reply
#5

pawn Код:
public OnPlayerSpawn(playerid)
{
    // Anti F4 Bug - Logging/Registering
    if(PlayerInfo[playerid][pLoggedIn] == 0)
    {
        SetPlayerPos(playerid, 1975.203002, 3779.311523, -50.243506);
        SetPlayerCameraPos(playerid, 1975.203002, 3779.311523, 100.243506);
        SetPlayerCameraLookAt(playerid, 1975.203002, 3779.311523, -0.243506);
        SetSpawnInfo( playerid, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
        new file[64];
        format(file, sizeof(file), "taikhoan/%s.ini", RPNU(playerid));
        // Player isn't banned
        if(!dini_Exists(file))
        {
            ShowDialog(playerid, 1);
            return 1;
        }
        else
        {
            ShowDialog(playerid, 2);
        }
        return 1;
    }
Try this.
Reply
#6

Quote:
Originally Posted by Denying
Посмотреть сообщение
pawn Код:
public OnPlayerSpawn(playerid)
{
    // Anti F4 Bug - Logging/Registering
    if(PlayerInfo[playerid][pLoggedIn] == 0)
    {
        SetPlayerPos(playerid, 1975.203002, 3779.311523, -50.243506);
        SetPlayerCameraPos(playerid, 1975.203002, 3779.311523, 100.243506);
        SetPlayerCameraLookAt(playerid, 1975.203002, 3779.311523, -0.243506);
        SetSpawnInfo( playerid, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
        new file[64];
        format(file, sizeof(file), "taikhoan/%s.ini", RPNU(playerid));
        // Player isn't banned
        if(!dini_Exists(file))
        {
            ShowDialog(playerid, 1);
            return 1;
        }
        else
        {
            ShowDialog(playerid, 2);
        }
        return 1;
    }
Try this.
still error

Quote:

VNSLRP.pwn(159) : error 017: undefined symbol "PlayerInfo"
VNSLRP.pwn(159) : warning 215: expression has no effect
VNSLRP.pwn(159) : error 001: expected token: ";", but found "]"
VNSLRP.pwn(159) : error 029: invalid expression, assumed zero
VNSLRP.pwn(159) : fatal error 107: too many error messages on one line

Reply
#7

Someone plz help me
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)