PDA

View Full Version : help about data saving!


Jihanz
24/03/2017, 03:45 PM
can you help me ?

this my define
#define JOB_TAXI 2

i will save this data to here
INI_Int("JobTaxi",PlayerInfo[playerid][pJob][JOB_TAXI]);

and i got this...
D:\data aji\Samp server\gamemodes\fr1.pwn(1733) : error 001: expected token: ";", but found "["
D:\data aji\Samp server\gamemodes\fr1.pwn(1733) : error 029: invalid expression, assumed zero
D:\data aji\Samp server\gamemodes\fr1.pwn(1733) : warning 215: expression has no effect
D:\data aji\Samp server\gamemodes\fr1.pwn(1733) : error 001: expected token: ";", but found "]"
D:\data aji\Samp server\gamemodes\fr1.pwn(1733) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase


4 Errors.



maybe you have another way to do this problem

Thanks Alot

jasperschellekens
24/03/2017, 04:16 PM
Show us the script around line 1733.

Jihanz
24/03/2017, 04:24 PM
Show us the script around line 1733.

INI_Int("JobTaxi",PlayerInfo[playerid][pJob][JOB_TAXI]);

jasperschellekens
24/03/2017, 04:27 PM
Try This


new IsLogged[MAX_PLAYERS];
new Died[MAX_PLAYERS];

public OnPlayerConnect(playerid)
{
LoadStats(playerid);
return 1;
}

public OnPlayerDisconnect(playerid)
{
SStats(playerid);
return 1;
}

stock SStats(playerid)
{
if(IsPlayerConnectedEx(playerid)&&fexist(Acc(playerid)))
{
new Year,Month,Day,str[32];
getdate(Year,Month,Day);
format(str,32,"%d/%d/%d",Day,Month,Year);
INI_Set(Acc(playerid),"LastOnline",str);
INI_IntSet(Acc(playerid),"JobTaxi",PlayerInfo[playerid][pJob][JOB_TAXI]);
}
return 1;
}

stock LoadStats(playerid)
{
if(!fexist(Acc(playerid)))return 0;
PlayerInfo[playerid][pJob][JOB_TAXI]=INI_Int(Acc(playerid),"JobTaxi");
return 1;
}

stock IsPlayerConnectedEx(playerid)
{
if (IsPlayerConnected(playerid)&&IsLogged[playerid]==1&&Died[playerid]==0&&playerid!=INVALID_PLAYER_ID) return 1;
return 0;
}

Toroi
24/03/2017, 08:50 PM
Can you show us your PlayerInfo enums?