27.10.2014, 19:06
Hello
I'm making a tiki system, where the player has to find 25 tikis that are hidden in the world.
Now everything works flawless, however I have a problem saving which tikis have already been found by a player and which are yet to be tracked.
Now here's how I want to do this:
That's the array, so when a player picks up a tiki all I do is set
Well this all works perfect however when a player disconnects I'm trying to format wether or not the player has found a tiki in a string, using this code:
Well this should format the following string when for example a player has found the first and second last tiki: [CODDE]1000..10[/CODE]
1 Saying that the player has found the specific tiki
0 saying that the player hasn't yet found the tiki
But unfortunately this doesn't work, the string is formatted wrong all the time and I don't know why...
Please tell me how to do this correctly :/
Also another thing, when I read the tikistring from the database, I would like to convert the string into values so this:
Becomes this:
BUt I don't know how I can read wether a player has already found a certain tiki or not from this string
Thanks in advance
I'm making a tiki system, where the player has to find 25 tikis that are hidden in the world.
Now everything works flawless, however I have a problem saving which tikis have already been found by a player and which are yet to be tracked.
Now here's how I want to do this:
pawn Код:
PInfo[MAX_PLAYERS][FoundTiki[MAX_TIKIS]]
pawn Код:
PInfo[playerid][FoundTiki[FoundTiki]] = 1;
pawn Код:
for(new ti; ti < sizeof TIInfo; ti ++)
{
format(PInfo[playerid][TikiString], MAX_TIKIS, "%s%d", PInfo[playerid][TikiString], PInfo[playerid][FoundTiki][ti]);
}
1 Saying that the player has found the specific tiki
0 saying that the player hasn't yet found the tiki
But unfortunately this doesn't work, the string is formatted wrong all the time and I don't know why...
Please tell me how to do this correctly :/
Also another thing, when I read the tikistring from the database, I would like to convert the string into values so this:
Код:
100..10
Код:
PInfo[playerid][FoundTiki][0] = 1; //Tiki id 0 has been found by the player PInfo[playerid][FoundTiki][1] = 0; //Tiki id 1 hasn't been found, hence value 0 And so forth
Thanks in advance