Jump to content
  • 0

pomoc Help Dialogy


VolfikCZ

Dotaz

Zdravím mám problém s dialogama nwm co to je a nwm jak to mám opravit celou dobu jsem to tak dělal a najednou errory

 

 

 

 

C:\Users\lukas\Desktop\branyizs.pwn(291) : warning 209: function "OnPlayerCommandText" should return a value
C:\Users\lukas\Desktop\branyizs.pwn(297) : error 008: must be a constant expression; assumed zero
C:\Users\lukas\Desktop\branyizs.pwn(298) : error 008: must be a constant expression; assumed zero
C:\Users\lukas\Desktop\branyizs.pwn(299) : error 008: must be a constant expression; assumed zero
C:\Users\lukas\Desktop\branyizs.pwn(302) : warning 225: unreachable code
C:\Users\lukas\Desktop\branyizs.pwn(330) : warning 225: unreachable code
C:\Users\lukas\Desktop\branyizs.pwn(330) : warning 217: loose indentation
C:\Users\lukas\Desktop\branyizs.pwn(330) : error 029: invalid expression, assumed zero
C:\Users\lukas\Desktop\branyizs.pwn(330) : error 004: function "OnDialogResponse" is not implemented
C:\Users\lukas\Desktop\branyizs.pwn(332) : error 017: undefined symbol "dialogid"
C:\Users\lukas\Desktop\branyizs.pwn(334) : error 017: undefined symbol "response"
C:\Users\lukas\Desktop\branyizs.pwn(336) : error 017: undefined symbol "listitem"
C:\Users\lukas\Desktop\branyizs.pwn(340) : error 017: undefined symbol "listitem"
C:\Users\lukas\Desktop\branyizs.pwn(344) : error 017: undefined symbol "listitem"
C:\Users\lukas\Desktop\branyizs.pwn(348) : error 017: undefined symbol "listitem"
C:\Users\lukas\Desktop\branyizs.pwn(352) : error 017: undefined symbol "listitem"
C:\Users\lukas\Desktop\branyizs.pwn(356) : error 017: undefined symbol "listitem"
C:\Users\lukas\Desktop\branyizs.pwn(363) : warning 217: loose indentation
C:\Users\lukas\Desktop\branyizs.pwn(363) : error 017: undefined symbol "dialogid"
C:\Users\lukas\Desktop\branyizs.pwn(365) : error 017: undefined symbol "response"
C:\Users\lukas\Desktop\branyizs.pwn(367) : error 017: undefined symbol "listitem"
C:\Users\lukas\Desktop\branyizs.pwn(371) : error 017: undefined symbol "listitem"
C:\Users\lukas\Desktop\branyizs.pwn(375) : error 017: undefined symbol "dialogid"
C:\Users\lukas\Desktop\branyizs.pwn(377) : error 017: undefined symbol "response"
C:\Users\lukas\Desktop\branyizs.pwn(379) : error 017: undefined symbol "listitem"
C:\Users\lukas\Desktop\branyizs.pwn(383) : error 017: undefined symbol "listitem"
C:\Users\lukas\Desktop\branyizs.pwn(387) : error 017: undefined symbol "listitem"
C:\Users\lukas\Desktop\branyizs.pwn(396) : error 030: compound statement not closed at the end of file (started at line 295)
Pawn compiler 3.2.3664	 	 	Copyright (c) 1997-2006, ITB CompuPhase


23 Errors.

 

 

 

 

Code:

// This is a comment
// uncomment the line below if you want to write a filterscript
//#define FILTERSCRIPT

#include <a_samp>


//****
new zzsdvere1, zzsdvere1Status;
new zzsbrana1, zzsbrana1Status;
new zzsbrana2, zzsbrana2Status;
new zzsbrana3, zzsbrana3Status;
//****
new hazzdvere1, hazzdvere1Status;
new hazzbrana1, hazzbrana1Status;
new hazzbrana2, hazzbrana2Status;
new hazzbrana3, hazzbrana3Status;
new hazzbrana4, hazzbrana4Status;
new hazzbrana5, hazzbrana5Status;
new hazzbrana6, hazzbrana6Status;
new hazzrampa1, hazzrampa1Status;
//****
//*****************PICKUPY*******************
new pickurad;
new uradvon;
new pickuphlvchodpzsr;
new pickuphlvonpzsr;
new pickupzbudovydogarazepzsr;
new pickupzgarazedobudovypzsr;
new piczzssatnik;
//new piclzssatnik;
//new picppusatnik;
new picpzsrsatnik;
new pichazzsatnik;
//*******************************************
//new pickuphazzsatna;







