Slapped Together some Script and Im getting 3 Identical Errorrs, -
Matthew_Johnston - 09.12.2010
Hey Guys its me Again. Im trying to Create a Code that will save using Dini so when My server restarts, the Info is Restored.
Now, This is my Enum Code.
Код:
enum PLAYER_MAIN {
FACTION_RANK,
CASH,
}
new PlayerInfo[MAX_PLAYERS][PLAYER_MAIN];
And Im trying to make it Save Automaticly, and after having a look at a few Dini Tutorials I Slapped together a Crap code in the Hope it will work.
It didnt.
This is the Code I Mashed onto Pawno:
Код:
public OnPlayerConnect(playerid)
{
new file[100],Name[MAX_PLAYER_NAME],Ip[16];
GetPlayerName(playerid,Name,sizeof(Name));
format(file,sizeof(file),PlayerFile,Name);
if(!dini_Exists(file))
{
dini_Create(file);
dini_Set(file,"FACTION_RANK",FACTION_RANK);
dini_Set(file,"CASH",CASH);
return 1;
}
}
Any Assistance, or New Code would be GREAT. Thanks for Reading
Re: Slapped Together some Script and Im getting 3 Identical Errorrs, -
XePloiT - 09.12.2010
pawn Код:
enum PLAYER_MAIN {
FACTION_RANK,
CASH
}
new PlayerInfo[MAX_PLAYERS][PLAYER_MAIN];
pawn Код:
public OnPlayerConnect(playerid)
{
new file[100],Name[MAX_PLAYER_NAME],Ip[16];
GetPlayerName(playerid,Name,sizeof(Name));
format(file,sizeof(file),PlayerFile,Name);
if(!dini_Exists(file))
{
dini_Create(file);
dini_Set(file,"FACTION_RANK",FACTION_RANK);
dini_Set(file,"CASH",CASH);
}
return 1;
}
im pretty sure this will work...
Re: Slapped Together some Script and Im getting 3 Identical Errorrs, -
Matthew_Johnston - 09.12.2010
Nope, Got these Errors.
error 017: undefined symbol "PlayerFile"
warning 217: loose indentation
error 035: argument type mismatch (argument 3)
error 035: argument type mismatch (argument 3)
Re: Slapped Together some Script and Im getting 3 Identical Errorrs, -
Matthew_Johnston - 09.12.2010
UPDATE, I Have Done some More Work on it. Activating Dini, Except theres 5 Errors Evolved around 1 Line.
Код:
C:\Program Files\SAMP\SAMP\SAMP\gamemodes\RP10.pwn(169) : error 001: expected token: "-string end-", but found "-identifier-"
This is the Line.
Код:
PlayerInfo[playerid][FACTION_RANK] == 1;
ALL HELP IS APPRECIATED!
Re: Slapped Together some Script and Im getting 3 Identical Errorrs, -
armyoftwo - 09.12.2010
PlayerInfo[playerid][FACTION_RANK] = 1;
Re: Slapped Together some Script and Im getting 3 Identical Errorrs, -
Matthew_Johnston - 09.12.2010
Didnt Work

Thanks for Trying
Re: Slapped Together some Script and Im getting 3 Identical Errorrs, -
Mean - 09.12.2010
pawn Код:
#define PlayerFile "something/Users/%s.ini"
Re: Slapped Together some Script and Im getting 3 Identical Errorrs, -
Toreno - 09.12.2010
Everything is messed up there, why are you creating a file OnPlayerConnet?
You need to make /register /login and save them by a function... get some RP mode and figure out how to do it.
To do that, you need UPDATEPLAYER, LOGINPLAYER, REGISTERPLAY, big script
Re: Slapped Together some Script and Im getting 3 Identical Errorrs, -
Matthew_Johnston - 09.12.2010
Yes I see what You mean, Im trying to Store Data without Login or Register. So What do I Do? Use OnPlayerUpdate? It saves the Data. that Might have helped lol
--scratch that, I want to save the Data on command lol
The General Idea is that when You do a Certain command, That Your Set to a Team using an Enum inside an Array, and On that Command it saves it so when you connect to the server after it has been restarted, youre In that team? You understand what I Mean.
So Far I Have
Код:
#define PlayerInfo "SERVERFILES/Settings/User.ini"
As the Data Storage. And I Have Dini
Код:
enum PLAYER_MAIN {
FACTION_RANK,
}
new PlayerInfo[MAX_PLAYERS][PLAYER_MAIN];
As The Enum.
Код:
public OnPlayerConnect(playerid)
{
new file[100],Name[MAX_PLAYER_NAME],Ip[16];
GetPlayerName(playerid,Name,sizeof(Name));
format(file,sizeof(file),file,Name);
if(!dini_Exists(file))
{
dini_Create(file);
dini_Set(file,"FACTION_RANK");
}
return 1;
}
So When It reconnects the Data is Restored.
The Command to make the Team.
Код:
if (strcmp("/rank1", cmdtext, true) == 0)
{
SendClientMessage(playerid, 0xFFFF00AA,"Set To Rank 1");
PlayerInfo[playerid][FACTION_RANK] == 1;
return 1;
}
Any Advice?
Re: Slapped Together some Script and Im getting 3 Identical Errorrs, -
armyoftwo - 09.12.2010
what didn't work, you asked what was wrong with the line and i fixed it.
pawn Код:
if (strcmp("/rank1", cmdtext, true) == 0)
{
SendClientMessage(playerid, 0xFFFF00AA,"Set To Rank 1");
PlayerInfo[playerid][FACTION_RANK] == 1;
return 1;
}
you didnt bother fixing it