Jump to content
  • 0

pomoc [HELP] Problém zo šatníkom cez dialog


DaDo_TO

Dotaz

Zdravím mám problém mám spravené šatne pre určité zložky keď do nejakej tej šatne vstúpim dialog som sa mi zobrazí ale ako náhle si chcem nastaviť nejaký skin alebo zobrať zbraň tak mi to nenastaví . Za pomoc a radu ďakujem 
Tu je kód :
 

public OnGameModeInit()
{
    pichazzsatnik = CreatePickup(1275, 1, 2035.5431,-2098.3115,13.5469,-1);
    picpzsrsatnik = CreatePickup(1275,  1, 1462.9403,-1766.0197,3285.2859,-1);
    piczzssatnik = CreatePickup(1275, 1, 1026.1835,-1088.8015,23.8349,-1);
    //******************************************************************************

	return 1;
}

    public OnPlayerPickUpPickup(playerid, pickupid)
{
    if(pickupid == pichazzsatnik) {
	ShowPlayerDialog(playerid, 150, DIALOG_STYLE_LIST,"HaZZ Šatňa","Veliteľ\nVeliteľ z ADP\nHasič\nHasič z ADP\nChemický oblek OPCH\nOblek proti sálavému teplu\nPotápač\nSekera\nHasiací prístroj\nMotorová píla","Obliecť","Zrušit");
	}
    if(pickupid == picpzsrsatnik) {
	ShowPlayerDialog(playerid, 158, DIALOG_STYLE_LIST,"PZSR Šatňa","Policajt\nDopravný policajt\nPištol\nAK-47","Obliecť","Zrušit");
	}
    if(pickupid == piczzssatnik) {
	ShowPlayerDialog(playerid, 155, DIALOG_STYLE_LIST,"ZZS Šatňa","Doktor\nBatoh","Obliecť","Zrušit");
	return 1;
	}
}

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == 150)
{
if(response) // ľavé tlačítko, pre pravé daj 0
{
if(listitem == 0)
{
SetPlayerSkin(playerid, 277);//z ADP
}
else if(listitem == 1)
{
SetPlayerSkin(playerid, 279);//bez AP
}
else if(listitem == 2)
{
SetPlayerSkin(playerid, 278); //VZ
}
else if(listitem == 3)
{
GivePlayerWeapon(playerid, 42,500000); // zbran 1
}
else if(listitem == 4)
{
GivePlayerWeapon(playerid, 9,50000); //zbran 2
}
else if(listitem == 5)
{
SetPlayerSkin(playerid, 273); //skin 273
}
}
}
if(dialogid == 155)
{
if(response) // ľavé tlačítko, pre pravé daj 0
{
if(listitem == 0)
{
SetPlayerSkin(playerid, 274);//ZZS
}
else if(listitem == 1)
{
GivePlayerWeapon(playerid, 43,50000); //zbran 2
}
}
}
if(dialogid == 158)
{
if(response) // ľavé tlačítko, pre pravé daj 0
{
if(listitem == 0)
{
SetPlayerSkin(playerid, 286);//DP
}
else if(listitem == 1)
{
SetPlayerSkin(playerid, 281);//normal
}
else if(listitem == 2)
{
GivePlayerWeapon(playerid, 24,50000); //zbran 2
}
}
}
return 1;
}
Link to comment
Share on other sites

14 odpovědí na tuto otázku

Recommended Posts

  • 0

Příšerná úprava, kdo se v tom má vyznat
Zkus toto:

 

public OnGameModeInit()
{
    pichazzsatnik = CreatePickup(1275, 1, 2035.5431, -2098.3115,   13.5469, -1);
    picpzsrsatnik = CreatePickup(1275, 1, 1462.9403, -1766.0197, 3285.2859, -1);
    piczzssatnik  = CreatePickup(1275, 1, 1026.1835, -1088.8015,   23.8349, -1);
    //**************************************************************************
	return 1;
}

