ShowPlayerDialog problem
#1

Hey guyz,

i got a problem:

the dialog i posted below will not be shown when i get into the pickup, but pawno compiles it correctly.

Код:
forward PickupChanger(playerid);
public PickupChanger(playerid)
{
	if(/*pickupid == changepick && */ShowAgain[playerid] == 1)
	{
	    new string[256];
	    if(PlayerInfo[playerid][pLevel] < 5) format(string, 256, "{FFFFFF}Hunter\t\t{FFFFFF}Level 1\n{FFFFFF}Guardian\t{FF0000}Level 5\n{FFFFFF}Assassin\t{FF0000}Level 7\n{FFFFFF}Sniper\t\t{FF0000}Level 10{FFFFFF}\nPriest\t{FFFF00}Level 12");
	    else if(PlayerInfo[playerid][pLevel] < 7) format(string, 256, "{FFFFFF}Hunter\t\t{FFFFFF}Level 1\n{FFFFFF}Guardian\t{FFFFFF}Level 5\n{FFFFFF}Assassin\t{FF0000}Level 7\n{FFFFFF}Sniper\t\t{FF0000}Level 10{FFFFFF}\nPriest\t{FFFF00}Level 12");
	    else if(PlayerInfo[playerid][pLevel] <10) format(string, 256, "Hunter\t\tLevel 1\nGuardian\tLevel 5\nAssassin\tLevel 7\nSniper\t\t{FF0000}Level 10{FFFFFF}\nPriest\t{FFFF00}Level 12");
	    else if(PlayerInfo[playerid][pLevel] <12) format(string, 256, "{FFFFFF}Hunter\t\tLevel 1\nGuardian\tLevel 5\nAssassin\tLevel 7\nSniper\t\tLevel 10\nPriest\t{FFFF00}Level 12");
	    ShowPlayerDialog(playerid, 2008, 2, "Class Changer", string, "Accept", "Cancel");
	    ShowAgain[playerid] = 0;
	}
	return 1;
}
anyone knows?

my OnPlayerPickupPickUp:

Код:
public OnPlayerPickUpPickup(playerid, pickupid)
{
	if(pickupid == changepick)
	{
	    PickupChanger(playerid);
	}
	else if(pickupid == shoppick)
	{
		PickupShop(playerid);
	}
	else if(pickupid == upgradepick)
	{
		PickupUpgrade(playerid);
	}
	else if(pickupid == armourpick)
	{
	    ArmourUpgrader(playerid);
	}
	return 1;
}
Reply
#2

Do You put it on OnPlayerPickUpPickup
Reply
#3

sure
Reply
#4

If everything else you have done is correct, then the problem is possibly here:

ShowPlayerDialog(playerid, 2008, 2, "Class Changer", string, "Accept", "Cancel");
Maybe it's interfering with other dialog ids.

Try this:

pawn Код:
// On top of your script:
#define DIALOG_CLASS_CHANGER 1245
//1245 or any random number

//In your code:
ShowPlayerDialog(playerid, DIALOG_CLASS_CHANGER , 2, "Class Changer", string, "Accept", "Cancel");

//In OnDialogResponse:
case DIALOG_CLASS_CHANGER: {
// Your things here..
}
Reply
#5

nope i got only 1 dialog with id 2008
Reply
#6

The DialogID can be interfering and in Filterscripts, not only in gamemode.
Reply
#7

Show your OnPlayerPickUpPickup.
Reply
#8

edited first post
Reply
#9

Where do you set ShowAgain[playerid] ?
Reply
#10

Under OnPlayerSpawn, it will be set to 1.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)