dont save :X
#1

PHP код:
#include <a_samp> 
#include <YSI\y_ini>
#define IGSave "%s.ini"
forward Load(playeridname[], value[]);
enum pInfo
{
    
Owner,
}
new 
PlayerInfo[MAX_PLAYERS][pInfo];
public 
Load(playeridname[], value[])
{
    
INI_Int("Owner"PlayerInfo[playerid][Owner]);
    return 
1;
}
stock OwnerPath(playerid)
{
    new 
str[128],name[24];
    
GetPlayerName(playerid,name,24);
    
format(str,sizeof(str),IGSave,name);
    return 
str;
}
public 
OnPlayerConnect(playerid)
{
        
SendClientMessage(playerid,COLOR_LIGHTBLUE,"This server use rumen98's IG Company System check /igchelp");
        new 
uFile[35];
        
format(uFile35IGSaveOwnerPath(playerid));
        
INI_ParseFile(uFile,"Load",.bExtra true, .extra playerid);
        return 
1;
}
public 
OnPlayerDisconnect(playeridreason)
{
    new 
sFile[35];
    
format(sFile35IGSaveOwnerPath(playerid));
    new 
INI:OwnerFile INI_Open(sFile);
    
INI_WriteInt(OwnerFile"Owner"PlayerInfo[playerid][Owner]);
    
INI_Close(OwnerFile);
    return 
1;}
COMMAND:joinigc(playerid,params[])
{
    if(
PlayerInfo[playerid][Owner] == 1)
        return 
SendClientMessage(playeridCOLOR_RED"You already owner of IG Company.");
    if(
GetPlayerMoney(playerid) <= joinprice) return SendClientMessage(playerid0xFFFFFF"You don't have enough cash!");
    
PlayerInfo[playerid][Owner] = 1;
    
GivePlayerMoney(playerid,-joinprice);
    
SendClientMessage(playerid0xFFFFFF"You are now owner of IG Company!");
    return 
1;} 
This is my code but does not want to record statistics
first join and buy Owner level 1 and then reconect from Owner = 1 is Owner = 0 why ?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)