Problema con las armas, ayuda !
#3

[pawn=1]SaveWeaponsToFile(playerid) //Fix de municion
{
new i, path[128], string[128], 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);
format(string,sizeof(string),"municion - %d",i);
dini_IntSet(path,string,ammo >= 10000 ? 5000 : ammo);
}
}

public LoadWeaponsToFile(playerid)
{
new i, path[128], string[128], string2[128], weaponid, municion;
path = GetPlayerFormattedName(playerid);
ResetPlayerWeapons2(playerid);
for (i=0; i<13; i++)
{
format(string,sizeof(string),"Weapon - %d",i);
format(string2,sizeof(string2),"municion - %d",i);
weaponid = dini_Int(path,string);
municion = dini_Int(path,string2);
GivePlayerWeapon2(playerid,weaponid,municion);
}
AlreadyGiveWeapons[playerid] = true;
}

public RemoveWeaponsFile(playerid)
{
new path[128];
path = GetPlayerFormattedName(playerid);
dini_Remove(path);
}

GetPlayerFormattedName(playerid)
{
new name[24], full[50];
GetPlayerName(playerid,name,sizeof(name));
format(full,sizeof(full),"%s/%s.txt",PATH,name);
return full;
}

__________________________________________________ ________

Esto esta en onplayerspawn
if(!AlreadyGiveWeapons[playerid]) SetTimerEx("LoadWeaponsToFile",250,false,"i",playe rid);
[/pawn]
Reply


Messages In This Thread
Problema con las armas, ayuda ! - by DeannN - 18.06.2016, 03:31
Respuesta: Problema con las armas, ayuda ! - by wharlos - 18.06.2016, 03:45
Re: Problema con las armas, ayuda ! - by DeannN - 18.06.2016, 03:48

Forum Jump:


Users browsing this thread: 2 Guest(s)