Help here
#1

Error i get

Код:
C:\Users\Robins\Desktop\New folder\pawno\include\/CRP/Publics/OnPlayerEnterCheckpoint.pwn(104) : error 017: undefined symbol "CHECKPOINT_CLOTHES"
Код:
#define CHECKPOINT_CLOTHES 0
pawn Код:
public OnPlayerEnterCheckpoint(playerid)
{
    if(IsPlayerNPC(playerid)) return 1;
    new string[128],sendername[MAX_PLAYER_NAME];
    switch(PlayerInfo[playerid][pCheckpoint])
    {
        case CHECKPOINT_CLOTHES:
        {
            GameTextForPlayer(playerid, "~w~/clothes", 3000, 5);
        }
    }
    return 1;
Reply
#2

EDIT:
You missed a bracket first of all! So replace this one with yours!

pawn Код:
public OnPlayerEnterCheckpoint(playerid)
{
    if(IsPlayerNPC(playerid)) return 1;
    new string[128],sendername[MAX_PLAYER_NAME];
    switch(PlayerInfo[playerid][pCheckpoint])
    {
        case CHECKPOINT_CLOTHES:
        {
            GameTextForPlayer(playerid, "~w~/clothes", 3000, 5);
        }
    }
    return 1;
}
OR

If that doesnt work up for you then do as said below!!

1. Delete the line
pawn Код:
#define CHECKPOINT_CLOTHES 0
2. Replace your OnPlayerEnterCheckpoint callback with this one!
pawn Код:
public OnPlayerEnterCheckpoint(playerid)
{
    if(IsPlayerNPC(playerid)) return 1;
    new string[128],sendername[MAX_PLAYER_NAME];
    switch(PlayerInfo[playerid][pCheckpoint])
    {
        case 0:
        {
            GameTextForPlayer(playerid, "~w~/clothes", 3000, 5);
        }
    }
    return 1;
}
Reply
#3

Quote:
Originally Posted by Ballu Miaa
Посмотреть сообщение
EDIT:
You missed a bracket first of all! So replace this one with yours!

pawn Код:
public OnPlayerEnterCheckpoint(playerid)
{
    if(IsPlayerNPC(playerid)) return 1;
    new string[128],sendername[MAX_PLAYER_NAME];
    switch(PlayerInfo[playerid][pCheckpoint])
    {
        case CHECKPOINT_CLOTHES:
        {
            GameTextForPlayer(playerid, "~w~/clothes", 3000, 5);
        }
    }
    return 1;
}
OR

If that doesnt work up for you then do as said below!!

1. Delete the line
pawn Код:
#define CHECKPOINT_CLOTHES 0
2. Replace your OnPlayerEnterCheckpoint callback with this one!
pawn Код:
public OnPlayerEnterCheckpoint(playerid)
{
    if(IsPlayerNPC(playerid)) return 1;
    new string[128],sendername[MAX_PLAYER_NAME];
    switch(PlayerInfo[playerid][pCheckpoint])
    {
        case 0:
        {
            GameTextForPlayer(playerid, "~w~/clothes", 3000, 5);
        }
    }
    return 1;
}
WHat about this then?

pawn Код:
new CheckpointAreaType[1][1] = {
{CHECKPOINT_CLOTHES},
};
Reply
#4

pawn Код:
new CheckpointAreaType[1][] = {
{CHECKPOINT_CLOTHES},
};

case CheckPointAreaType[0]:
UNTESTED!
Reply
#5

Quote:
Originally Posted by N0FeaR
Посмотреть сообщение
WHat about this then?

pawn Код:
new CheckpointAreaType[1][1] = {
{CHECKPOINT_CLOTHES},
};
This looks an 2 Dimensional array. But why do you need it??

For CHECKPOINT_CLOTHES why do you even bother to define it?

Quote:
Originally Posted by IceCube!
Посмотреть сообщение
pawn Код:
new CheckpointAreaType[1][] = {
{CHECKPOINT_CLOTHES},
};

case CheckPointAreaType[0]:
UNTESTED!
@IceCube - Could you please explain that Array and the usage please IceCube? Will be better for me too. Thanks
Reply
#6

Lawl i didn't think about that *palm face* that wouldnt actually work. Sorry. I just copyed his code corrected his array and put a really dumb useage. :P
Reply
#7

Quote:
Originally Posted by IceCube!
Посмотреть сообщение
Lawl i didn't think about that *palm face* that wouldnt actually work. Sorry. I just copyed his code corrected his array and put a really dumb useage. :P
Haha lol! Its all good. But what can we use this for? Do you know? I mean i know a bit of the usage but the full knowledge!
Reply
#8

pawn Код:
new CheckpointAreaType[1][] = {
{CHECKPOINT_CLOTHES},
};
case CheckPointAreaType[0]:
Alright, so we're defining the array "CheckpointAreaType", the '1' means it holds 1 cell, in that case CHECKPOINT_CLOTHES. Now we set easily the cases from takin' out the information of our array.
Reply
#9

An Array in gerneral or his defining system?

He's shown you his system so an array would be like

pawn Код:
new List[][] = // This has two paramaters The column as its going to hold strings.
{
     "Column 1",
     "Column 2",
     "Column 3"
};
Now were going to prin one of theres colums into a string

format(string, sizeof(string), "%s is viewing %s", GetPlayerNameEx(playerid), List[1]); // GetPlayerNameEx a custom function I use - self explanitory List[1] this tells the array which to loook at and notice i've only called one paramater. Thats because I dont want to take a certain character amount from the string or it could turn ouyt like below [/pawn]

List[1][3] - this tells the array its column one, and we only want 3 characters (Col)

an Array with one paramater could be like this elevator I made

pawn Код:
new Float:FloorZ[] =
{
    78.11,
    83.4000,
    88.6200,
    93.8800,
    99.0700,
    104.4100,
    109.7100,
    114.9500,
    120.1100,
    125.3700,
    133.6900
};
I've got this code to sahow you code in action in a script now to work out the Z level the elevator has to goto I use the listitem in my dialog.

pawn Код:
MoveObject(ElevatorObjects[0], -318.94, 1564.73, FloorZ[listitem], 5.0);
//This moves the elevator to the co-ords shown the the listem pressed if the listitem is 1 the Z co ords would be 88.6200, [/pawn]

if you would like me to show you differnt ways and things you can do with an array add my Skype as its hard coding in thei sbox I cant see whats above

EDIT: I have time

You could even go as far as a 2 dimional array with 3 bits of info in this cae Co-Ords

new Float:dimentions[2][3] = // we put 3 as we have a row inside the bracket not jsut one answer...
{
{0.0, 0.0, 0.0},
{1.0, 1.0, 1.0}
}

We would get all 3 parts like we would in a enum fixed with an array

SetPlayerPos(playerid, dimentions[1][0], dimentions[1][1], dimentions[1][2]);

Now if I were to debug this in a console and print it lets say like this

pawn Код:
Printf("%0.2f", dimentions[1][0]); It would print 0.0 as its calling that first segment inside the brackets.
EDIT at OP:

Quote:
Originally Posted by Twisted_Insane
Посмотреть сообщение
pawn Код:
new CheckpointAreaType[1][] = {
{CHECKPOINT_CLOTHES},
};
case CheckPointAreaType[0]:
Alright, so we're defining the array "CheckpointAreaType", the '1' means it holds 1 cell, in that case CHECKPOINT_CLOTHES. Now we set easily the cases from takin' out the information of our array.
This doesnt work AS thingy pointed out above. YOu would have to define each type of check point.

Like I have done with my car creator in Surreal Roleplay..

pawn Код:
#define MAX_PLATE_CHARS 20
#define Vehicle_Type_Public 0
#define Vehicle_Type_pOwned 1
#define Vehicle_Type_Faction 2
#define Vehicle_Type_Gang 3
#define Vehicle_Type_Rental 4
#define Vehicle_Type_Dealership 5
Reply
#10

I get this
Код:
C:\Users\Robins\Desktop\New folder\pawno\include\/CRP/Publics/OnPlayerEnterCheckpoint.pwn(12) : error 017: undefined symbol "CheckPointAreaType"
C:\Users\Robins\Desktop\New folder\pawno\include\/CRP/Publics/OnPlayerEnterCheckpoint.pwn(12) : warning 215: expression has no effect
C:\Users\Robins\Desktop\New folder\pawno\include\/CRP/Publics/OnPlayerEnterCheckpoint.pwn(12) : error 001: expected token: ";", but found "]"
C:\Users\Robins\Desktop\New folder\pawno\include\/CRP/Publics/OnPlayerEnterCheckpoint.pwn(12) : error 029: invalid expression, assumed zero
C:\Users\Robins\Desktop\New folder\pawno\include\/CRP/Publics/OnPlayerEnterCheckpoint.pwn(12) : fatal error 107: too many error messages on one line
with this

pawn Код:
public OnPlayerEnterCheckpoint(playerid)
{
    if(IsPlayerNPC(playerid)) return 1;
    switch(PlayerInfo[playerid][pCheckpoint])
    {
        case CheckPointAreaType[0]:
        {
            GameTextForPlayer(playerid, "~w~/clothes", 3000, 5);
        }
    }
    return 1;
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)