Small Login/Register Issue
#1

Hey,
Well im trying to make a login/register dialog appear in OnPlayerRequestSpawn.

This is what I have:
pawn Код:
public OnPlayerRequestSpawn(playerid)
{
    foreach (Player, i)
    {
        Itter_Random(Player, i)
        TogglePlayerSpectating(playerid, 1);
        PlayerSpectatePlayer(playerid, i);
        PlayerInfo[playerid][pSQLId] = INVALID_SQL_ID;
        FindPlayerSQL(playerid);
        if(PlayerInfo[playerid][pSQLId] > INVALID_SQL_ID)
        {
            gPlayerAccount[playerid] = 1;
            ShowLoginDialog(playerid);
        }
        else
        {
            gPlayerAccount[playerid] = 0;
            ShowRegDialog(playerid);
        }
        return 1;
 }
Now I get this error :
Код:
C:\Program Files\Rockstar Games\samp03asvr_R2_win32\gamemodes\SGGWls.pwn(856) : error 017: undefined symbol "YSI_gPlayer"
Anyone know wtf this means?
Reply
#2

You're missing a bracket, maybe that could be the problem.
Reply
#3

Where?
Reply
#4

Quote:
Originally Posted by jamesb93
Where?
You need to close the "foreach"-thing.
Reply
#5

pawn Код:
public OnPlayerRequestSpawn(playerid)
{
    foreach (Player, i)
    {
        Itter_Random(Player, i)
        TogglePlayerSpectating(playerid, 1);
        PlayerSpectatePlayer(playerid, i);
        PlayerInfo[playerid][pSQLId] = INVALID_SQL_ID;
        FindPlayerSQL(playerid);
        if(PlayerInfo[playerid][pSQLId] > INVALID_SQL_ID)
        {
            gPlayerAccount[playerid] = 1;
            ShowLoginDialog(playerid);
        }
        else
        {
            gPlayerAccount[playerid] = 0;
            ShowRegDialog(playerid);
        }
    }
}
I tried this and it fails
Reply
#6

Quote:
Originally Posted by J@mEs
pawn Код:
public OnPlayerRequestSpawn(playerid)
{
    foreach (Player, i)
    {
        Itter_Random(Player, i)
        TogglePlayerSpectating(playerid, 1);
        PlayerSpectatePlayer(playerid, i);
        PlayerInfo[playerid][pSQLId] = INVALID_SQL_ID;
        FindPlayerSQL(playerid);
        if(PlayerInfo[playerid][pSQLId] > INVALID_SQL_ID)
        {
            gPlayerAccount[playerid] = 1;
            ShowLoginDialog(playerid);
        }
        else
        {
            gPlayerAccount[playerid] = 0;
            ShowRegDialog(playerid);
        }
    }
}
I tried this and it fails
In what does it exacly fail? gimme errors.
Reply
#7

Here:

Код:
C:\Program Files\Rockstar Games\samp03asvr_R2_win32\gamemodes\SGGWls.pwn(856) : error 017: undefined symbol "YSI_gPlayer"
C:\Program Files\Rockstar Games\samp03asvr_R2_win32\gamemodes\SGGWls.pwn(874) : error 010: invalid function or declaration
C:\Program Files\Rockstar Games\samp03asvr_R2_win32\gamemodes\SGGWls.pwn(876) : error 010: invalid function or declaration
C:\Program Files\Rockstar Games\samp03asvr_R2_win32\gamemodes\SGGWls.pwn(879) : error 010: invalid function or declaration
C:\Program Files\Rockstar Games\samp03asvr_R2_win32\gamemodes\SGGWls.pwn(881) : error 010: invalid function or declaration
C:\Program Files\Rockstar Games\samp03asvr_R2_win32\gamemodes\SGGWls.pwn(883) : error 010: invalid function or declaration
C:\Program Files\Rockstar Games\samp03asvr_R2_win32\gamemodes\SGGWls.pwn(885) : error 010: invalid function or declaration
C:\Program Files\Rockstar Games\samp03asvr_R2_win32\gamemodes\SGGWls.pwn(888) : error 010: invalid function or declaration
C:\Program Files\Rockstar Games\samp03asvr_R2_win32\gamemodes\SGGWls.pwn(890) : error 010: invalid function or declaration
C:\Program Files\Rockstar Games\samp03asvr_R2_win32\gamemodes\SGGWls.pwn(892) : error 010: invalid function or declaration
C:\Program Files\Rockstar Games\samp03asvr_R2_win32\gamemodes\SGGWls.pwn(894) : error 010: invalid function or declaration
C:\Program Files\Rockstar Games\samp03asvr_R2_win32\gamemodes\SGGWls.pwn(897) : error 010: invalid function or declaration
C:\Program Files\Rockstar Games\samp03asvr_R2_win32\gamemodes\SGGWls.pwn(899) : error 010: invalid function or declaration
C:\Program Files\Rockstar Games\samp03asvr_R2_win32\gamemodes\SGGWls.pwn(902) : error 010: invalid function or declaration
C:\Program Files\Rockstar Games\samp03asvr_R2_win32\gamemodes\SGGWls.pwn(904) : error 010: invalid function or declaration
C:\Program Files\Rockstar Games\samp03asvr_R2_win32\gamemodes\SGGWls.pwn(906) : error 010: invalid function or declaration
C:\Program Files\Rockstar Games\samp03asvr_R2_win32\gamemodes\SGGWls.pwn(908) : error 010: invalid function or declaration
C:\Program Files\Rockstar Games\samp03asvr_R2_win32\gamemodes\SGGWls.pwn(911) : error 010: invalid function or declaration
C:\Program Files\Rockstar Games\samp03asvr_R2_win32\gamemodes\SGGWls.pwn(913) : error 010: invalid function or declaration
C:\Program Files\Rockstar Games\samp03asvr_R2_win32\gamemodes\SGGWls.pwn(916) : error 010: invalid function or declaration
C:\Program Files\Rockstar Games\samp03asvr_R2_win32\gamemodes\SGGWls.pwn(918) : error 010: invalid function or declaration
C:\Program Files\Rockstar Games\samp03asvr_R2_win32\gamemodes\SGGWls.pwn(920) : error 010: invalid function or declaration
C:\Program Files\Rockstar Games\samp03asvr_R2_win32\gamemodes\SGGWls.pwn(922) : error 010: invalid function or declaration
C:\Program Files\Rockstar Games\samp03asvr_R2_win32\gamemodes\SGGWls.pwn(925) : error 010: invalid function or declaration
C:\Program Files\Rockstar Games\samp03asvr_R2_win32\gamemodes\SGGWls.pwn(927) : error 010: invalid function or declaration
C:\Program Files\Rockstar Games\samp03asvr_R2_win32\gamemodes\SGGWls.pwn(930) : error 010: invalid function or declaration

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


26 Errors.
26 Ussually means bracket problems
Reply
#8

Post lines 850 to 935 pls...

Btw. That are 26 errors in number! The most errors have code 010 and one code 017.
Reply
#9

Whole on player req spawn

pawn Код:
public OnPlayerRequestSpawn(playerid)
{
    foreach (Player, i)
    {
        Itter_Random(Player, i)
        TogglePlayerSpectating(playerid, 1);
        PlayerSpectatePlayer(playerid, i);
        PlayerInfo[playerid][pSQLId] = INVALID_SQL_ID;
        FindPlayerSQL(playerid);
        if(PlayerInfo[playerid][pSQLId] > INVALID_SQL_ID)
        {
            gPlayerAccount[playerid] = 1;
            ShowLoginDialog(playerid);
        }
        else
        {
            gPlayerAccount[playerid] = 0;
            ShowRegDialog(playerid);
        }
    }
}
   
    if(Classid[playerid] == 0 || Classid[playerid] == 1 || Classid[playerid] == 2 || Classid[playerid] == 3 || Classid[playerid] == 4)
    {
      if(TeamGrove > TeamLSPD && GroveTeam[playerid] == 0)
      {
            SendClientMessage(playerid,COLOR_RED, "[SYSTEM] In order to balance the teams, You Must Choose The LSPD");
            return 0;
        }
    return 1;
    }
    if(Classid[playerid] == 5 || Classid[playerid] == 6 || Classid[playerid] == 7 || Classid[playerid] == 8 || Classid[playerid] == 9 || Classid[playerid] == 10)
    {
        if(TeamLSPD > TeamGrove && LSPDTeam[playerid] == 0)
        {
            SendClientMessage(playerid,COLOR_RED, "[SYSTEM] In order to balance the teams, You Must Choose The Grove Street");
            return 0;
        }
    return 1;
    }
    if(Classid[playerid] == 3)
    {
      if(PlayerInfo[playerid][pPremium] < 1)
      {
        SendClientMessage(playerid, COLOR_RED, " You are not a Silver Or Gold Member. you cannot select this class");
            return 0;
        }
      if(PlayerInfo[playerid][pPremium] >= 1)
      {
        SpawnPlayer(playerid);
            return 1;
        }
    return 1;
    }
    if(Classid[playerid] == 4)
    {
      if(PlayerInfo[playerid][pPremium] < 2)
      {
        SendClientMessage(playerid, COLOR_RED, " You are not a Gold Member. you cannot select this class");
            return 0;
        }
      if(PlayerInfo[playerid][pPremium] >= 2)
      {
        SpawnPlayer(playerid);
        return 1;
        }
        return 1;
    }
    if(Classid[playerid] == 9)
    {
      if(PlayerInfo[playerid][pPremium] < 1)
      {
        SendClientMessage(playerid, COLOR_RED, " You are not a Silver or Gold Premium member. you cannot select this class");
        return 0;
        }
      if(PlayerInfo[playerid][pPremium] >= 1)
      {
        SpawnPlayer(playerid);
        return 1;
        }
        return 1;
    }
    if(Classid[playerid] == 10)
    {
      if(PlayerInfo[playerid][pPremium] < 2)
      {
        SendClientMessage(playerid, COLOR_RED, " You are not a Gold Premium member. you cannot select this class");
        return 0;
        }
      if(PlayerInfo[playerid][pPremium] >= 2)
      {
        SpawnPlayer(playerid);
        return 1;
        }
        return 1;
    }
    return 1;
}
Reply
#10

Dude
Did you define symbol "YSI_gPlayer"?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)