[AJUDAA] Problema Com Dialog
#1

bom, o problema й que eu defini quem ja pode abrir o dialog... no comando
mбas..., qlq 1 tava conseguindo equipar, eu utilizava streamer
ou seja
new pEquipM;
OnGameModeInit
pEquipM = CreateDynamicObject(1318,x,y,z);
ai no OnPlayerPickup eu coloquei,
if(pickupid == pEquipM)
{
ShowPlayerDialog etc etc... nenhum warn e erro algum mбs todos estavam conseguindo equipar @_@
comofas ?
Code :
No OnPlayerCommandText D:
Quote:

if(strcmp(cmd, "/equipm", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(PlayerInfo[playerid][pMembro] == 1 || PlayerInfo[playerid][pLider] == 1)
{
if(PlayerToPoint(3.0,playerid,1529.82,-1661.18,6.22))
{
ShowPlayerDialog(playerid,666,DIALOG_STYLE_LIST,"E quipar PM","Cargo - 1\nCargo - 2\nCargo - 3\nCargo - 4\nCargo - 5\nCargo - 6","OK","Fechar");
}
else
{
SendClientMessage(playerid, COLOR_GRAD2, " Vocк nгo estб na HQ !");
return 1;
}
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, "Vocк Nгo й Da Policia Militar !");
}
}
return 1;
}

Agora no OnDialogResponse axo '-'
Quote:

if(dialogid == 666){

if(response){
if(listitem == 0){
GivePlayerWeapon(playerid, 3, 999);
GivePlayerWeapon(playerid, 22, 150);
GivePlayerWeapon(playerid, 41, 500);
GivePlayerWeapon(playerid, 25, 150);
SetPlayerHealth(playerid, 100);
SetPlayerArmour(playerid, 100);
}
if(listitem == 1){
GivePlayerWeapon(playerid, 3, 999); // cacetete D:
GivePlayerWeapon(playerid, 4, 200);
GivePlayerWeapon(playerid, 23, 150); // Silenciadora
GivePlayerWeapon(playerid, 24, 500); // EAGLE D:
GivePlayerWeapon(playerid, 25, 150); // DOZE D:
SetPlayerHealth(playerid, 100);
SetPlayerArmour(playerid, 100);
}
if(listitem == 2){
GivePlayerWeapon(playerid, 3, 999); // cacetete D:
GivePlayerWeapon(playerid, 4, 200);
GivePlayerWeapon(playerid, 23, 150); // Silenciadora
GivePlayerWeapon(playerid, 24, 500); // EAGLE D:
GivePlayerWeapon(playerid, 25, 150); // DOZE D:
GivePlayerWeapon(playerid, 29, 150);
SetPlayerHealth(playerid, 100);
SetPlayerArmour(playerid, 100);
}
if(listitem == 3){
GivePlayerWeapon(playerid, 3, 999); // cacetete D:
GivePlayerWeapon(playerid, 4, 200);
GivePlayerWeapon(playerid, 23, 150); // Silenciadora
GivePlayerWeapon(playerid, 24, 500); // EAGLE D:
GivePlayerWeapon(playerid, 25, 150); // DOZE D:
GivePlayerWeapon(playerid, 31, 200);
SetPlayerHealth(playerid, 100);
SetPlayerArmour(playerid, 100);
}
if(listitem == 4){
GivePlayerWeapon(playerid, 3, 999); // cacetete D:
GivePlayerWeapon(playerid, 4, 200);
GivePlayerWeapon(playerid, 23, 150); // Silenciadora
GivePlayerWeapon(playerid, 24, 500); // EAGLE D:
GivePlayerWeapon(playerid, 25, 150); // DOZE D:
GivePlayerWeapon(playerid, 31, 200);
SetPlayerHealth(playerid, 100);
SetPlayerArmour(playerid, 100);
}
if(listitem == 5){
GivePlayerWeapon(playerid, 3, 999); // cacetete D:
GivePlayerWeapon(playerid, 4, 200);
GivePlayerWeapon(playerid, 23, 150); // Silenciadora
GivePlayerWeapon(playerid, 24, 500); // EAGLE D:
GivePlayerWeapon(playerid, 25, 150); // DOZE D:
GivePlayerWeapon(playerid, 31, 200);
GivePlayerWeapon(playerid, 34, 200);
SetPlayerHealth(playerid, 100);
SetPlayerArmour(playerid, 100);
}
}
else{
}
}

Reply
#2

Coloca o:

Quote:

