Ayuda solucionar problema de guardado y cargado
#1

Hola bueno tengo un problema porque no me guardar ni me carga las armas dejo codigo:
Код:
    
jArmas[13],
jMunicion[13],
En public OnPlayerSpawn(playerid)
Код:
for(new i=0; i < 13; i++){GivePlayerWeapon(playerid, Info[playerid][jArmas][i], Info[playerid][jMunicion][i]);}
Stock de cargado de cuentas
Код:
	new str[64];
	format(str, 64, "Armas_%d", i);
	Info[playerid][jArmas][i]=dini_Int(FileName, str);
	format(str, 64, "Municiones_%d", i);
	Info[playerid][jArmas][i]=dini_Int(FileName, str);
	}
Stock de guardado de cuentas
Код:
	new str[64];
	format(str, 64, "Armas_%d", i);
	dini_IntSet(ArchivoNombre, str, Info[playerid][jArmas][i]);
	format(str, 64, "Municiones_%d", i);
	dini_IntSet(ArchivoNombre, str, Info[playerid][jMunicion][i]);
	}
Reply
#2

Quote:
Originally Posted by Jeree10
Посмотреть сообщение
Hola bueno tengo un problema porque no me guardar ni me carga las armas dejo codigo:
Код:
    
jArmas[13],
jMunicion[13],
En public OnPlayerSpawn(playerid)
Код:
for(new i=0; i < 13; i++){GivePlayerWeapon(playerid, Info[playerid][jArmas][i], Info[playerid][jMunicion][i]);}
Stock de cargado de cuentas
Код:
	new str[64];
	format(str, 64, "Armas_%d", i);
	Info[playerid][jArmas][i]=dini_Int(FileName, str);
	format(str, 64, "Municiones_%d", i);
	Info[playerid][jArmas][i]=dini_Int(FileName, str);
	}
Stock de guardado de cuentas
Код:
	new str[64];
	format(str, 64, "Armas_%d", i);
	dini_IntSet(ArchivoNombre, str, Info[playerid][jArmas][i]);
	format(str, 64, "Municiones_%d", i);
	dini_IntSet(ArchivoNombre, str, Info[playerid][jMunicion][i]);
	}
estб mal definido, https://sampwiki.blast.hk/wiki/Function:GivePlayerWeapon revisa.
Reply
#3

new municion = 99999;
GivePlayerWeapon(playerid, 22, municion);
GivePlayerWeapon(playerid, 25, municion);
GivePlayerWeapon(playerid, 28, municion);
Reply
#4

Que tiene mal definido? en onplayerspawn?
Reply
#5

Quote:
Originally Posted by Jeree10
Посмотреть сообщение
Que tiene mal definido? en onplayerspawn?
Perdуn me equivoquй, no me fije bien,{


prueba con esto

pawn Код:
new str[64];
    format(str, sizeof( mStr ), "Armas_%d", i);
    dini_IntSet( str, Info[playerid][jArmas][i]);
    format(str, sizeof( mStr ), "Municiones_%d", i);
    dini_IntSet( str, Info[playerid][jMunicion][i]);
    }
Reply
#6

Код:
C:\Users\Giga\Desktop\Base\gamemodes\GM_Base.pwn(3270) : error 017: undefined symbol "mStr"
C:\Users\Giga\Desktop\Base\gamemodes\GM_Base.pwn(3270) : error 029: invalid expression, assumed zero
C:\Users\Giga\Desktop\Base\gamemodes\GM_Base.pwn(3270) : warning 215: expression has no effect
C:\Users\Giga\Desktop\Base\gamemodes\GM_Base.pwn(3271) : warning 202: number of arguments does not match definition
C:\Users\Giga\Desktop\Base\gamemodes\GM_Base.pwn(3272) : error 017: undefined symbol "mStr"
C:\Users\Giga\Desktop\Base\gamemodes\GM_Base.pwn(3272) : error 029: invalid expression, assumed zero
C:\Users\Giga\Desktop\Base\gamemodes\GM_Base.pwn(3272) : warning 215: expression has no effect
C:\Users\Giga\Desktop\Base\gamemodes\GM_Base.pwn(3273) : warning 202: number of arguments does not match definition
C:\Users\Giga\Desktop\Base\gamemodes\GM_Base.pwn(3290) : warning 204: symbol is assigned a value that is never used: "mrep"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


4 Errors.
Reply
#7

Quote:
Originally Posted by Jeree10
Посмотреть сообщение
Код:
C:\Users\Giga\Desktop\Base\gamemodes\GM_Base.pwn(3270) : error 017: undefined symbol "mStr"
C:\Users\Giga\Desktop\Base\gamemodes\GM_Base.pwn(3270) : error 029: invalid expression, assumed zero
C:\Users\Giga\Desktop\Base\gamemodes\GM_Base.pwn(3270) : warning 215: expression has no effect
C:\Users\Giga\Desktop\Base\gamemodes\GM_Base.pwn(3271) : warning 202: number of arguments does not match definition
C:\Users\Giga\Desktop\Base\gamemodes\GM_Base.pwn(3272) : error 017: undefined symbol "mStr"
C:\Users\Giga\Desktop\Base\gamemodes\GM_Base.pwn(3272) : error 029: invalid expression, assumed zero
C:\Users\Giga\Desktop\Base\gamemodes\GM_Base.pwn(3272) : warning 215: expression has no effect
C:\Users\Giga\Desktop\Base\gamemodes\GM_Base.pwn(3273) : warning 202: number of arguments does not match definition
C:\Users\Giga\Desktop\Base\gamemodes\GM_Base.pwn(3290) : warning 204: symbol is assigned a value that is never used: "mrep"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


4 Errors.
Perdуn hehehe.
pawn Код:
new mStr[64];
    format(mStr, sizeof( mStr ), "Armas_%d", i);
    dini_IntSet( str, Info[playerid][jArmas][i]);
    format(mStr, sizeof( mStr ), "Municiones_%d", i);
    dini_IntSet( str, Info[playerid][jMunicion][i]);
    }
Reply
#8

Код:
C:\Users\Giga\Desktop\Base\gamemodes\GM_Base.pwn(3271) : error 017: undefined symbol "str"
C:\Users\Giga\Desktop\Base\gamemodes\GM_Base.pwn(3273) : error 017: undefined symbol "str"
C:\Users\Giga\Desktop\Base\gamemodes\GM_Base.pwn(3290) : warning 204: symbol is assigned a value that is never used: "mrep"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


2 Errors.
Reply
#9

Si con dini intset
Reply
#10

Quote:
Originally Posted by Jeree10
Посмотреть сообщение
Si con dini intset
Ponlo asн mejor:

pawn Код:
new mStr[64];
format(mStr, sizeof( mStr ), "Armas_%d", i);
dini_IntSet(ArchivoNombre,Info[playerid][jArmas][i], mStr);
format(mStr, sizeof( mStr ), "Municiones_%d", i);
dini_IntSet(ArchivoNombre,Info[playerid][jMunicion][i],mStr);
Tomado como referencia a https://sampwiki.blast.hk/wiki/Useful_Functions#dini_IntSet

Код:
(Nombre de archivo [], la tecla [], valor)

nombre de archivo []	El nombre del archivo para abrir
tecla []	El valor para guardar en
valor	El entero para guardar
Ejemplo:
dini_Set ("acertainfile.txt", "Servermaxplayers", 50);
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)