public OnGameModeInit()
{
	// Don't use these lines if it's a filterscript
	//pickuphazzsatna =
	//*********************PICKUPY**************************************************
    pickurad = CreatePickup(1318, 1, 1481.0719,-1771.1642,18.7958,-1);
    uradvon = CreatePickup(1318, 1, 390.0077,173.7546,1008.3828,-1);
    pickuphlvchodpzsr = CreatePickup(1318, 1, 1554.5302,-1675.5978,16.1953,-1);
    pickuphlvonpzsr = CreatePickup(1318, 1, 1473.4810,-1749.9080,3285.2859,-1);
    pickupzbudovydogarazepzsr = CreatePickup(1318, 1, 1480.5728,-1776.4456,3281.7954,-1);
    pickupzgarazedobudovypzsr = CreatePickup(1318, 1, 1568.5677,-1690.1305,5.8906,-1);
    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);
    //******************************************************************************
	//**********ZZS**********
	zzsdvere1 = CreateObject(1505, 1019.08, -1093.52, 22.72,   0.00, 0.00, 0.00);
	zzsbrana1 = CreateObject(5422, 1029.79, -1090.28, 24.14,   0.00, 0.00, 90.00);
	zzsbrana2 = CreateObject(5422, 1035.54, -1090.27, 24.14,   0.00, 0.00, 90.00);
	zzsbrana3 = CreateObject(5422, 1041.31, -1090.29, 24.14,   0.00, 0.00, 90.00);
	//**********HaZZ**********
	hazzrampa1 = CreateObject(968, 2005.302, -2099.99, 13.73,   0.00, 90.00, 0.00);
	hazzdvere1 = CreateObject(1569, 2024.44, -2099.82, 12.48,   0.00, 0.00, 0.00);
	hazzbrana1 = CreateObject(11102, 2045.72, -2096.74, 14.69,   0.00, 0.00, 90.00);
	hazzbrana2 = CreateObject(11102, 2054.80, -2096.77, 14.69,   0.00, 0.00, 90.00);
	hazzbrana3 = CreateObject(11102, 2063.83, -2096.74, 14.69,   0.00, 0.00, 90.00);
	hazzbrana4 = CreateObject(11102, 2072.85, -2096.74, 14.69,   0.00, 0.00, 90.00);
	hazzbrana5 = CreateObject(11102, 2081.89, -2096.66, 14.69,   0.00, 0.00, 90.00);
	hazzbrana6 = CreateObject(11102, 2090.95, -2096.70, 14.69,   0.00, 0.00, 90.00);
	return 1;
}



public OnPlayerRequestClass(playerid, classid)
{
	SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
	SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
	SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
	return 1;
}

public OnPlayerConnect(playerid)
{
	return 1;
}

public OnPlayerDisconnect(playerid, reason)
{
	return 1;
}

public OnPlayerSpawn(playerid)
{
	return 1;
}

public OnPlayerDeath(playerid, killerid, reason)
{
	return 1;
}

public OnVehicleSpawn(vehicleid)
{
	return 1;
}

public OnVehicleDeath(vehicleid, killerid)
{
	return 1;
}

