Help with 2 things -
FireCat - 23.09.2010
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
Re: Help with 2 things -
DarrenReeder - 23.09.2010
you are missing an ) at the end of the error line (just before the ; obviously
)
Re: Help with 2 things -
FireCat - 23.09.2010
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?
Re: Help with 2 things -
DarrenReeder - 23.09.2010
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.
Re: Help with 2 things -
FireCat - 23.09.2010
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.
|
Re: Help with 2 things -
DarrenReeder - 23.09.2010
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
Re: Help with 2 things -
FireCat - 23.09.2010
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.
Re: Help with 2 things -
CAR - 23.09.2010
Why did you use dini_Get with a integer use this:
pawn Код:
pScore = dini_Int(file, "Score");
SetPlayerScore(playerid, pScore);
Re: Help with 2 things -
DarrenReeder - 23.09.2010
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
Re: Help with 2 things -
DarrenReeder - 23.09.2010
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