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;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == Gunrack)
{
new gunid = GetPlayerWeapon(playerid);
new ammo = GetPlayerAmmo(playerid);
new i = GetPlayerVehicleID(playerid);
new armaid;
new valormunicao;
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)
{
armaid = GunRackInfo[i][gWeapon1];
valormunicao = GunRackInfo[i][gAmmo1];
SendClientMessage(playerid,COLOR_WHITE, "Vocк pegou sua arma mo gunrack.");
GivePlayerWeapon(playerid, armaid, valormunicao);
return 1;
}
}
}
return 0;
}
Testa e ve se funciona
PHP код:
|
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == Gunrack)
{
new gunid[MAX_PLAYERS] = GetPlayerWeapon(playerid);
new ammo[MAX_PLAYERS] = 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[playerid];
GunRackInfo[i][gAmmo1] = ammo[playerid];
RemovePlayerWeapon(playerid, gunid);
SendClientMessage(playerid,COLOR_WHITE, "Vocк colocou sua arma no gunrack.");
}
if(listitem == 1)
{
SendClientMessage(playerid,COLOR_WHITE, "Vocк pegou sua arma mo gunrack.");
GivePlayerWeapon(playerid, gunid[playerid], ammo[playerid]);
return 1;
}
}
}
return 0;
}
Teste isso :
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)
{
SendClientMessage(playerid,COLOR_WHITE, "Vocк pegou sua arma mo gunrack.");
GivePlayerWeapon(playerid, gunid, ammo);
return 1;
}
}
}
return 0;
}
hmmm. tenta isso entao
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)
{
new armaid = GunRackInfo[i][gWeapon1];
new valormunicao = GunRackInfo[i][gAmmo1];
SendClientMessage(playerid,COLOR_WHITE, "Vocк pegou sua arma mo gunrack.");
GivePlayerWeapon(playerid, armaid, valormunicao);
return 1;
}
}
}
return 0;
}
Tenta desse Jeito
PHP код:
|