public OnPlayerPickUpPickup(playerid, pickupid)
{
	switch(pickupid)
	{
	    case pichazzsatnik: ShowPlayerDialog(playerid, 150, DIALOG_STYLE_LIST, "HaZZ Šatňa", "Veliteľ\nVeliteľ z ADP\nHasič\nHasič z ADP\nChemický oblek OPCH\nOblek proti sálavému teplu\nPotápač\nSekera\nHasiací prístroj\nMotorová píla", "Obliecť", "Zrušit");
    	case picpzsrsatnik: ShowPlayerDialog(playerid, 158, DIALOG_STYLE_LIST, "PZSR Šatňa", "Policajt\nDopravný policajt\nPištol\nAK-47", "Obliecť", "Zrušit");
    	case piczzssatnik:  ShowPlayerDialog(playerid, 155, DIALOG_STYLE_LIST, "ZZS Šatňa", "Doktor\nBatoh", "Obliecť", "Zrušit");
	}
	return 1;
}

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
	switch(dialogid)
	{
	    case 150:
	    {
	        if(!response) return 1; //Pravé tlačítko ne
	        switch(listitem)
	        {
	            case 0: SetPlayerSkin(playerid, 277); //z ADP
	            case 1: SetPlayerSkin(playerid, 279); //bez AP
	            case 2: SetPlayerSkin(playerid, 278); //VZ
	            case 3: GivePlayerWeapon(playerid, 42, 500000); //zbran 1
	            case 4: GivePlayerWeapon(playerid, 9, 50000); //zbran 2
	            case 5: SetPlayerSkin(playerid, 273); //skin 273
	        }
	        return 1;
	    }
	    case 155:
	    {
	        if(!response) return 1; //Pravé tlačítko ne
	        switch(listitem)
	        {
	            case 0: SetPlayerSkin(playerid, 274); //ZZS
	            case 1: GivePlayerWeapon(playerid, 43, 50000); //zbran 2
	        }
	        return 1;
	    }
	    case 158:
	    {
	        if(!response) return 1; //Pravé tlačítko ne
	        switch(listitem)
	        {
	            case 0: SetPlayerSkin(playerid, 286); //DP
	            case 1: SetPlayerSkin(playerid, 281); //normal
	            case 2: GivePlayerWeapon(playerid, 24, 50000); //zbran 2
	        }
	        return 1;
	    }
	}
	return 1;
}
Link to comment
Share on other sites

  • 0

 

Příšerná úprava, kdo se v tom má vyznat

Zkus toto:

 

 

public OnGameModeInit()
{
    pichazzsatnik = CreatePickup(1275, 1, 2035.5431, -2098.3115,   13.5469, -1);
    picpzsrsatnik = CreatePickup(1275, 1, 1462.9403, -1766.0197, 3285.2859, -1);
    piczzssatnik  = CreatePickup(1275, 1, 1026.1835, -1088.8015,   23.8349, -1);
    //**************************************************************************
	return 1;
}

public OnPlayerPickUpPickup(playerid, pickupid)
{
	switch(pickupid)
	{
	    case pichazzsatnik: ShowPlayerDialog(playerid, 150, DIALOG_STYLE_LIST, "HaZZ Šatňa", "Veliteľ\nVeliteľ z ADP\nHasič\nHasič z ADP\nChemický oblek OPCH\nOblek proti sálavému teplu\nPotápač\nSekera\nHasiací prístroj\nMotorová píla", "Obliecť", "Zrušit");
    	case picpzsrsatnik: ShowPlayerDialog(playerid, 158, DIALOG_STYLE_LIST, "PZSR Šatňa", "Policajt\nDopravný policajt\nPištol\nAK-47", "Obliecť", "Zrušit");
    	case piczzssatnik:  ShowPlayerDialog(playerid, 155, DIALOG_STYLE_LIST, "ZZS Šatňa", "Doktor\nBatoh", "Obliecť", "Zrušit");
	}
	return 1;
}

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
	switch(dialogid)
	{
	    case 150:
	    {
	        if(!response) return 1; //Pravé tlačítko ne
	        switch(listitem)
	        {
	            case 0: SetPlayerSkin(playerid, 277); //z ADP
	            case 1: SetPlayerSkin(playerid, 279); //bez AP
	            case 2: SetPlayerSkin(playerid, 278); //VZ
	            case 3: GivePlayerWeapon(playerid, 42, 500000); //zbran 1
	            case 4: GivePlayerWeapon(playerid, 9, 50000); //zbran 2
	            case 5: SetPlayerSkin(playerid, 273); //skin 273
	        }
	        return 1;
	    }
	    case 155:
	    {
	        if(!response) return 1; //Pravé tlačítko ne
	        switch(listitem)
	        {
	            case 0: SetPlayerSkin(playerid, 274); //ZZS
	            case 1: GivePlayerWeapon(playerid, 43, 50000); //zbran 2
	        }
	        return 1;
	    }
	    case 158:
	    {
	        if(!response) return 1; //Pravé tlačítko ne
	        switch(listitem)
	        {
	            case 0: SetPlayerSkin(playerid, 286); //DP
	            case 1: SetPlayerSkin(playerid, 281); //normal
	            case 2: GivePlayerWeapon(playerid, 24, 50000); //zbran 2
	        }
	        return 1;
	    }
	}
	return 1;
}

