19.03.2010, 14:32
Hi,
I know this should be easy but i am new with dini, and i am trying to fix the follow.
When you buy an weapon you get 100 bullets, when you shoot 10 bullets you have 90, but when you log off, and back on. You have 100 bullets again, so what i want is that you buy an weapon with 100 bullets you shoot 10 bullets then you have 90 i want that it saves the 90 bullets and when you log back on you have 90 bullets. Please help it would be much apreciated
Regards,
- Jeroen
PS: you will need the code so:
Need some more just tell me, thanks for the time and help.
I know this should be easy but i am new with dini, and i am trying to fix the follow.
When you buy an weapon you get 100 bullets, when you shoot 10 bullets you have 90, but when you log off, and back on. You have 100 bullets again, so what i want is that you buy an weapon with 100 bullets you shoot 10 bullets then you have 90 i want that it saves the 90 bullets and when you log back on you have 90 bullets. Please help it would be much apreciated
Regards,
- Jeroen
PS: you will need the code so:
Код:
SaveWeaponsToFile(playerid) { new i, path[128], string[256], weaponid, ammo; path = GetPlayerFormattedName(playerid); if (!dini_Exists(path)) dini_Create(path); for (i=0; i<13; i++) { GetPlayerWeaponData(playerid,i,weaponid,ammo); format(string,sizeof(string),"Weapon - %d",i); dini_IntSet(path,string,weaponid); } } public LoadWeaponsToFile(playerid) { new i, path[128], string[256], weaponid; path = GetPlayerFormattedName(playerid); ResetPlayerWeapons(playerid); for (i=0; i<13; i++) { format(string,sizeof(string),"Weapon - %d",i); weaponid = dini_Int(path,string); GivePlayerWeapon(playerid,weaponid,100); } AlreadyGiveWeapons[playerid] = true; } public RemoveWeaponsFile(playerid) { new path[128]; path = GetPlayerFormattedName(playerid); dini_Remove(path); }