15.03.2017, 04:35
can you have solution ?
i create this system weapon save from the beginning
and i use Y_INI for System Saving why cannot save....
This my enum
stock for weaponfile
Onplayerconnect
onplayerdisconnect
Load User Weapon
Onplayerspawn
Please Help me bro i will give you rep+ and add credit
i create this system weapon save from the beginning
and i use Y_INI for System Saving why cannot save....
This my enum
PHP код:
enum ammoSave{
wId0,
wAmmo0,
wId1,
wAmmo1,
wId2,
wAmmo2
}
PHP код:
stock WeaponFile(playerid)
{
new string[128],playername[MAX_PLAYER_NAME];
GetPlayerName(playerid,playername,sizeof(playername));
format(string,sizeof(string),"akun/Weapon/%s.ini",playername);
return string;
}
PHP код:
INI_ParseFile(WeaponFile(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
PHP код:
//----------------------Weapon Save--------------------------//
new weapons[13][6];
for(new i=0; i<=12; i++)
{
GetPlayerWeaponData(playerid,i,weapons[i][0],weapons[i][1]);
new INI:filew = INI_Open(WeaponFile(playerid));
INI_SetTag(filew,"WeaponSave");
INI_WriteInt(filew,"Weapon1",weapons[i][0]);
INI_WriteInt(filew,"Ammo1",weapons[i][1]);
INI_WriteInt(filew,"Weapon2",weapons[i][2]);
INI_WriteInt(filew,"Ammo2",weapons[i][3]);
INI_WriteInt(filew,"Weapon3",weapons[i][4]);
INI_WriteInt(filew,"Ammo3",weapons[i][5]);
INI_Close(filew);
}
PHP код:
public LoadUser_weapon(playerid,name[],value[])
{
INI_Int("Weapon1",SenjataInfo[playerid][wId0]);
INI_Int("Ammo1",SenjataInfo[playerid][wAmmo0]);
INI_Int("Weapon2",SenjataInfo[playerid][wId1]);
INI_Int("Ammo2",SenjataInfo[playerid][wAmmo1]);
INI_Int("Weapon3",SenjataInfo[playerid][wId2]);
INI_Int("Ammo3",SenjataInfo[playerid][wAmmo2]);
return 1;
}
PHP код:
GivePlayerWeapon(playerid,SenjataInfo[playerid][wId0],SenjataInfo[playerid][wAmmo0]);
GivePlayerWeapon(playerid,SenjataInfo[playerid][wId1],SenjataInfo[playerid][wAmmo1]);
GivePlayerWeapon(playerid,SenjataInfo[playerid][wId1],SenjataInfo[playerid][wAmmo2]);
Please Help me bro i will give you rep+ and add credit