There is my problem???
#1

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
Reply
#2

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

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...
Reply
#4

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?
Reply
#5

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
Reply
#6

Bump
Reply
#7

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
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)