if (strcmp(cmd,"/municao", true) == 0)
{
new s[128];
new arma[13][2];
for (new i = 0; i < 13; i++)
{
GetPlayerWeaponData(playerid, 1, arma[i][0], arma[i][1]);
if(arma[i][1] != 0)
{
format(s,60,"Vocк tem %d balas", arma[i][1]);
SendClientMessage(playerid,0xC2A2DA,s);
}
else
{
SendClientMessage(playerid, 0xFF0000FF, "Vocк nao tem municao.");
}
return 1;
}
}
if (strcmp(cmd,"/municao", true) == 0)
{
new s[128];
new arma;
new balas;
for (new i = 0; i < 13; i++)
{
GetPlayerWeaponData(playerid, 1, arma, balas);
if(arma[i][1] != 0)
{
format(s,60,"Vocк tem %i balas", balas);
SendClientMessage(playerid,0xC2A2DA,s);
}
else
{
SendClientMessage(playerid, 0xFF0000FF, "Vocк nao tem municao.");
}
return 1;
}
}
if (strcmp(cmd,"/municao", true) == 0)
{
new s[128];
new arma;
new balas;
for (new i = 0; i < 13; i++)
{
GetPlayerWeaponData(playerid, 1, arma, balas);
if(balas != 0)
{
format(s,60,"Vocк tem %i balas", balas);
SendClientMessage(playerid,0xC2A2DA,s);
}
else
{
SendClientMessage(playerid, 0xFF0000FF, "Vocк nao tem municao.");
}
return 1;
}
}
CMD:balas(playerid)
{
new var = GetPlayerAmmo(playerid);
new var2[28];
format(var2, sizeof(var2)," Vocк tem %i balas", var);
SendClientMessage(playerid, -1, var2);
return 1;
}
@Coe1
Vou tentar, se funfar edito.. @edit nгo era bem isso que eu queria. Queria usando o GetPlayerWeaponData.. |
CMD:arma(playerid)
{
new weapons[13][2],string[20],string2[20];
for (new i = 0; i < 13; i++)
{
GetPlayerWeaponData(playerid, i, weapons[i][0], weapons[i][1]);
format(string,sizeof(string),"Arma - %d",weapons[i][0]);
format(string2,sizeof(string2),"Municao - %d",weapons[i][1]);
}
SendClientMessage(playerid, -1, string);
SendClientMessage(playerid, -1, string2);
return 1;
}