5 errors
#1

Hi! This is the problem that I have

Quote:

C:\Users\Hector\Desktop\score save.pwn(59) : error 017: undefined symbol "file"
C:\Users\Hector\Desktop\score save.pwn(59) : error 001: expected token: ";", but found "]"
C:\Users\Hector\Desktop\score save.pwn(59) : error 029: invalid expression, assumed zero

Код:
	dini_IntSet( file, "Score", PlayerInfo[ playerid ][ pScore ]);
I expect that you can help me.
Reply
#2

You can expect that yes, first of all since you don't know what that is i assume that you don't know what a variable is, you haven't defined the variable you call "file", you're also using dini which isn't recommended by many obviously, i'd use ini but you obviously don't know how to use either so i would get started on ini instead or dini2 since I've just been advised to use that, so as said, the fix for the first error you need to define file, EX: new file[256];
As for the second error i suspect that you've done something wrong with PlayerInfo[playerid][pScore] if you can send the code where you defined that or included it i'd be able to help you further.
Reply
#3

Quote:

if you can send the code where you defined that or included it

I assume that you mean, this one:

Код:
public OnPlayerDisconnect(playerid, reason)
{
	dini_IntSet( file, "Score", PlayerInfo[ playerid ][ pScore ]);
	return 1;
}
Reply
#4

No, i mean the enum or the new that defined both of your playerinfo and pscore.
Reply
#5

There you go.

Код:
enum pInfo
{
    pScore
}
new PlayerInfo[ MAX_PLAYERS ][ pInfo ];

stock GetName(playerid)
{
     new name[ MAX_PLAYER_NAME+1 ];
     GetPlayerName(playerid, name, sizeof( name ));
     return name;
}
Reply
#6

Quote:
Originally Posted by Krauser366
Посмотреть сообщение
There you go.

Код:
enum pInfo
{
    pScore
}
new PlayerInfo[ MAX_PLAYERS ][ pInfo ];

stock GetName(playerid)
{
     new name[ MAX_PLAYER_NAME+1 ];
     GetPlayerName(playerid, name, sizeof( name ));
     return name;
}
I've just used the above code and got 0 errors... if you've declared the variable new file[256]; and still got errors please re-download the dini include, that should fix it. the code i used based on what you gave me:
PHP код:
#define FILTERSCRIPT
#include <a_samp>
#include <dini>
new file[256];
enum pInfo
{
    
pScore
}
new 
PlayerInfoMAX_PLAYERS ][ pInfo ];
stock GetName(playerid)
{
     new 
nameMAX_PLAYER_NAME+];
     
GetPlayerName(playeridnamesizeofname ));
     return 
name;
}
public 
OnPlayerDisconnect(playeridreason)
{
    
dini_IntSetfile"Score"PlayerInfoplayerid ][ pScore ]);
    return 
1;

Reply
#7

It works pretty cool. What was exactly the issue?
Reply
#8

Quote:
Originally Posted by Krauser366
Посмотреть сообщение
It works pretty cool. What was exactly the issue?
According to the info given by you, you forgot to declare the variable (file), you forgot to put
PHP код:
new fie[256]; 
at the top of your code.
Reply
#9

Man... haha, well, thank you very much for your help.
Reply
#10

Np i forget lines myself as well, glad i could help.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)