05.03.2016, 13:44
Oi pessoal, entгo, estou fazendo um gunrack, porйm estou tendo um problema, ele estб colocando a arma no mesmo, porйm nгo estб pegando.
Aonde estб o erro?
PS: listitem 0 = Colocar | listitem 1 = Pegar
PHP код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == Gunrack)
{
new gunid = GetPlayerWeapon(playerid);
new ammo = GetPlayerAmmo(playerid);
new i = GetPlayerVehicleID(playerid);
if (response)
{
if(listitem == 0 && gunid != 0)
{
if(GunRackInfo[i][gWeapon1] != 0)
{
SendClientMessage(playerid, COLOR_ERROR, "Jб existe uma arma no slot selecionado.");
return 1;
}
if(gunid == 0)
{
SendClientMessage(playerid, COLOR_ERROR, "Escolha sua arma que deseja colocar no gunrack.");
return 1;
}
GunRackInfo[i][gWeapon1] = gunid;
GunRackInfo[i][gAmmo1] = ammo;
RemovePlayerWeapon(playerid, gunid);
SendClientMessage(playerid,COLOR_WHITE, "Vocк colocou sua arma no gunrack.");
}
if(listitem == 1)
{
GunRackInfo[i][gWeapon1] = gunid;
GunRackInfo[i][gAmmo1] = ammo;
SendClientMessage(playerid,COLOR_WHITE, "Vocк pegou sua arma mo gunrack.");
GivePlayerWeapon(playerid, GunRackInfo[i][gWeapon1], GunRackInfo[i][gAmmo1]);
return 1;
}
}
}
return 0;
}
PS: listitem 0 = Colocar | listitem 1 = Pegar