Jump to content
  • 0

pomoc Pomoc se 4 errory 1 warningem na řádku


Andreyyy

Dotaz

Zdravím, dělám do svého módu Login + Register systém. Jelikož se pawno pomalu učím, tak to dělám podle tutoriálů co se týče velkých věcí. No, dnes jsem si našel na SAMP fóru jeden tutorial. Vše jsem dělal podle tutoriálu a píše mi to 4 errory a 1 warning na jednom řádku :d Věděli by jste mi prosím pomoct s tímto problémem?

 

Oblast kódu:

public OnPlayerConnect(playerid)
{
    GetPlayerName(playerid, gPlayerName[playerid], MAX_PLAYER_NAME);  //Na tomto řádku ukazuje errory
    if (fexist(getINI(playerid)))
    {
        ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT,""WHITE"Login",""WHITE"Type your password below to login.","Login","Quit");
    }
    else
    {
        ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT,""WHITE"Registering...",""WHITE"Type your password below to register a new account.","Register","Quit");
    }
    return 1;
}

Errory:

C:\Users\pc\Desktop\STUNT MOD.pwn(93) : error 017: undefined symbol "gPlayerName"
C:\Users\pc\Desktop\STUNT MOD.pwn(93) : warning 215: expression has no effect
C:\Users\pc\Desktop\STUNT MOD.pwn(93) : error 001: expected token: ";", but found "]"
C:\Users\pc\Desktop\STUNT MOD.pwn(93) : error 029: invalid expression, assumed zero
C:\Users\pc\Desktop\STUNT MOD.pwn(93) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright (c) 1997-2006, ITB CompuPhase


4 Errors.

Jak ukazuje ten první error, tak mám nahoře:

new gPlayerName[MAX_PLAYERS][MAX_PLAYER_NAME];

Stejně jako je v tutoriálu. Děkuji za každou pomoc :)

Link to comment
Share on other sites

10 odpovědí na tuto otázku

Recommended Posts

  • 0
  • Administrátor

new gPlayerName[MAX_PLAYERS][MAX_PLAYER_NAME]; smaž

a nad

 

 

GetPlayerName(playerid, gPlayerName[playerid], MAX_PLAYER_NAME); //Na tomto řádku ukazuje errory
if (fexist(getINI(playerid)))
{
 
dej
new gPlayerName[21];
a z 
GetPlayerName(playerid, gPlayerName[playerid], 
smaž  resp udělej
GetPlayerName(playerid, gPlayerName, 
Link to comment
Share on other sites

  • 0

 

new gPlayerName[MAX_PLAYERS][MAX_PLAYER_NAME]; smaž

a nad

 

 

GetPlayerName(playerid, gPlayerName[playerid], MAX_PLAYER_NAME); //Na tomto řádku ukazuje errory

if (fexist(getINI(playerid)))

{

 
dej
new gPlayerName[21];
a z 
GetPlayerName(playerid, gPlayerName[playerid],
smaž  resp udělej
GetPlayerName(playerid, gPlayerName,

 

Třeba ale pro nějaké účely potřebuje ukládat jména všech hráčů na serveru. Šlo by to udělat i jinak, než takto, ale přece jen pro začátečníka je toto nejschůdnější cesta. Pokud to ale nepotřebuje, tak je tohle tutovka.

Link to comment
Share on other sites

  • 0

Mám to pod definicemi, no spíše tohle mám pod definicemi:

enum pInfo
{
    pPass,
    pScore,
    pCash,
    pAdmin
}
new PlayerInfo[MAX_PLAYERS][pInfo];

a hned pod tím

new gPlayerName[MAX_PLAYERS][MAX_PLAYER_NAME];

 

Jinak, potřebuji aby se ty účty ukládali :)

Link to comment
Share on other sites

  • 0
public OnPlayerConnect(playerid)
{
    new gPlayerName[21];
    GetPlayerName(playerid, gPlayerName, MAX_PLAYER_NAME);
    if (fexist(getINI(playerid))) //TU UKAŽE ERROR
    {
   	    ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT,""WHITE"Login",""WHITE"Type your password below to login." ,"Login","Quit"); //TU UKAŽE ERROR + WARNING
    }
    else
    {
        ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT,""WHITE"Registering...",""WHITE"Type your password below to register a new account.","Register","Quit");
    }
    return 1;
}

Takhle to mám upravit? Protože když to tam upravím tak mi to ukáže ještě errory ale na jiných místech

C:\Users\pc\Desktop\STUNT MOD.pwn(94) : error 017: undefined symbol "getINI"
C:\Users\pc\Desktop\STUNT MOD.pwn(96) : error 017: undefined symbol "DIALOG_LOGIN"
C:\Users\pc\Desktop\STUNT MOD.pwn(96) : error 017: undefined symbol "WHITE"
C:\Users\pc\Desktop\STUNT MOD.pwn(96) : warning 215: expression has no effect
C:\Users\pc\Desktop\STUNT MOD.pwn(96) : error 001: expected token: "-string end-", but found "-identifier-"
C:\Users\pc\Desktop\STUNT MOD.pwn(96) : fatal error 107: too many error messages on one line
 
Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
 
 
5 Errors.
Link to comment
Share on other sites

  • 0

getINI vyžaduje nějaký include. Nedělal jsem s tím, takže nevím jaký. V návodu by to mělo být.

Máš definované položky DIALOG_LOGIN, WHITE? Ty poslední 3 errory asi souvisí s funkcí getINI.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...