public OnPlayerText(playerid, text[])
{
	return 1;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/hazzr", cmdtext, true, 10) == 0)
	{
	if (hazzrampa1Status == 0)
	{
	MoveObject(hazzrampa1, 2005.30, -2099.99, 13.73,   0.15, 0.15, 0.00);  //OPEN
    hazzrampa1Status = 1;
	}
	else
	{
	MoveObject(hazzrampa1,  2005.30, -2099.99, 13.73,   0.15, 0.15, 90.00); //CLOSED
	hazzrampa1Status = 0;
    }
    return 1;
    }
    if (strcmp("/hazz6", cmdtext, true, 10) == 0)
	{
	if (hazzbrana6Status == 0)
	{
	MoveObject(hazzbrana6, 2090.95, -2096.70, 18.78,   0.25, 0.25, 90.20);  //OPEN
    hazzbrana6Status = 1;
	}
	else
	{
	MoveObject(hazzbrana6,  2090.95, -2096.70, 14.69,   0.25, 0.25, 90.00); //CLOSED
	hazzbrana6Status = 0;
    }
    return 1;
    }
    if (strcmp("/hazz5", cmdtext, true, 10) == 0)
	{
	if (hazzbrana5Status == 0)
	{
	MoveObject(hazzbrana5, 2081.90, -2096.72, 18.79,   0.25, 0.25, 90.00);  //OPEN
    hazzbrana5Status = 1;
	}
	else
	{
	MoveObject(hazzbrana5,  2081.89, -2096.66, 14.69,   0.25, 0.25, 90.00); //CLOSED
	hazzbrana5Status = 0;
    }
    return 1;
    }
    if (strcmp("/hazz4", cmdtext, true, 10) == 0)
	{
	if (hazzbrana4Status == 0)
	{
	MoveObject(hazzbrana4, 2072.85, -2096.74, 18.23,   0.25, 0.25, 90.00);  //OPEN
    hazzbrana4Status = 1;
	}
	else
	{
	MoveObject(hazzbrana4,  2072.85, -2096.74, 14.69,   0.25, 0.25, 90.00); //CLOSED
	hazzbrana4Status = 0;
    }
    return 1;
    }
    if (strcmp("/hazz3", cmdtext, true, 10) == 0)
	{
	if (hazzbrana3Status == 0)
	{
	MoveObject(hazzbrana3,   2063.83, -2096.78, 18.87,   0.25, 0.25, 90.00); //OPEN
    hazzbrana3Status = 1;
	}
	else
	{
	MoveObject(hazzbrana3,  2063.83, -2096.74, 14.69,   0.25, 0.25, 90.00); //CLOSED
	hazzbrana3Status = 0;
    }
    return 1;
    }
    if (strcmp("/hazz2", cmdtext, true, 10) == 0)
	{
	if (hazzbrana2Status == 0)
	{
	MoveObject(hazzbrana2,  2054.80, -2096.77, 18.76,   0.25, 0.25, 90.00); //OPEN
    hazzbrana2Status = 1;
	}
	else
	{
	MoveObject(hazzbrana2,  2054.80, -2096.77, 14.69,   0.25, 0.25, 90.00); //CLOSED
	hazzbrana2Status = 0;
    }
    return 1;
    }
    if (strcmp("/hazz1", cmdtext, true, 10) == 0)
	{
	if (hazzbrana1Status == 0)
	{
	MoveObject(hazzbrana1,  2045.72, -2096.76, 18.70,   0.25, 0.25, 90.00); //OPEN
    hazzbrana1Status = 1;
	}
	else
	{
	MoveObject(hazzbrana1,  2045.72, -2096.74, 14.69,   0.25, 0.25, 90.00); //CLOSED
	hazzbrana1Status = 0;
    }
    return 1;
    }
    if (strcmp("/hazzd", cmdtext, true, 10) == 0)
	{
	if (hazzdvere1Status == 0)
	{
	MoveObject(hazzdvere1,  2023.255, -2099.83, 12.48,   0.15, 0.15, 0.00); //OPEN
    hazzdvere1Status = 1;
	}
	else
	{
	MoveObject(hazzdvere1,  2024.44, -2099.82, 12.48,   0.15, 0.15, 0.00); //CLOSED
	hazzdvere1Status = 0;
    }
    return 1;
    }
//******************************************************************************
    if (strcmp("/zzsb3", cmdtext, true, 10) == 0)
	{
	if (zzsbrana3Status == 0)
	{
	MoveObject(zzsbrana3,  1041.312, -1090.29, 27.94,   0.25, 0.25, 90.00); //OPEN
    zzsbrana3Status = 1;
	}
	else
	{
	MoveObject(zzsbrana3,  1041.31, -1090.29, 24.14,   0.25, 0.25, 90.00); //CLOSED
	zzsbrana3Status = 0;
    }
    return 1;
    }
    if (strcmp("/zzsb2", cmdtext, true, 10) == 0)
	{
	if (zzsbrana2Status == 0)
	{
	MoveObject(zzsbrana2,  1035.51, -1090.30, 28.03,   0.25, 0.25, 90.00); //OPEN
    zzsbrana2Status = 1;
	}
	else
	{
	MoveObject(zzsbrana2,  1035.54, -1090.27, 24.14,   0.25, 0.25, 90.00); //CLOSED
	zzsbrana2Status = 0;
    }
    return 1;
    }
    if (strcmp("/zzsb1", cmdtext, true, 10) == 0)
	{
	if (zzsbrana1Status == 0)
	{
	MoveObject(zzsbrana1,  1029.79, -1090.28, 27.99,   0.25, 0.25, 90.00); //OPEN
    zzsbrana1Status = 1;
	}
	else
	{
	MoveObject(zzsbrana1,  1029.79, -1090.28, 24.14,   0.25, 0.25, 90.00); //CLOSED
	zzsbrana1Status = 0;
    }
    return 1;
    }
    if (strcmp("/zzsdvere", cmdtext, true, 10) == 0)
	{
	if (zzsdvere1Status == 0)
	{
	MoveObject(zzsdvere1,  1017.70, -1093.51, 22.72,   0.25, 0.25, 0.00); //OPEN
    zzsdvere1Status = 1;
	}
	else
	{
	MoveObject(zzsdvere1, 1019.08, -1093.52, 22.72,   0.25, 0.25, 0.00); //CLOSED
	zzsdvere1Status = 0;
    }
    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;
    {
    if(pickupid == pickurad) {
    SetPlayerInterior(playerid,3);
    SetPlayerPos(playerid, 384.808624,173.804992,1008.382812); //kam ho to portne
    }
    if(pickupid == uradvon) {
    SetPlayerInterior(playerid,0);
    SetPlayerPos(playerid, 1481.1619,-1768.9821,18.7958);
    }
    if(pickupid == pickuphlvchodpzsr) {
	SetPlayerPos(playerid, 1474.0437,-1751.1372,3285.2859);
	SetPlayerInterior(playerid, 5);
	}
    if(pickupid == pickuphlvonpzsr) {
	SetPlayerPos(playerid, 1551.9877,-1675.8544,16.0936);
	SetPlayerInterior(playerid, 0);
	}
    if(pickupid == pickupzbudovydogarazepzsr) {
	SetPlayerPos(playerid, 1568.7146,-1692.2358,5.8906);
	SetPlayerInterior(playerid, 0);
	}
    if(pickupid == pickupzgarazedobudovypzsr) {
	SetPlayerPos(playerid, 1480.8386,-1775.1816,3282.3716);
	SetPlayerInterior(playerid, 5);
 	}
	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

5 odpovědí na tuto otázku

Recommended Posts

  • 0

Vyzkoušej :

// This is a comment
// uncomment the line below if you want to write a filterscript
//#define FILTERSCRIPT

#include <a_samp>


//****
new zzsdvere1, zzsdvere1Status;
new zzsbrana1, zzsbrana1Status;
new zzsbrana2, zzsbrana2Status;
new zzsbrana3, zzsbrana3Status;
//****
new hazzdvere1, hazzdvere1Status;
new hazzbrana1, hazzbrana1Status;
new hazzbrana2, hazzbrana2Status;
new hazzbrana3, hazzbrana3Status;
new hazzbrana4, hazzbrana4Status;
new hazzbrana5, hazzbrana5Status;
new hazzbrana6, hazzbrana6Status;
new hazzrampa1, hazzrampa1Status;
//****
//*****************PICKUPY*******************
new pickurad;
new uradvon;
new pickuphlvchodpzsr;
new pickuphlvonpzsr;
new pickupzbudovydogarazepzsr;
new pickupzgarazedobudovypzsr;
new piczzssatnik;
//new piclzssatnik;
//new picppusatnik;
new picpzsrsatnik;
new pichazzsatnik;
//*******************************************
//new pickuphazzsatna;







public OnGameModeInit()
{
	// Don't use these lines if it's a filterscript
	//pickuphazzsatna =
	//*********************PICKUPY**************************************************
    pickurad = CreatePickup(1318, 1, 1481.0719,-1771.1642,18.7958,-1);
    uradvon = CreatePickup(1318, 1, 390.0077,173.7546,1008.3828,-1);
    pickuphlvchodpzsr = CreatePickup(1318, 1, 1554.5302,-1675.5978,16.1953,-1);
    pickuphlvonpzsr = CreatePickup(1318, 1, 1473.4810,-1749.9080,3285.2859,-1);
    pickupzbudovydogarazepzsr = CreatePickup(1318, 1, 1480.5728,-1776.4456,3281.7954,-1);
    pickupzgarazedobudovypzsr = CreatePickup(1318, 1, 1568.5677,-1690.1305,5.8906,-1);
    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);
    //******************************************************************************
	//**********ZZS**********
	zzsdvere1 = CreateObject(1505, 1019.08, -1093.52, 22.72,   0.00, 0.00, 0.00);
	zzsbrana1 = CreateObject(5422, 1029.79, -1090.28, 24.14,   0.00, 0.00, 90.00);
	zzsbrana2 = CreateObject(5422, 1035.54, -1090.27, 24.14,   0.00, 0.00, 90.00);
	zzsbrana3 = CreateObject(5422, 1041.31, -1090.29, 24.14,   0.00, 0.00, 90.00);
	//**********HaZZ**********
	hazzrampa1 = CreateObject(968, 2005.302, -2099.99, 13.73,   0.00, 90.00, 0.00);
	hazzdvere1 = CreateObject(1569, 2024.44, -2099.82, 12.48,   0.00, 0.00, 0.00);
	hazzbrana1 = CreateObject(11102, 2045.72, -2096.74, 14.69,   0.00, 0.00, 90.00);
	hazzbrana2 = CreateObject(11102, 2054.80, -2096.77, 14.69,   0.00, 0.00, 90.00);
	hazzbrana3 = CreateObject(11102, 2063.83, -2096.74, 14.69,   0.00, 0.00, 90.00);
	hazzbrana4 = CreateObject(11102, 2072.85, -2096.74, 14.69,   0.00, 0.00, 90.00);
	hazzbrana5 = CreateObject(11102, 2081.89, -2096.66, 14.69,   0.00, 0.00, 90.00);
	hazzbrana6 = CreateObject(11102, 2090.95, -2096.70, 14.69,   0.00, 0.00, 90.00);
	return 1;
}



public OnPlayerRequestClass(playerid, classid)
{
	SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
	SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
	SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
	return 1;
}

public OnPlayerConnect(playerid)
{
	return 1;
}

public OnPlayerDisconnect(playerid, reason)
{
	return 1;
}

public OnPlayerSpawn(playerid)
{
	return 1;
}

public OnPlayerDeath(playerid, killerid, reason)
{
	return 1;
}

public OnVehicleSpawn(vehicleid)
{
	return 1;
}

public OnVehicleDeath(vehicleid, killerid)
{
	return 1;
}

public OnPlayerText(playerid, text[])
{
	return 1;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/hazzr", cmdtext, true, 10) == 0)
	{
	if (hazzrampa1Status == 0)
	{
	MoveObject(hazzrampa1, 2005.30, -2099.99, 13.73,   0.15, 0.15, 0.00);  //OPEN
    hazzrampa1Status = 1;
	}
	else
	{
	MoveObject(hazzrampa1,  2005.30, -2099.99, 13.73,   0.15, 0.15, 90.00); //CLOSED
	hazzrampa1Status = 0;
    }
    return 1;
    }
    if (strcmp("/hazz6", cmdtext, true, 10) == 0)
	{
	if (hazzbrana6Status == 0)
	{
	MoveObject(hazzbrana6, 2090.95, -2096.70, 18.78,   0.25, 0.25, 90.20);  //OPEN
    hazzbrana6Status = 1;
	}
	else
	{
	MoveObject(hazzbrana6,  2090.95, -2096.70, 14.69,   0.25, 0.25, 90.00); //CLOSED
	hazzbrana6Status = 0;
    }
    return 1;
    }
    if (strcmp("/hazz5", cmdtext, true, 10) == 0)
	{
	if (hazzbrana5Status == 0)
	{
	MoveObject(hazzbrana5, 2081.90, -2096.72, 18.79,   0.25, 0.25, 90.00);  //OPEN
    hazzbrana5Status = 1;
	}
	else
	{
	MoveObject(hazzbrana5,  2081.89, -2096.66, 14.69,   0.25, 0.25, 90.00); //CLOSED
	hazzbrana5Status = 0;
    }
    return 1;
    }
    if (strcmp("/hazz4", cmdtext, true, 10) == 0)
	{
	if (hazzbrana4Status == 0)
	{
	MoveObject(hazzbrana4, 2072.85, -2096.74, 18.23,   0.25, 0.25, 90.00);  //OPEN
    hazzbrana4Status = 1;
	}
	else
	{
	MoveObject(hazzbrana4,  2072.85, -2096.74, 14.69,   0.25, 0.25, 90.00); //CLOSED
	hazzbrana4Status = 0;
    }
    return 1;
    }
    if (strcmp("/hazz3", cmdtext, true, 10) == 0)
	{
	if (hazzbrana3Status == 0)
	{
	MoveObject(hazzbrana3,   2063.83, -2096.78, 18.87,   0.25, 0.25, 90.00); //OPEN
    hazzbrana3Status = 1;
	}
	else
	{
	MoveObject(hazzbrana3,  2063.83, -2096.74, 14.69,   0.25, 0.25, 90.00); //CLOSED
	hazzbrana3Status = 0;
    }
    return 1;
    }
    if (strcmp("/hazz2", cmdtext, true, 10) == 0)
	{
	if (hazzbrana2Status == 0)
	{
	MoveObject(hazzbrana2,  2054.80, -2096.77, 18.76,   0.25, 0.25, 90.00); //OPEN
    hazzbrana2Status = 1;
	}
	else
	{
	MoveObject(hazzbrana2,  2054.80, -2096.77, 14.69,   0.25, 0.25, 90.00); //CLOSED
	hazzbrana2Status = 0;
    }
    return 1;
    }
    if (strcmp("/hazz1", cmdtext, true, 10) == 0)
	{
	if (hazzbrana1Status == 0)
	{
	MoveObject(hazzbrana1,  2045.72, -2096.76, 18.70,   0.25, 0.25, 90.00); //OPEN
    hazzbrana1Status = 1;
	}
	else
	{
	MoveObject(hazzbrana1,  2045.72, -2096.74, 14.69,   0.25, 0.25, 90.00); //CLOSED
	hazzbrana1Status = 0;
    }
    return 1;
    }
    if (strcmp("/hazzd", cmdtext, true, 10) == 0)
	{
	if (hazzdvere1Status == 0)
	{
	MoveObject(hazzdvere1,  2023.255, -2099.83, 12.48,   0.15, 0.15, 0.00); //OPEN
    hazzdvere1Status = 1;
	}
	else
	{
	MoveObject(hazzdvere1,  2024.44, -2099.82, 12.48,   0.15, 0.15, 0.00); //CLOSED
	hazzdvere1Status = 0;
    }
    return 1;
    }
//******************************************************************************
    if (strcmp("/zzsb3", cmdtext, true, 10) == 0)
	{
	if (zzsbrana3Status == 0)
	{
	MoveObject(zzsbrana3,  1041.312, -1090.29, 27.94,   0.25, 0.25, 90.00); //OPEN
    zzsbrana3Status = 1;
	}
	else
	{
	MoveObject(zzsbrana3,  1041.31, -1090.29, 24.14,   0.25, 0.25, 90.00); //CLOSED
	zzsbrana3Status = 0;
    }
    return 1;
    }
    if (strcmp("/zzsb2", cmdtext, true, 10) == 0)
	{
	if (zzsbrana2Status == 0)
	{
	MoveObject(zzsbrana2,  1035.51, -1090.30, 28.03,   0.25, 0.25, 90.00); //OPEN
    zzsbrana2Status = 1;
	}
	else
	{
	MoveObject(zzsbrana2,  1035.54, -1090.27, 24.14,   0.25, 0.25, 90.00); //CLOSED
	zzsbrana2Status = 0;
    }
    return 1;
    }
    if (strcmp("/zzsb1", cmdtext, true, 10) == 0)
	{
	if (zzsbrana1Status == 0)
	{
	MoveObject(zzsbrana1,  1029.79, -1090.28, 27.99,   0.25, 0.25, 90.00); //OPEN
    zzsbrana1Status = 1;
	}
	else
	{
	MoveObject(zzsbrana1,  1029.79, -1090.28, 24.14,   0.25, 0.25, 90.00); //CLOSED
	zzsbrana1Status = 0;
    }
    return 1;
    }
    if (strcmp("/zzsdvere", cmdtext, true, 10) == 0)
	{
	if (zzsdvere1Status == 0)
	{
	MoveObject(zzsdvere1,  1017.70, -1093.51, 22.72,   0.25, 0.25, 0.00); //OPEN
    zzsdvere1Status = 1;
	}
	else
	{
	MoveObject(zzsdvere1, 1019.08, -1093.52, 22.72,   0.25, 0.25, 0.00); //CLOSED
	zzsdvere1Status = 0;
    }
    return 1;
 }
	return 0;}

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");}
    if(pickupid == pickurad) {
    SetPlayerInterior(playerid,3);
    SetPlayerPos(playerid, 384.808624,173.804992,1008.382812); //kam ho to portne
    }
    if(pickupid == uradvon) {
    SetPlayerInterior(playerid,0);
    SetPlayerPos(playerid, 1481.1619,-1768.9821,18.7958);
    }
    if(pickupid == pickuphlvchodpzsr) {
	SetPlayerPos(playerid, 1474.0437,-1751.1372,3285.2859);
	SetPlayerInterior(playerid, 5);
	}
    if(pickupid == pickuphlvonpzsr) {
	SetPlayerPos(playerid, 1551.9877,-1675.8544,16.0936);
	SetPlayerInterior(playerid, 0);
	}
    if(pickupid == pickupzbudovydogarazepzsr) {
	SetPlayerPos(playerid, 1568.7146,-1692.2358,5.8906);
	SetPlayerInterior(playerid, 0);
	}
    if(pickupid == pickupzgarazedobudovypzsr) {
	SetPlayerPos(playerid, 1480.8386,-1775.1816,3282.3716);
	SetPlayerInterior(playerid, 5);
 	}
	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

  • 0

Zjednodušit to jde i ty závorky jsou tam některé dost zbytečné např. proč děláš tohle:

if(listitem == 0)
{
SetPlayerSkin(...);
}
else if(listitem == 1)
{
SetPlayerSkin(...);
}
else if(listitem == 2)
{
GivePlayerWeapon(...);
}

Dost zbytečné máš tam jenom jednu funkci a to buď nastavení skinu a nebo že to dá hráči zbraň nic jiného tam nemáš tak to jde přece udělat takto:

if(lisitem == 0) SetPlayerSkin(...);
else if(listitem == 1) SetPlayerSkin(...);
else if(listitem == 2) GivePlayerWeapon(...);

Kdyby jsi tam měl více funkcí tak už by jsi to musel dat do závorek ale když máš jenom jednu tak to stačí udělat takhle ale to se časem naučíš všechny ty věci teda pokud budeš dělat.

Link to comment
Share on other sites

  • 0

 

Zjednodušit to jde i ty závorky jsou tam některé dost zbytečné např. proč děláš tohle:

if(listitem == 0)
{
SetPlayerSkin(...);
}
else if(listitem == 1)
{
SetPlayerSkin(...);
}
else if(listitem == 2)
{
GivePlayerWeapon(...);
}

Dost zbytečné máš tam jenom jednu funkci a to buď nastavení skinu a nebo že to dá hráči zbraň nic jiného tam nemáš tak to jde přece udělat takto:

if(lisitem == 0) SetPlayerSkin(...);
else if(listitem == 1) SetPlayerSkin(...);
else if(listitem == 2) GivePlayerWeapon(...);

--

Ak nevie zátvorkovať, neuč ho to jednoduchšie.

Skrátka, keď otváraš nový blok (public, if, elseif,else,switch,for,while,do-while,stock, main....) tak otvor nový blok '{' a potom ho zavri '}.

A tiež sa nauč stláčať tabulátor. 

->

 

/*public OnPlayerConnect(playerid)
{
    SendClientMessage(playerid,0x00FF00FF,"Ahoj");
}
alebo

public OnPlayerConnect(playerid) {
    SendClientMessage(playerid,0x00FF00FF,"Ahoj");
}

Alebo podobné spôsoby..*/

 

 

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...