[Easy to solve] Basic Problem
#1

OK - I've got this dynamic /aplace command, and basically, there's something that is annoying me really much.

pawn Код:
if(dialogid == 2)
    {
        if(response)
        {
            switch(listitem)
            {
                case 0:
                {
                    new Float:X,Float:Y,Float:Z;
                    GetPlayerPos(playerid,X,Y,Z);
                    new p = editingplace[playerid]; // Line 3510
                    PlaceInfo[p][plOutX] = X;
                    PlaceInfo[p][plOutY] = Y;
                    PlaceInfo[p][plOutZ] = Z;
                    DestroyPickup(PlaceInfo[p][plPick]);
                    Delete3DTextLabel(PlaceInfo[p][plLabel]);
                    PlaceInfo[p][plPick] = CreatePickup(1318,28,PlaceInfo[p][plOutX],PlaceInfo[p][plOutY],PlaceInfo[p][plOutZ]);
                    new string[256];
                    format(string,sizeof(string),"%s\nID: %i",PlaceInfo[p][plText],p);
                    PlaceInfo[p][plLabel] = Create3DTextLabel(string,COLOR_YELLOW,PlaceInfo[p][plOutX],PlaceInfo[p][plOutY],PlaceInfo[p][plOutZ]+0.7,10.0,0,0);
                    OnPropUpdate();
                    SendClientMessage(playerid,COLOR_WHITE,"[Place] You have moved the entrance.");
                }
                case 1:
                {
                    new Float:X,Float:Y,Float:Z;
                    GetPlayerPos(playerid,X,Y,Z);
                    new p = editingplace[playerid];
                    PlaceInfo[p][plIntX] = X;
                    PlaceInfo[p][plIntY] = Y;
                    PlaceInfo[p][plIntZ] = Z;
                    PlaceInfo[p][plInt] = GetPlayerInterior(playerid);
                    OnPropUpdate();
                    SendClientMessage(playerid,COLOR_WHITE,"[Place] You have moved the exit.");

                }
                case 2:
                {
                    ShowPlayerDialog(playerid,3,DIALOG_STYLE_INPUT,"Place Text","Please enter what text you would like to appear on the place.","Ok","Cancel");
                }

            }
        }
    }
The compiler error:
Код:
C:\Users\rodi\Desktop\Hakam\Universal Roleplay 0.3b [bak]\U-RP\gamemodes\u-rp.pwn(3510) : error 017: undefined symbol "editingplace"
C:\Users\rodi\Desktop\Hakam\Universal Roleplay 0.3b [bak]\U-RP\gamemodes\u-rp.pwn(3510) : warning 215: expression has no effect
C:\Users\rodi\Desktop\Hakam\Universal Roleplay 0.3b [bak]\U-RP\gamemodes\u-rp.pwn(3510) : error 001: expected token: ";", but found "]"
C:\Users\rodi\Desktop\Hakam\Universal Roleplay 0.3b [bak]\U-RP\gamemodes\u-rp.pwn(3510) : error 029: invalid expression, assumed zero
C:\Users\rodi\Desktop\Hakam\Universal Roleplay 0.3b [bak]\U-RP\gamemodes\u-rp.pwn(3510) : fatal error 107: too many error messages on one line

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


4 Errors.
Reply
#2

pawn Код:
new editingplace[MAX_PLAYERS];
Reply
#3

Quote:
Originally Posted by CyberGhost
Посмотреть сообщение
pawn Код:
new editingplace[MAX_PLAYERS];
Punk - thanks, it solved my problem. But I've got a new problem now (other thing)

pawn Код:
for(new p = 0; p < sizeof(PlaceInfo); p++)
    {
        new string[128];
        PlaceInfo[p][plPick] = CreatePickup(1318,28,PlaceInfo[p][plOutX],PlaceInfo[p][plOutY],PlaceInfo[p][plOutZ]);
        format(string,sizeof(string),"%s\nID: %i",PlaceInfo[p][plText],p);
        PlaceInfo[p][plLabel] = Create3DTextLabel(string,COLOR_YELLOW,PlaceInfo[p][plOutX],PlaceInfo[p][plOutY],PlaceInfo[p][plOutZ]+0.7,10.0,0,0);
        pickups++; // Line 13644
    }
Compiler error:
Код:
C:\Users\rodi\Desktop\Hakam\Universal Roleplay 0.3b [bak]\U-RP\gamemodes\u-rp.pwn(13644) : error 017: undefined symbol "pickups"
C:\Users\rodi\Desktop\Hakam\Universal Roleplay 0.3b [bak]\U-RP\gamemodes\u-rp.pwn(13644) : warning 215: expression has no effect
Reply
#4

pawn Код:
for(new p = 0; p < sizeof(PlaceInfo); p++)
    {
        new string[128],pickups; //edited this line
        PlaceInfo[p][plPick] = CreatePickup(1318,28,PlaceInfo[p][plOutX],PlaceInfo[p][plOutY],PlaceInfo[p][plOutZ]);
        format(string,sizeof(string),"%s\nID: %i",PlaceInfo[p][plText],p);
        PlaceInfo[p][plLabel] = Create3DTextLabel(string,COLOR_YELLOW,PlaceInfo[p][plOutX],PlaceInfo[p][plOutY],PlaceInfo[p][plOutZ]+0.7,10.0,0,0);
        pickups++; // Line 13644
    }
Reply
#5

Define pickups such as:
new pickups = 0;
ON TOP OF YOUR GAMEMODE. Because it is defined somewhere else which isn't read by your system.
Reply
#6

Quote:
Originally Posted by Berky
Посмотреть сообщение
Define pickups such as:
new pickups = 0;
ON TOP OF YOUR GAMEMODE. Because it is defined somewhere else which isn't read by your system.
No - I solved this instantly after I posted the topic, it needed a couple of edits (I fixed it before o_O posted.)
Reply
#7

Dear Hakam --
If you get an error "undefined symbol", it means that variable(in this case) is not defined.
You should define it first.

Lol
I'm glad it's fixed.
Reply
#8

@Biesmen: Yes, I want to note something: in php, you don't need to define first, so it was so strange when I started to script in PAWN. Maybe it's offtopic, maybe it's not.
Reply
#9

Quote:
Originally Posted by Seven_of_Nine
Посмотреть сообщение
@Biesmen: Yes, I want to note something: in php, you don't need to define first, so it was so strange when I started to script in PAWN. Maybe it's offtopic, maybe it's not.
I wasn't talking about PHP o.o
Reply
#10

Quote:
Originally Posted by Seven_of_Nine
Посмотреть сообщение
@Biesmen: Yes, I want to note something: in php, you don't need to define first, so it was so strange when I started to script in PAWN. Maybe it's offtopic, maybe it's not.
Yes XD, before learning pawn I used to make computer games with Game Maker, wich has the advanced option of scripting in his language, and it was so strange when i learnt pawno.

Maybe it's offtopic, maybe it's not. XD
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)