a skoušel jsi jestli ti to jde ? :DD

Link to comment
Share on other sites

  • 0


C:\Users\Uzivatel\Desktop\Priečinok\satnik.pwn(167) : error 008: must be a constant expression; assumed zero
C:\Users\Uzivatel\Desktop\Priečinok\satnik.pwn(168) : error 008: must be a constant expression; assumed zero
C:\Users\Uzivatel\Desktop\Priečinok\satnik.pwn(169) : error 008: must be a constant expression; assumed zero
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase


3 Errors.


switch(pickupid)
{
case pichazzsatnik: ShowPlayerDialog(playerid, 150, DIALOG_STYLE_LIST, "HaZZ Šatňa", "Veliteľ\nVeliteľ z ADP\nHasič\nHasič z ADP\nChemický oblek OPCH\nOblek proti sálavému teplu\nPotápač\nSekera\nHasiací prístroj\nMotorová píla", "Obliecť", "Zrušit");
case picpzsrsatnik: ShowPlayerDialog(playerid, 158, DIALOG_STYLE_LIST, "PZSR Šatňa", "Policajt\nDopravný policajt\nPištol\nAK-47", "Obliecť", "Zrušit");
case piczzssatnik: ShowPlayerDialog(playerid, 155, DIALOG_STYLE_LIST, "ZZS Šatňa", "Doktor\nBatoh", "Obliecť", "Zrušit");
}
return 1;
}
Link to comment
Share on other sites

  • 0

Stále error ja už neviem 

--

Nemožné.

Úprava: Tu máš funkčný kód, kde som spravil to, čo si mal spraviť ty podla mojej rady.

 

 

#include <a_samp>
new pichazzsatnik;
new picpzsrsatnik;
new piczzssatnik;

public OnGameModeInit()
{
    pichazzsatnik = CreatePickup(1275, 1, 2035.5431, -2098.3115,   13.5469, -1);
    picpzsrsatnik = CreatePickup(1275, 1, 1462.9403, -1766.0197, 3285.2859, -1);
    piczzssatnik  = CreatePickup(1275, 1, 1026.1835, -1088.8015,   23.8349, -1);
    //**************************************************************************
	return 1;
}

public OnPlayerPickUpPickup(playerid, pickupid)
{
	if (pickupid == pichazzsatnik) ShowPlayerDialog(playerid, 150, DIALOG_STYLE_LIST, "HaZZ Šatňa", "Veliteľ\nVeliteľ z ADP\nHasič\nHasič z ADP\nChemický oblek OPCH\nOblek proti sálavému teplu\nPotápač\nSekera\nHasiací prístroj\nMotorová píla", "Obliecť", "Zrušit");
    else if (pickupid == picpzsrsatnik) ShowPlayerDialog(playerid, 158, DIALOG_STYLE_LIST, "PZSR Šatňa", "Policajt\nDopravný policajt\nPištol\nAK-47", "Obliecť", "Zrušit");
    else if (pickupid == piczzssatnik)  ShowPlayerDialog(playerid, 155, DIALOG_STYLE_LIST, "ZZS Šatňa", "Doktor\nBatoh", "Obliecť", "Zrušit");
	return 1;
}

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
	switch(dialogid)
	{
	    case 150:
	    {
	        if(!response) return 1; //Pravé tlačítko ne
	        switch(listitem)
	        {
	            case 0: SetPlayerSkin(playerid, 277); //z ADP
	            case 1: SetPlayerSkin(playerid, 279); //bez AP
	            case 2: SetPlayerSkin(playerid, 278); //VZ
	            case 3: GivePlayerWeapon(playerid, 42, 500000); //zbran 1
	            case 4: GivePlayerWeapon(playerid, 9, 50000); //zbran 2
	            case 5: SetPlayerSkin(playerid, 273); //skin 273
	        }
	        return 1;
	    }
	    case 155:
	    {
	        if(!response) return 1; //Pravé tlačítko ne
	        switch(listitem)
	        {
	            case 0: SetPlayerSkin(playerid, 274); //ZZS
	            case 1: GivePlayerWeapon(playerid, 43, 50000); //zbran 2
	        }
	        return 1;
	    }
	    case 158:
	    {
	        if(!response) return 1; //Pravé tlačítko ne
	        switch(listitem)
	        {
	            case 0: SetPlayerSkin(playerid, 286); //DP
	            case 1: SetPlayerSkin(playerid, 281); //normal
	            case 2: GivePlayerWeapon(playerid, 24, 50000); //zbran 2
	        }
	        return 1;
	    }
	}
	return 1;
}

 

