02.03.2013, 16:01
Como faзo para hospedar quantas balas da eagle que o player tem na mгo em uma variavel?
Obrigado a todos.
Obrigado a todos.
new Balas[1];
GetPlayerWeaponData(playerid, 2, 24, Balas[0]);
error 035: argument type mismatch (argument 3)
https://sampwiki.blast.hk/wiki/GetPlayerAmmo eu acho que й essa funзгo.
|
playerid The ID of the player whose weapon data you wish to retrieve
slot The weapon slot to get data for (0-12)
&weapons Variable to store the weapon ID, passed by reference
&ammo Variable to store the ammo, passed by reference
new Arma[13][2] ;
for(new i = 0; i != 13; i++)
{
GetPlayerWeaponData(playerid,i,Arma[i][0],Arma[i][1]);
}
CMD:balaseagle(playerid) {
new
Arma,
pStr[35],
Bala
;
GetPlayerWeaponData(playerid, 2, Arma, Bala);
if ( Arma == 22 ) {
format(pStr, 35, "Vocк tem %i balas de eagle!", Bala);
SendClientMessage(playerid, -1, pStr);
}
else
SendClientMessage(playerid, -1, "Vocк nгo tem uma eagle!");
return true;
}
new bala1,bala2,bala3,bala4;
GetPlayerWeaponData(playerid, 2, 24, bala1);
GetPlayerWeaponData(playerid, 3, 25, bala2);
GetPlayerWeaponData(playerid, 5, 31, bala3);
GetPlayerWeaponData(playerid, 6, 34, bala4);
pDados[playerid][Eagle] = bala1;
pDados[playerid][M4] = bala2;
pDados[playerid][Shot] = bala3;
pDados[playerid][Sniper] = bala4;
GetPlayerWeaponData(playerid, 2, Arma, Bala);