06.06.2015, 19:43
Good day! need some help urgently, I have a code below to check weapons a player, more is not showing the name of arms, someone has a solution to the problem? or code that has been done here in the forum, an issue that has been resolved here in the forum, is not showing the name of guns, only random numbers .. follows the code below:
PHP код:
stock Weapon_Name(Arma_ID)
{
new Arma[30];
switch(Arma_ID) {
case 1: Arma = "Soco Inglкs";
case 2: Arma = "Taco de Golfe";
case 3: Arma = "Cacetete";
case 4: Arma = "Faca";
case 5: Arma = "Taco de Beisebol";
case 6: Arma = "Pб";
case 7: Arma = "Taco de Sinuca";
case 8: Arma = "Katana";
case 9: Arma = "Serra Elйtrica";
case 10: Arma = "Pкnis De Borracha";
case 11: Arma = "Vibrador";
case 12: Arma = "Vibrador";
case 13: Arma = "Vibrador";
case 14: Arma = "Buquк de Flores";
case 15: Arma = "Bengala";
case 16: Arma = "Granada";
case 17: Arma = "Granada de Gбs";
case 18: Arma = "Motolov";
case 22: Arma = "Pistola 9mm";
case 23: Arma = "Pistola 9mm com Silenciador";
case 24: Arma = "Pistola Desert Eagle";
case 25: Arma = "Calibre-12";
case 26: Arma = "Shotgun Cano Cerrado";
case 27: Arma = "Combat Shotgun";
case 28: Arma = "Metralhadora Micro SMG/Uzi";
case 29: Arma = "Metralhadora MP5";
case 30: Arma = "Fuzil AK-47";
case 31: Arma = "Fuzil M4";
case 32: Arma = "Metralhadora Tec-9";
case 33: Arma = "Country Rifle";
case 34: Arma = "Sniper Rifle";
case 35: Arma = "Bazuca RPG";
case 36: Arma = "Bazuca de Alvo";
case 37: Arma = "Lanзa-Chamas";
case 38: Arma = "Minigun";
case 39: Arma = "Carga Explosiva";
case 40: Arma = "Detonador";
case 41: Arma = "Lata de Spray";
case 42: Arma = "Extintor";
case 43: Arma = "Cвmara Fotogrбfica";
case 44: Arma = "Уculos de Visгo Noturna";
case 45: Arma = "Уculos de proteзгo tйrmica";
case 46: Arma = "Pбra-quedas";
default: Arma = "Desconhecido";
}
return Arma;
}
if (strcmp(cmd, "/checkweapons", true) == 0 || strcmp(cmd, "/checkw", true) == 0)
{
if (IsPlayerConnected(playerid))
{
if (PlayerInfo[playerid][pAdmin] < 0)
{
return SendClientMessage(playerid, COLOR_GRAD1, "ERRO: Vocк nгo tem nнvel administrativo suficiente.");
}
if (PlayerInfo[playerid][pAdminStats] != 0 && PlayerInfo[playerid][pAdmin] <= 5)
{
return SendClientMessage(playerid, COLOR_GRAD1, "ERRO: Vocк nгo estб no modo admin! (/trabalhar)");
}
temp2 = strtok(cmdtext, idx);
if (!strlen(temp2))
{
return SendClientMessage(playerid, -1, "USE: (/checkw)eapons [ID/Nome]");
}
new targetid = ReturnUser(temp2);
if (targetid == INVALID_PLAYER_ID)
{
return SendClientMessage(playerid, COLOR_GRAD1, "ERRO: ID/Nome Invбlido.");
}
new weapons[2][13];
SendClientMessage(playerid, COLOR_ADMIN_INFO, "===========================");
format(string, sizeof(string), "Armas de %s:", GetPlayerNameRP(targetid));
SendClientMessage(playerid, COLOR_GRAD1, string);
for (new i = 0; i <= 12; i++)
{
GetPlayerWeaponData(targetid, i, weapons[0][i], weapons[1][i]);
if (weapons[0][i] != 0)
{
format(string, sizeof(string), "Slot: %d (%d) Muniзгo: %d", i, Weapon_Name(weapons[0][i]), weapons[1][i]);
SendClientMessage(playerid, -1, string);
}
}
}
return true;
}