Help with 2 things
#1

hi, im getting this error O.o
Quote:

C:\Users\james\Desktop\server2\gamemodes\gamemode. pwn(116) : error 001: expected token: ",", but found ";"
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
1 Error.

Код:
public OnPlayerDisconnect(playerid, reason)
{
    new plrIP[16];
    new file[MAX_PLAYER_NAME+25], name[MAX_PLAYER_NAME];
    GetPlayerName(playerid, name, sizeof(name));
    dini_Create(file);
    format(file, sizeof(file), "mygamemode/users/%s.txt", name);
    dini_IntSet(file, "Score", GetPlayerScore(playerid));
    dini_IntSet(file, "IP", GetPlayerIp(playerid, plrIP, sizeof(plrIP));////error line!
    return 1;
}
and how can i make when he connects it reads from the file
OnPlayerDisconnect?
cause it saves his score then when he connects his score = read from the file
Reply
#2

you are missing an ) at the end of the error line (just before the ; obviously )
Reply
#3

Quote:
Originally Posted by DarrenReeder
Посмотреть сообщение
you are missing an ) at the end of the error line (just before the ; obviously )
nice but now when someone connects i want his score the same has the last time he connected thats why i wrote it to a file, but how?
Reply
#4

Well as long as you saved his score into the file..when you next connect make it so when you login it sets your score to the number saved in the file...

get me?

--

This forum requires that you wait 120 seconds between posts. Please try again in 18 seconds.
Reply
#5

Quote:
Originally Posted by DarrenReeder
Посмотреть сообщение
Well as long as you saved his score into the file..when you next connect make it so when you login it sets your score to the number saved in the file...

get me?

--

This forum requires that you wait 120 seconds between posts. Please try again in 18 seconds.
well problem is it dosnt cause i dont have nothing onplayerconnect so yah cause i dont know what to put
i tryed
Код:
new file[MAX_PLAYER_NAME+25], name[MAX_PLAYER_NAME];
    GetPlayerName(playerid, name, sizeof(name));
    format(file, sizeof(file), "mygamemode/users/%s.txt", name);
    dini_Get(file, "Score", SetPlayerScore(playerid));
but i get
Quote:

C:\Users\james\Desktop\server2\gamemodes\gamemode. pwn(10 : warning 202: number of arguments does not match definition
C:\Users\james\Desktop\server2\gamemodes\gamemode. pwn(10 : warning 202: number of arguments does not match definition
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
2 Warnings.

Reply
#6

dini_get takes two parameters i think...

so do it like this:
pawn Код:
new pScore;
strcat(pScore,dini_Get(file, "Score"));
SetPlayerScore(playerid, pScore);
edit:

although pScore should be an enum
Reply
#7

Quote:
Originally Posted by DarrenReeder
Посмотреть сообщение
dini_get takes two parameters i think...

so do it like this:
pawn Код:
new pScore;
strcat(pScore,dini_Get(file, "Score"));
SetPlayerScore(playerid, pScore);
edit:

although pScore should be an enum
rofl
C:\Users\james\Desktop\server2\gamemodes\gamemode. pwn(106) : error 035: argument type mismatch (argument 1)
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase

1 Error.
Reply
#8

Why did you use dini_Get with a integer use this:
pawn Код:
pScore = dini_Int(file, "Score");
SetPlayerScore(playerid, pScore);
Reply
#9

ah yeah, my bad, we are using strcat...thats for strings...

just do this//

pawn Код:
new pScore = dini_int(file, "Score");
SetPlayerScore(playerid, pScore);
Sorry about that lol...just a small moment of stupidity
Reply
#10

Quote:
Originally Posted by CAR
Посмотреть сообщение
Why did you use dini_Get with a integer use this:
pawn Код:
pScore = dini_Int(file, "Score");
SetPlayerScore(playerid, pScore);
haha, yeah, you beat me to it, i realised what i did after taking a step back at the bigger picture..

As soon as firecat posted his post i realised what i did wrong :S lol
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)