if(dialogid == guardaritens)
{
new arquivo[60], name[MAX_PLAYER_NAME];
if(DOF2_FileExists(arquivo)) //Verifica se a pasta existe
{
GetPlayerName(playerid, name, 32); //Para pegar o nome do playerid
format(arquivo, 40, "inventario/%s.ini", name);
DOF2_SetInt(arquivo, "eagle", Player[playerid][eagle]); //Vai salvar a eagle
DOF2_SetInt(arquivo, "shotgun", Player[playerid][shotgun]); //Vai salvar shot
DOF2_SetInt(arquivo, "mp5", Player[playerid][mp5]); //Vai salvar mp5
DOF2_SetInt(arquivo, "m4", Player[playerid][m4]); //Vai salvar m4
DOF2_SetInt(arquivo, "ak47", Player[playerid][ak47]); //Vai salvar ak47
DOF2_SaveFile(); //E finalmente salvando o arquivo, sem essa funзгo o arquivo nгo serб salvo!
return 1;
}else{
GetPlayerName(playerid, name, 32); //Para pegar o nome do playerid
format(arquivo, 40, "inventario/%s.ini", name);
DOF2_CreateFile(arquivo); //Vai criar o arquvivo na pasta inventario
DOF2_SetInt(arquivo, "eagle", Player[playerid][eagle]); //Vai salvar a eagle
DOF2_SetInt(arquivo, "shotgun", Player[playerid][shotgun]); //Vai salvar shot
DOF2_SetInt(arquivo, "mp5", Player[playerid][mp5]); //Vai salvar mp5
DOF2_SetInt(arquivo, "m4", Player[playerid][m4]); //Vai salvar m4
DOF2_SetInt(arquivo, "ak47", Player[playerid][ak47]); //Vai salvar ak47
DOF2_SaveFile(); //E finalmente salvando o arquivo, sem essa funзгo o arquivo nгo serб salvo!
return 1;
}
if(response)
{
if(listitem == 0)
{
balas[playerid] = GetPlayerAmmo(playerid);
DOF2_SetInt(arquivo, "eagle", balas[playerid]);
DOF2_SaveFile();
}
if(listitem == 1)
{
return 1;
}
if(listitem == 2)
{
return 1;
}
if(listitem == 3)
return 1;
}
if(listitem == 4)
{
return 1;
}
}
return 1;
}
new ammo = GetPlayerAmmo(playerid);
new infoString[16];
format(infoString, sizeof(infoString), "%s", ammo);
DOF2_SetInt(arquivo, "eagle", infoString);
O Certo seria:
pawn Код:
|
O Certo seria:
pawn Код:
https://sampwiki.blast.hk/wiki/GetPlayerAmmo https://sampwiki.blast.hk/wiki/GetPlayerWeaponData |
Й GetPlayerAmmo, mas tambйm tem GetPlayerWeaponData.
Olha um exemplo de inventбrio: link Crйditos: Axll |
if(dialogid == guardaritens)
{
if(response)
{
if(listitem == 0)
{
new arquivo[60], name[MAX_PLAYER_NAME];
if(DOF2_FileExists(arquivo)) //Verifica se a pasta existe
{
GetPlayerName(playerid, name, 32); //Para pegar o nome do playerid
format(arquivo, 40, "inventario/%s.ini", name);
DOF2_SetInt(arquivo, "eagle", Player[playerid][eagle]); //Vai salvar a eagle
DOF2_SetInt(arquivo, "shotgun", Player[playerid][shotgun]); //Vai salvar shot
DOF2_SetInt(arquivo, "mp5", Player[playerid][mp5]); //Vai salvar mp5
DOF2_SetInt(arquivo, "m4", Player[playerid][m4]); //Vai salvar m4
DOF2_SetInt(arquivo, "ak47", Player[playerid][ak47]);
DOF2_SaveFile(); //E finalmente salvando o arquivo, sem essa funзгo o arquivo nгo serб salvo!
return 1;
}else{
GetPlayerName(playerid, name, 32); //Para pegar o nome do playerid
format(arquivo, 40, "inventario/%s.ini", name);
DOF2_CreateFile(arquivo); //Vai criar o arquvivo na pasta inventario
DOF2_SetInt(arquivo, "eagle", Player[playerid][eagle]); //Vai salvar a eagle
DOF2_SetInt(arquivo, "shotgun", Player[playerid][shotgun]); //Vai salvar shot
DOF2_SetInt(arquivo, "mp5", Player[playerid][mp5]); //Vai salvar mp5
DOF2_SetInt(arquivo, "m4", Player[playerid][m4]); //Vai salvar m4
DOF2_SetInt(arquivo, "ak47", Player[playerid][ak47]); //Vai salvar ak47
DOF2_SaveFile(); //E finalmente salvando o arquivo, sem essa funзгo o arquivo nгo serб salvo!
balas[playerid] = GetPlayerAmmo(playerid);
DOF2_SetInt(arquivo, "eagle", balas[playerid]);
DOF2_SaveFile();
return 1;
}
}
if(listitem == 1)
{
return 1;
}
if(listitem == 2)
{
return 1;
}