[HELP] Error in pawno caused loss of code.
#1

Basically, in a short recap - I was just coding, and to tidy up the code I was sorting the commands (e.g. categorising them, these commands can be used by admins, cops, civilians, etc.)

Just as I was in the middle of doing that, pawno.exe started acting up - giving random errors. Trying to copy my code in the hope of nothing being lost (pawno.exe didn't close, just kept giving errors by everything I was doing, only thing I understood was that the memory appeared to have ran out)

In either case, the error code generated (as I copied it) is:

pawn Код:
---------------------------
Pawno
---------------------------
Access violation at address 004028F5 in module 'pawno.exe'. Write of address 775DA116.
---------------------------
OK  
---------------------------
Starting the .pwn file back up, trying to compile. I receive a ton of errors.

pawn Код:
C:\SAMP GMs\Revos LV CnR\gamemodes\LV-CnR.pwn(993) : error 017: undefined symbol "plname"
C:\SAMP GMs\Revos LV CnR\gamemodes\LV-CnR.pwn(993) : error 033: array must be indexed (variable "pname")
C:\SAMP GMs\Revos LV CnR\gamemodes\LV-CnR.pwn(1000) : error 017: undefined symbol "PlayerName"
C:\SAMP GMs\Revos LV CnR\gamemodes\LV-CnR.pwn(1003) : error 017: undefined symbol "Prompt_Register"
C:\SAMP GMs\Revos LV CnR\gamemodes\LV-CnR.pwn(1007) : error 017: undefined symbol "Prompt_Login"
C:\SAMP GMs\Revos LV CnR\gamemodes\LV-CnR.pwn(1023) : error 017: undefined symbol "plname"
C:\SAMP GMs\Revos LV CnR\gamemodes\LV-CnR.pwn(1023) : error 033: array must be indexed (variable "pname")
C:\SAMP GMs\Revos LV CnR\gamemodes\LV-CnR.pwn(1038) : error 017: undefined symbol "AdIG"
C:\SAMP GMs\Revos LV CnR\gamemodes\LV-CnR.pwn(1365) : error 017: undefined symbol "plname"
C:\SAMP GMs\Revos LV CnR\gamemodes\LV-CnR.pwn(1446) : error 017: undefined symbol "plname"
C:\SAMP GMs\Revos LV CnR\gamemodes\LV-CnR.pwn(1457) : error 017: undefined symbol "plname"
C:\SAMP GMs\Revos LV CnR\gamemodes\LV-CnR.pwn(1457) : error 033: array must be indexed (variable "pname")
C:\SAMP GMs\Revos LV CnR\gamemodes\LV-CnR.pwn(1492) : error 017: undefined symbol "GetPlayerIRCColor"
C:\SAMP GMs\Revos LV CnR\gamemodes\LV-CnR.pwn(1497) : error 017: undefined symbol "GetPlayerIRCColor"
C:\SAMP GMs\Revos LV CnR\gamemodes\LV-CnR.pwn(1528) : error 017: undefined symbol "isLaw"
C:\SAMP GMs\Revos LV CnR\gamemodes\LV-CnR.pwn(1533) : error 017: undefined symbol "isLaw"
C:\SAMP GMs\Revos LV CnR\gamemodes\LV-CnR.pwn(1536) : error 017: undefined symbol "incwlvl"
C:\SAMP GMs\Revos LV CnR\gamemodes\LV-CnR.pwn(1556) : error 017: undefined symbol "incwlvl"
C:\SAMP GMs\Revos LV CnR\gamemodes\LV-CnR.pwn(1589) : error 017: undefined symbol "incwlvl"
C:\SAMP GMs\Revos LV CnR\gamemodes\LV-CnR.pwn(1622) : error 017: undefined symbol "ShowVehicleTextForPlayer"
C:\SAMP GMs\Revos LV CnR\gamemodes\LV-CnR.pwn(1676) : error 017: undefined symbol "plname"
C:\SAMP GMs\Revos LV CnR\gamemodes\LV-CnR.pwn(1719) : error 017: undefined symbol "plname"
C:\SAMP GMs\Revos LV CnR\gamemodes\LV-CnR.pwn(1719) : error 033: array must be indexed (variable "pname")
C:\SAMP GMs\Revos LV CnR\gamemodes\LV-CnR.pwn(1745) : error 017: undefined symbol "plname"
C:\SAMP GMs\Revos LV CnR\gamemodes\LV-CnR.pwn(1745) : error 033: array must be indexed (variable "pname")
C:\SAMP GMs\Revos LV CnR\gamemodes\LV-CnR.pwn(1754) : error 017: undefined symbol "plname"

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


26 Errors.
Just to prove that the code is not by any means flawed, and it hasn't got any errors, (It compiled before and I changed nothing untill that very error) - It's not the best code but it functions
pawn Код:
public OnPlayerConnect(playerid)
{
    new pname[MAX_PLAYER_NAME], string[128], ip[16];
    pname = plname(playerid);
    GetPlayerIp(playerid, ip, sizeof(ip));
   
    /*SetPlayerColor(playerid, COLOR_DEADCONNECT);

    ResetVars(playerid);

    format(string, sizeof(string), "Users/%s", PlayerName(playerid));
    if (!udb_Exists(string))
    {
        Prompt_Register(playerid);
    }
    else
    {
        Prompt_Login(playerid);
    }
   
    format(string, sizeof(string), "{66CCFF}%s (%d){FFFFFF} has joined the server.", pname, playerid);
    SendClientMessageToAll(COLOR_GREY, string);
    format(string, sizeof(string), "09[JOIN] %s (%d) has joined the server.", pname, playerid);
    IRC(string);
    format(string, sizeof(string), "09[JOIN] %s (%d) [%s] has joined the server.", pname, playerid, ip);
    AdIRC(string);
*/

    return 1;
}

pawn Код:
stock plname(playerid)
{
    new pname[MAX_PLAYER_NAME];
    GetPlayerName(playerid, pname, sizeof(pname));
    return pname;
}
Knowing this code works for sure, as I commented everything else out. just to see if the errors remains

pawn Код:
C:\SAMP GMs\Revos LV CnR\gamemodes\LV-CnR.pwn(993) : error 017: undefined symbol "plname"
C:\SAMP GMs\Revos LV CnR\gamemodes\LV-CnR.pwn(993) : error 033: array must be indexed (variable "pname")
C:\SAMP GMs\Revos LV CnR\gamemodes\LV-CnR.pwn(992) : warning 204: symbol is assigned a value that is never used: "string"
C:\SAMP GMs\Revos LV CnR\gamemodes\LV-CnR.pwn(1023) : error 017: undefined symbol "plname"

..


Compilation aborted.Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase
26 Errors.
To get to the actual point of the topic - these errors weren't in the script before the pawno.exe error I received, does anyone have any solution to this problem? Perhaps any idea where the location of the possible error could be (I'm not sure if thats possible without the entire .pwn, but I'll find that out upon the replies in this topic)

So in final, before the crash of pawno.exe, everything functioned fine, the crash (seems to have) appeared out of nowhere, and due to that a error or misread in the script itself has occured.

Hope to have informed everyone enough to come to a solution to this issue :+
Anything that helps is appriciated, thanks.
Reply
#2

have you used "new" on the undifined symbols
Reply
#3

I hope I didn't get your message wrong, but if you're asking me if I used

pawn Код:
new pname[MAX_PLAYER_NAME];
  pname = plname(playerid);
Yes, as I stated. The code worked perfectly fine untill pawno.exe crashed.
Reply
#4

plname and pname are they same or you made mistake in typing.
Reply
#5

Quote:

pawn Code:

---------------------------
Pawno
---------------------------
Access violation at address 004028F5 in module 'pawno.exe'. Write of address 775DA116.
---------------------------
OK
---------------------------
If your using windows vista or 7 try to run pawno as a administrator.
Reply
#6

pawn Код:
new pname[MAX_PLAYER_NAME];
  pname = plname(playerid);
That code doesn't make sense to me. The stock 'plname' already returns the name string, so there is no reason to make it equivalent to another string.
Reply
#7

Quote:
Originally Posted by Oscii
Посмотреть сообщение
If your using windows vista or 7 try to run pawno as a administrator.
Yes! I have been told that by someone on #sa-mp.script on the IRC TL network, this is what I'll be doing once I get the real problem fixed though - The script errors. As running in administration mode does not fix the errors, and I've no idea what causes them.
Reply
#8

What was the latest thing you edited before them errors came up?
Reply
#9

I was switching up ZCMDs and formatting them into a easier to look up and readable format from this:
pawn Код:
CMD:rc(playerid, params[])
{
..
}
CMD:makemafia(playerid, params[])
{
..
}

CMD:admins(playerid)
{
..
}
CMD:afk(playerid)
{
..
}
CMD:admafiaboss(playerid, params[])
{
..
}
CMD:afklist(playerid)
{
..
}

CMD:radiooff(playerid)
{
..
}
to this:
pawn Код:
//================================= Regular Commands ===========================

CMD:rc(playerid, params[])
{
..
}

CMD:admins(playerid)
{
..
}

CMD:afk(playerid)
{
..
}

//================================= Protitue Commands ==========================

//================================= Chauffeur Commands =========================

//================================= Pilot Commands =============================

//================================= Medic Commands =============================

//================================= FDSA Commands ==============================

//================================= Misc Commands ==============================

CMD:radio(playerid)
{
..
}

CMD:radiooff(playerid)
{
..
}

CMD:afklist(playerid)
{
..
}

CMD:backweapon(playerid)
{
..
}

//================================= Mafia Commands =============================

CMD:mc(playerid, params[])
{
..
}

CMD:makemafia(playerid, params[])
{
..
}

CMD:takemafia(playerid, params[])
{
..
}

//================================= Admin Commands =============================

CMD:admafiaboss(playerid, params[])
{
..
So nothing really special.
Reply
#10

Are you define MAX_PLAYER_NAME ?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)