if(PlayerInfo[playerid][pMembro] == 1 || PlayerInfo[playerid][pLider] == 1)
{

Depois do if(listitem == 0){
Assim continua, no if(listitem == 1) { e assim vai !

Ou lб no OnPlayerPickup coloca assim depois do: if(pickupid == pEquipM) {

if(PlayerInfo[playerid][pMembro] == 1 || PlayerInfo[playerid][pLider] == 1)
{


Nгo te consegui dar um exemplo de como seria, porque б pagina ta lerda !
Reply
#3

Na verdade, vocк acabou colocando 2 jeitos de abrir o Dialog, poderia ser usando o comando ou ficando em cima do Нcone.


Bom, sendo o que for o cуdigo abaixo deve resolver o problema, e tente colocar sempre os cуdigos em [pawn ] e [/pawn], pois tive que colocar os cуdigos na forma "de lado".


Quote:

if(dialogid == 666 && IsACop(playerid)){

if(response){
if(listitem == 0){
GivePlayerWeapon(playerid, 3, 999);
GivePlayerWeapon(playerid, 22, 150);
GivePlayerWeapon(playerid, 41, 500);
GivePlayerWeapon(playerid, 25, 150);
SetPlayerHealth(playerid, 100);
SetPlayerArmour(playerid, 100);
}
if(listitem == 1){
GivePlayerWeapon(playerid, 3, 999); // cacetete D:
GivePlayerWeapon(playerid, 4, 200);
GivePlayerWeapon(playerid, 23, 150); // Silenciadora
GivePlayerWeapon(playerid, 24, 500); // EAGLE D:
GivePlayerWeapon(playerid, 25, 150); // DOZE D:
SetPlayerHealth(playerid, 100);
SetPlayerArmour(playerid, 100);
}
if(listitem == 2){
GivePlayerWeapon(playerid, 3, 999); // cacetete D:
GivePlayerWeapon(playerid, 4, 200);
GivePlayerWeapon(playerid, 23, 150); // Silenciadora
GivePlayerWeapon(playerid, 24, 500); // EAGLE D:
GivePlayerWeapon(playerid, 25, 150); // DOZE D:
GivePlayerWeapon(playerid, 29, 150);
SetPlayerHealth(playerid, 100);
SetPlayerArmour(playerid, 100);
}
if(listitem == 3){
GivePlayerWeapon(playerid, 3, 999); // cacetete D:
GivePlayerWeapon(playerid, 4, 200);
GivePlayerWeapon(playerid, 23, 150); // Silenciadora
GivePlayerWeapon(playerid, 24, 500); // EAGLE D:
GivePlayerWeapon(playerid, 25, 150); // DOZE D:
GivePlayerWeapon(playerid, 31, 200);
SetPlayerHealth(playerid, 100);
SetPlayerArmour(playerid, 100);
}
if(listitem == 4){
GivePlayerWeapon(playerid, 3, 999); // cacetete D:
GivePlayerWeapon(playerid, 4, 200);
GivePlayerWeapon(playerid, 23, 150); // Silenciadora
GivePlayerWeapon(playerid, 24, 500); // EAGLE D:
GivePlayerWeapon(playerid, 25, 150); // DOZE D:
GivePlayerWeapon(playerid, 31, 200);
SetPlayerHealth(playerid, 100);
SetPlayerArmour(playerid, 100);
}
if(listitem == 5){
GivePlayerWeapon(playerid, 3, 999); // cacetete D:
GivePlayerWeapon(playerid, 4, 200);
GivePlayerWeapon(playerid, 23, 150); // Silenciadora
GivePlayerWeapon(playerid, 24, 500); // EAGLE D:
GivePlayerWeapon(playerid, 25, 150); // DOZE D:
GivePlayerWeapon(playerid, 31, 200);
GivePlayerWeapon(playerid, 34, 200);
SetPlayerHealth(playerid, 100);
SetPlayerArmour(playerid, 100);
}
}
else{
}
}

Espero ter ajudado
Reply
#4

fiz de 1 metodo diferente, fiz o /equipm
com o comando reservado definido
etc..., PlayerToPoint, ai depois ShowPlayerDialog
ai no OnPlayerKeyStateChange

if((newkeys == 16))
{
if(gTeam[playerid] == 1 || IsACop(playerid) || IsAPre(playerid) || IsAPFx(playerid))
{
if(PlayerToPoint(8.0,playerid,1529.82,-1661.18,6.22))
OnPlayerCommandText(playerid,"/equipm");
}
}
return 0;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)