Code
ocmd:test(playerid,parmas[]){
new weapons[13][2];
new name[123];
for(new i = 0; i <=12; i++){
GetPlayerWeaponData(playerid, i, weapons[i][0], weapons[i][1]);
if(weapons[i][0] == 24){
if(weapons[i][1] != 0){
ammo = weapons[i][1]+1;
SetPlayerAmmo(playerid, weapons[i][0], ammo);
format(name,sizeof(name),"%s ammo: %i",getWeaponName(weapons[i][0]),weapons[i][1]);
SendClientMessage(playerid,0x00FFFAFF,name);
}else{
GivePlayerWeapon(playerid, 24,1);
}
}
}
return 1;
}
stock getWeaponName(id){
new name[123];
switch(id){
case 24:{name="Deagle";}
}
return name;
}
Alles anzeigen
ps. einfach weapons[i][0] benutzen dann kommt die id