10.06.2016, 21:03
Amigos lo que pasa es que estoy dentro del server y me seteo un arma luego al relogear no me aparece mas, me salgo entro y no esta el arma, alguien puede ayudarme a ver el problema
[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]
[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]