[Pedido] Carregar armas da org por um arquivo
#1

Alguem pode me mandar um script assim que equpe a todos da org, pode ser resumido sу pra ter uma base de como ficaria o code na hora de carregar o arquivo e equipar, porfavor
Reply
#2

Use a funзгo Fread.

Код:
// Open "file.txt" in "read only" mode
new File:handle = fopen("file.txt", io_read),
 
	// Initialize "buf"
	buf[128];
 
// Check, if the file is opened
if(handle)
{
	// Success
 
	// Read the whole file
	while(fread(handle, buf)) print(buf);
 
	// Close the file
	fclose(handle);
}
else
{
	// Error
	print("The file \"file.txt\" does not exists, or can't be opened.");
Reply
#3

problema maior agr й na hora de equipar, tipo como coloco isso junto a setplayerweapon e carrego as armas que coloquei no arquivo
Reply
#4

Alguem pode ajudar?
Reply
#5

https://sampforum.blast.hk/showthread.php?tid=597294

Salvamento

pawn Код:
bCini6_SetInt("Armas ORG.ini","Arma 1",ORG_Arma_1);
bCini6_SetInt("Armas ORG.ini","Balas arma 1",ORG_Arma_1);
bCini6_SetInt("Armas ORG.ini","Arma 2",ORG_Arma_2);
bCini6_SetInt("Armas ORG.ini","Balas arma 2",ORG_Arma_1);
bCini6_SetInt("Armas ORG.ini","Arma 3",ORG_Arma_3);
bCini6_SetInt("Armas ORG.ini","Balas arma 3",ORG_Arma_1);
Carregamento

pawn Код:
GivePlayerWeapon(playerid,bCini6_ReadInt("Armas ORG.ini","Arma 1"),bCini6_ReadInt("Armas ORG.ini","Balas arma 1"));
GivePlayerWeapon(playerid,bCini6_ReadInt("Armas ORG.ini","Arma 2"),bCini6_ReadInt("Armas ORG.ini","Balas arma 2"));
GivePlayerWeapon(playerid,bCini6_ReadInt("Armas ORG.ini","Arma 3"),bCini6_ReadInt("Armas ORG.ini","Balas arma 3"));
A lуgica tб aн, agora й sу adaptar ao seu gm.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)