01.10.2016, 14:33
(
Последний раз редактировалось Nikkel; 01.10.2016 в 16:33.
)
Para armazenar palavras/texto em variбveis tens de usar Strmid
Onde tens: IDArmas[MAX_PLAYERS];
Escreve por baixo isto: NomeArmas[24][MAX_PLAYERS];
PHP код:
strmid(NomeArmas[playerid], "Nome da Arma", 0, 24, 24); // 24 <-- Muda o valor se o nome das armas sгo maiores que isto.
PHP код:
case 0:
{
IDArmas[playerid] = 24;
strmid(NomeArmas[playerid], "Desert Eagle", 0, 24, 24);
//ShowPlayerDialog ( playerid, QUANTIDADE_BALAS, DIALOG_STYLE_INPUT, "Balas para Desert Eagle" , "Digite a quantidade de balas:" , "Comprar" , "Cancelar" ) ;
}
case 1:
{
IDArmas[playerid] = 23;
strmid(NomeArmas[playerid], "9mm Silencioso", 0, 24, 24);
//ShowPlayerDialog ( playerid, QUANTIDADE_BALAS, DIALOG_STYLE_INPUT, "Balas para Pistola C/ Silenciador" , "Digite a quantidade de balas:" , "Comprar" , "Cancelar" ) ;
}
PHP код:
GivePlayerWeapon(playerid, IDArmas[playerid], strval(inputtext));
GivePlayerMoney(playerid, -PrecoFinal);
format(string, sizeof(string), "Vocк comprou uma %s com %i muniзхes por $%i!", NomeArmas[playerid], strval(inputtext), PrecoFinal);
SendClientMessage(playerid, -1, string);
ShowPlayerDialog(playerid, OBTER_ARMAS, DIALOG_STYLE_TABLIST_HEADERS, "Compra de Armas",
"CATEGORIA\t\t$POR BALA\nDesert Eagle\t\t$4,00\nPistola C/ Silenciador\t\t$4,00\nMP5\t\t$4,00\nShotgun\t\t$4,00\nAK-47\t\t$4,00\nM4\t\t$4,00\nRifle\t\t$4,00",
"Selecionar", "Cancelar");
Escreve por baixo isto: NomeArmas[24][MAX_PLAYERS];