možná se překrívají dialogid skus dat větší id dialogů např. 5726

--

Blbosť.

Edited by Tango
Link to comment
Share on other sites

  • 0

--

Nemožné.

Úprava: Tu máš funkčný kód, kde som spravil to, čo si mal spraviť ty podla mojej rady.

 

 

#include <a_samp>
new pichazzsatnik;
new picpzsrsatnik;
new piczzssatnik;

public OnGameModeInit()
{
    pichazzsatnik = CreatePickup(1275, 1, 2035.5431, -2098.3115,   13.5469, -1);
    picpzsrsatnik = CreatePickup(1275, 1, 1462.9403, -1766.0197, 3285.2859, -1);
    piczzssatnik  = CreatePickup(1275, 1, 1026.1835, -1088.8015,   23.8349, -1);
    //**************************************************************************
	return 1;
}

public OnPlayerPickUpPickup(playerid, pickupid)
{
	if (pickupid == pichazzsatnik) ShowPlayerDialog(playerid, 150, DIALOG_STYLE_LIST, "HaZZ Šatňa", "Veliteľ\nVeliteľ z ADP\nHasič\nHasič z ADP\nChemický oblek OPCH\nOblek proti sálavému teplu\nPotápač\nSekera\nHasiací prístroj\nMotorová píla", "Obliecť", "Zrušit");
    else if (pickupid == picpzsrsatnik) ShowPlayerDialog(playerid, 158, DIALOG_STYLE_LIST, "PZSR Šatňa", "Policajt\nDopravný policajt\nPištol\nAK-47", "Obliecť", "Zrušit");
    else if (pickupid == piczzssatnik)  ShowPlayerDialog(playerid, 155, DIALOG_STYLE_LIST, "ZZS Šatňa", "Doktor\nBatoh", "Obliecť", "Zrušit");
	return 1;
}

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
	switch(dialogid)
	{
	    case 150:
	    {
	        if(!response) return 1; //Pravé tlačítko ne
	        switch(listitem)
	        {
	            case 0: SetPlayerSkin(playerid, 277); //z ADP
	            case 1: SetPlayerSkin(playerid, 279); //bez AP
	            case 2: SetPlayerSkin(playerid, 278); //VZ
	            case 3: GivePlayerWeapon(playerid, 42, 500000); //zbran 1
	            case 4: GivePlayerWeapon(playerid, 9, 50000); //zbran 2
	            case 5: SetPlayerSkin(playerid, 273); //skin 273
	        }
	        return 1;
	    }
	    case 155:
	    {
	        if(!response) return 1; //Pravé tlačítko ne
	        switch(listitem)
	        {
	            case 0: SetPlayerSkin(playerid, 274); //ZZS
	            case 1: GivePlayerWeapon(playerid, 43, 50000); //zbran 2
	        }
	        return 1;
	    }
	    case 158:
	    {
	        if(!response) return 1; //Pravé tlačítko ne
	        switch(listitem)
	        {
	            case 0: SetPlayerSkin(playerid, 286); //DP
	            case 1: SetPlayerSkin(playerid, 281); //normal
	            case 2: GivePlayerWeapon(playerid, 24, 50000); //zbran 2
	        }
	        return 1;
	    }
	}
	return 1;
}

 

--

Blbosť.

co ty víš co tam cpe za filterscripty :d apod.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...