SA-MP Forums Archive
There is my problem??? - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: There is my problem??? (/showthread.php?tid=526422)



There is my problem??? - MrWupiazZzLT - 17.07.2014

Hey guys where is my problem? Its in Dini or in my script?

Script:
Код:
forward Save(playerid);
forward Load(playerid);

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

public OnPlayerDisconnect(playerid, reason)
{
    Save(playerid);
	return 1;
}

public Save(playerid)
{
	new file[100];
	new name[MAX_PLAYER_NAME];
	GetPlayerName(playerid,name,sizeof(name));
	format(file,sizeof(file),"Saves/%s.ini",name);
	if(!fexist(file)){dini_Create(file);}
	dini_IntSet(file, "XP", GetPlayerScore(playerid));
	dini_IntSet(file, "Money", GetPlayerMoney(playerid));
	return 1;
}

public Load(playerid)
{
	new name[MAX_PLAYER_NAME], file[128];
	GetPlayerName(playerid, name, sizeof(name));
	format(file, sizeof(file), "Saves/%s.ini", name);
	if(!fexist(file)) return;
	new XP = dini_Int(file, "XP");
	SetPlayerScore(playerid, XP);
	new Money = dini_Int(file, "Money");
	GivePlayerMoney(playerid, Money);
	return;
}
Problem with dini: https://sampforum.blast.hk/showthread.php?tid=526418

This script is in gamemode I just posted script that is important


Re: There is my problem??? - KayJ - 17.07.2014

You can post it there also you can't make another topic(similar) until it solved!
READ RULES PLEASE!!


Re: There is my problem??? - MrWupiazZzLT - 17.07.2014

Quote:
Originally Posted by SturtIndia
Посмотреть сообщение
You can post it there also you can't make another topic(similar) until it solved!
READ RULES PLEASE!!
Its not similiar... This is script that is Dini and EXE problems... + I get it you are saying that i cant post plugins Dini so i deleted that and its still not working but dont show me warning... So its not same...


Re: There is my problem??? - KayJ - 17.07.2014

Quote:
Originally Posted by MrWupiazZzLT
Посмотреть сообщение
Its not similiar... This is script that is Dini and EXE problems... + I get it you are saying that i cant post plugins Dini so i deleted that and its still not working but dont show me warning... So its not same...
Don't argue! Its similar, only just you didn't explain there your problem and creating new thread?


Re: There is my problem??? - MrWupiazZzLT - 17.07.2014

Quote:
Originally Posted by SturtIndia
Посмотреть сообщение
Don't argue! Its similar, only just you didn't explain there your problem and creating new thread?
Dont post if you dont know how to solve the problem


Re: There is my problem??? - MrWupiazZzLT - 17.07.2014

Bump


Re: There is my problem??? - Battlezone - 17.07.2014

pawn Код:
forward Save(playerid);
forward Load(playerid);

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

public OnPlayerDisconnect(playerid, reason)
{
    Save(playerid);
    return 1;
}

public Save(playerid)
{
    new file[100];
    new name[MAX_PLAYER_NAME];
    GetPlayerName(playerid,name,sizeof(name));
    format(file,sizeof(file),"Saves/%s.ini",name);
    if(!fexist(file)){dini_Create(file);}
    dini_IntSet(file, "XP", GetPlayerScore(playerid));
    dini_IntSet(file, "Money", GetPlayerMoney(playerid));
    return 1;
}

public Load(playerid)
{
    new name[MAX_PLAYER_NAME], file[128];
    GetPlayerName(playerid, name, sizeof(name));
    format(file, sizeof(file), "Saves/%s.ini", name);
    if(!fexist(file)) return;
    SetPlayerScore(playerid, dini_Int(file, "XP"));
    GivePlayerMoney(playerid, dini_Int(file, "Money"));
    return;
}
use this.
By the way, why are you creating new variable (XP and Money)? they are useless