Someone knows this?
#1

Hi guys lets get to the point,

I have this

Код:
SaveWeaponsToFile(playerid)
{
  new i, path[50], 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),"AmmoID - %d",i);
    dini_IntSet(path,string,ammo == 65535 ? 0 : ammo);
  }
}

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);
      format(string,sizeof(string),"AmmoID - %d",i);
      int ammo = dini_Int(path, string); //<< Line 45738
      GivePlayerWeapon(playerid,weaponid,ammo); //<< Line 45739
	}
	AlreadyGiveWeapons[playerid] = true;
}

public RemoveWeaponsFile(playerid)
{
	new path[128];
	path = GetPlayerFormattedName(playerid);
	dini_Remove(path);
}
And it give me this
Код:
H:\Users\Jeroen\Desktop\RP SACGTA(1).pwn(45738) : error 017: undefined symbol "int"
H:\Users\Jeroen\Desktop\RP SACGTA(1).pwn(45738) : error 017: undefined symbol "ammo"
H:\Users\Jeroen\Desktop\RP SACGTA(1).pwn(45739) : error 017: undefined symbol "ammo"
I know its a logical error but I don't know how to fix it.

Regards,

Jeroen
Reply
#2

Int on line 45738 should be changed to new
pawn Код:
new ammo = dini_Int(path, string);
Reply
#3

Quote:
Originally Posted by Fj0rtizFredde
Int on line 45738 should be changed to new
pawn Код:
new ammo = dini_Int(path, string);
Thanks, I don't know why I used int there lol
Reply
#4

When I go back in the game I just have no gun, anyone knows the problem
Reply
#5

pawn Код:
format(string,sizeof(string),"Weapon - %d",i);
pawn Код:
format(string,sizeof(string),"Weapon - %d",weaponid);

Reply
#6

Quote:
Originally Posted by Rac3r
pawn Код:
format(string,sizeof(string),"Weapon - %d",i);
pawn Код:
format(string,sizeof(string),"Weapon - %d",weaponid);

Its still does the same, one weird thing when I compile it gives an error
Код:
H:\Program Files\Rockstar Games\GTA San Andreas\gamemodes\RP SACGTA.pwn(45847) : warning 203: symbol is never used: "SaveWeaponsToFile"
While that line doesn't excist I am truly clueless
Reply
#7

Try add this to OnPlayerDisconnect:

pawn Код:
public OnPlayerDisconnect(playerid, reason)
{
  SaveWeaponsToFile(playerid);
  // code
  return 1;
}
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)