#1

Can someone fix this!

Please



pawn Код:
#include <a_samp>
#include <zcmd>
#define orange 0xFF9900AA

CMD:Teleports(playerid, params[])
{
ShowPlayerDialog(playerid, 1, DIALOG_STYLE_LIST, "Teleports:", "Stunts\nJumps", "Ok", "Cancel");
return 1;
}

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(response)
{
switch(dialogid)
{
case 1:
{
switch(listitem)
{
case 0:
{
ShowPlayerDialog(playerid, 2, DIALOG_STYLE_LIST, "Stunts:", "Lsa\nLva\nSfa", "Ok", "Cancel");
}
case 1:
{
ShowPlayerDialog(playerid, 3, DIALOG_STYLE_LIST, "Jumps:", "/Vj-Vulcano Jump\n/Cj-Cliff Jump\n/Pipe-Pipe Jump", "Ok", "Cancel");
}
}
return 0;
}
switch(dialogid)
{
case 2:
{
switch(listitem)
{
case 0:
{
SetPlayerInterior(playerid,0);
SetPlayerPos(playerid,1926.0984,-2248.9475,16.4303);
GameTextForPlayer(playerid,"~g~Los ~p~Santos ~b~Airport",4000,5);
new string[256], pname[MAX_PLAYER_NAME];
GetPlayerName(playerid, pname, sizeof(pname));
format(string, sizeof(string), "** %s has teleported to Los Santos Airport (/lsa).", pname);
SendClientMessageToAll(orange, string);
new vehicleid = GetPlayerVehicleID(playerid);
SetVehiclePos(vehicleid, 1960.8390,-2264.5425,13.5469);
PutPlayerInVehicle(playerid, vehicleid, 0);
SetPlayerFacingAngle(playerid, 183.9178);
}
case 1:
{
SetPlayerInterior(playerid,0);
SetPlayerPos(playerid,1615.1976,1163.9318,14.2188);
GameTextForPlayer(playerid,"~g~Las ~p~Venturas ~b~Airport",4000,5);
new string[256], pname[MAX_PLAYER_NAME];
GetPlayerName(playerid, pname, sizeof(pname));
format(string, sizeof(string), "** %s has teleported to Las Venturas Airport (/lva). ", pname);
SendClientMessageToAll(orange, string);
new vehicleid = GetPlayerVehicleID(playerid);
SetVehiclePos(vehicleid, 1647.5516,1599.1432,10.8203);
PutPlayerInVehicle(playerid, vehicleid, 0);
SetPlayerFacingAngle(playerid, 14.0895);
}
case 2:
{
SetPlayerInterior(playerid,0);
SetPlayerPos(playerid,-1185.4948,27.0993,14.1484);
GameTextForPlayer(playerid,"~g~San ~p~Fiego ~b~Airport",4000,5);
new string[256], pname[MAX_PLAYER_NAME];
GetPlayerName(playerid, pname, sizeof(pname));
format(string, sizeof(string), "** %s has teleported to San Fiego Airport (/sfa). ", pname);
SendClientMessageToAll(orange, string);
new vehicleid = GetPlayerVehicleID(playerid);
SetVehiclePos(vehicleid, -1254.2469,36.7461,14.1402);
PutPlayerInVehicle(playerid, vehicleid, 0);
return 1;
}
if(response)
{
switch(dialogid)
{
case 3:
{
switch(listitem)
{
case 0:
{
SetPlayerInterior(playerid,0);
SetPlayerPos(playerid,2053.6147,1556.6315,720.7741);
GameTextForPlayer(playerid,"~g~Vulcano ~p~Jump ~b~!!!",4000,5);
new string[256], pname[MAX_PLAYER_NAME];
GetPlayerName(playerid, pname, sizeof(pname));
format(string, sizeof(string), "** %s has teleported to Vulcano Jump (/vj).", pname);
new vehicleid = GetPlayerVehicleID(playerid);
SetVehiclePos(vehicleid, 2053.6147,1556.6315,720.7741);
PutPlayerInVehicle(playerid, vehicleid, 0);
SetPlayerFacingAngle(playerid, 358.7228);
}
case 1:
{
SetPlayerInterior(playerid,0);
SetPlayerPos(playerid,-3832.4019,2686.4294,704.1697);
GameTextForPlayer(playerid,"~g~Cliff ~p~Jump ~b~!!!",4000,5);
new string[256], pname[MAX_PLAYER_NAME];
GetPlayerName(playerid, pname, sizeof(pname));
format(string, sizeof(string), "** %s has teleported to Cliff Jump (/cj).", pname);
new vehicleid = GetPlayerVehicleID(playerid);
SetVehiclePos(vehicleid, -3832.4019,2686.4294,704.1697);
PutPlayerInVehicle(playerid, vehicleid, 0);
SetPlayerFacingAngle(playerid, 263.5099);
}
case 2:
{
SetPlayerInterior(playerid,0);
SetPlayerPos(playerid,1394.7571,-2425.7009,525.6313);
GameTextForPlayer(playerid,"~g~Pipe ~p~!!!",4000,5);
new string[256], pname[MAX_PLAYER_NAME];
GetPlayerName(playerid, pname, sizeof(pname));
format(string, sizeof(string), "** %s has teleported to Pipe (/pipe). ", pname);
SendClientMessageToAll(orange, string);
new vehicleid = GetPlayerVehicleID(playerid);
SetVehiclePos(vehicleid, 1394.7571,-2425.7009,525.6313);
PutPlayerInVehicle(playerid, vehicleid, 0);
SetPlayerFacingAngle(playerid, 269.3985);
return 0;
}
I get this errors!
pawn Код:
filterscripts\myscript.pwn(32 -- 34) : fatal error 107: too many error messages on one line
filterscripts\myscript.pwn(32 -- 34) : error 001: expected token: "}", but found "case"
filterscripts\myscript.pwn(32 -- 33) : error 028: invalid subscript (not an array or too many subscripts): "dialogid"
filterscripts\myscript.pwn(32) : error 002: only a single statement (or expression) can follow each "case"
Reply
#2

I don't know where your plan was

Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == 2)
	{
		if(response)
		{
			switch(listitem)
			{
				case 0:
				{				
					SetPlayerInterior(playerid,0);
					SetPlayerPos(playerid,1926.0984,-2248.9475,16.4303);
					GameTextForPlayer(playerid,"~g~Los ~p~Santos ~b~Airport",4000,5);
					new string[256], pname[MAX_PLAYER_NAME];
					GetPlayerName(playerid, pname, sizeof(pname));
					format(string, sizeof(string), "** %s has teleported to Los Santos Airport (/lsa).", pname);
					SendClientMessageToAll(orange, string);
					new vehicleid = GetPlayerVehicleID(playerid);
					SetVehiclePos(vehicleid, 1960.8390,-2264.5425,13.5469);
					PutPlayerInVehicle(playerid, vehicleid, 0);
					SetPlayerFacingAngle(playerid, 183.9178);
				}
				case 1:
				{
					SetPlayerInterior(playerid,0);
					SetPlayerPos(playerid,1615.1976,1163.9318,14.2188);
					GameTextForPlayer(playerid,"~g~Las ~p~Venturas ~b~Airport",4000,5);
					new string[256], pname[MAX_PLAYER_NAME];
					GetPlayerName(playerid, pname, sizeof(pname));
					format(string, sizeof(string), "** %s has teleported to Las Venturas Airport (/lva). ", pname);
					SendClientMessageToAll(orange, string);
					new vehicleid = GetPlayerVehicleID(playerid);
					SetVehiclePos(vehicleid, 1647.5516,1599.1432,10.8203);
					PutPlayerInVehicle(playerid, vehicleid, 0);
					SetPlayerFacingAngle(playerid, 14.0895);
				}
				case 2:
				{
					SetPlayerInterior(playerid,0);
					SetPlayerPos(playerid,-1185.4948,27.0993,14.1484);
					GameTextForPlayer(playerid,"~g~San ~p~Fiego ~b~Airport",4000,5);
					new string[256], pname[MAX_PLAYER_NAME];
					GetPlayerName(playerid, pname, sizeof(pname));
					format(string, sizeof(string), "** %s has teleported to San Fiego Airport (/sfa). ", pname);
					SendClientMessageToAll(orange, string);
					new vehicleid = GetPlayerVehicleID(playerid);
					SetVehiclePos(vehicleid, -1254.2469,36.7461,14.1402);
					PutPlayerInVehicle(playerid, vehicleid, 0);
				}
			}
		}
	}
	if(dialogid == 2)
	{
		if(response)
		{
			switch(listitem)
			{
				case 0:
				{
					SetPlayerInterior(playerid,0);
					SetPlayerPos(playerid,2053.6147,1556.6315,720.7741);
					GameTextForPlayer(playerid,"~g~Vulcano ~p~Jump ~b~!!!",4000,5);
					new string[256], pname[MAX_PLAYER_NAME];
					GetPlayerName(playerid, pname, sizeof(pname));
					format(string, sizeof(string), "** %s has teleported to Vulcano Jump (/vj).", pname);
					new vehicleid = GetPlayerVehicleID(playerid);
					SetVehiclePos(vehicleid, 2053.6147,1556.6315,720.7741);
					PutPlayerInVehicle(playerid, vehicleid, 0);
					SetPlayerFacingAngle(playerid, 358.7228);
				}
				case 1:
				{
					SetPlayerInterior(playerid,0);
					SetPlayerPos(playerid,-3832.4019,2686.4294,704.1697);
					GameTextForPlayer(playerid,"~g~Cliff ~p~Jump ~b~!!!",4000,5);
					new string[256], pname[MAX_PLAYER_NAME];
					GetPlayerName(playerid, pname, sizeof(pname));
					format(string, sizeof(string), "** %s has teleported to Cliff Jump (/cj).", pname);
					new vehicleid = GetPlayerVehicleID(playerid);
					SetVehiclePos(vehicleid, -3832.4019,2686.4294,704.1697);
					PutPlayerInVehicle(playerid, vehicleid, 0);
					SetPlayerFacingAngle(playerid, 263.5099);
				}
				case 2:
				{
					SetPlayerInterior(playerid,0);
					SetPlayerPos(playerid,1394.7571,-2425.7009,525.6313);
					GameTextForPlayer(playerid,"~g~Pipe ~p~!!!",4000,5);
					new string[256], pname[MAX_PLAYER_NAME];
					GetPlayerName(playerid, pname, sizeof(pname));
					format(string, sizeof(string), "** %s has teleported to Pipe (/pipe). ", pname);
					SendClientMessageToAll(orange, string);
					new vehicleid = GetPlayerVehicleID(playerid);
					SetVehiclePos(vehicleid, 1394.7571,-2425.7009,525.6313);
					PutPlayerInVehicle(playerid, vehicleid, 0);
					SetPlayerFacingAngle(playerid, 269.3985);
				}
			}
		}
	}
	return 1;
}
You need to put these lines to when you want the dialogs to appear for a player, so either on a command/death/spawn?
Код:
ShowPlayerDialog(playerid, 2, DIALOG_STYLE_LIST, "Stunts:", "Lsa\nLva\nSfa", "Ok", "Cancel");
ShowPlayerDialog(playerid, 3, DIALOG_STYLE_LIST, "Jumps:", "/Vj-Vulcano Jump\n/Cj-Cliff Jump\n/Pipe-Pipe Jump", "Ok", "Cancel");
Good luck
Reply
#3

Now I have got this

pawn Код:
#include <a_samp>
#include <zcmd>
#define orange 0xFF9900AA

CMD:t(playerid, params[])
{
ShowPlayerDialog(playerid, 1, DIALOG_STYLE_LIST, "Teleports:", "Stunts\nJumps", "Ok", "Cancel");
return 1;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(response)
{
switch(dialogid)
{
case 1:
{
switch(listitem)
{
case 0:
{
ShowPlayerDialog(playerid, 2, DIALOG_STYLE_LIST, "Stunts:", "Lsa\nLva\nSfa", "Teleport", "Cancel");
}
case 1:
{
ShowPlayerDialog(playerid, 3, DIALOG_STYLE_LIST, "Jumps:", "/Vj-Vulcano Jump\n/Cj-Cliff Jump\n/Pipe-Pipe Jump", "Teleport", "Cancel");
}
}
return 1;
}
if(dialogid == 2 )
{
if(response)
{
switch(listitem)
{
case 0:
{
SetPlayerInterior(playerid,0);
SetPlayerPos(playerid,1926.0984,-2248.9475,16.4303);
GameTextForPlayer(playerid,"~g~Los ~p~Santos ~b~Airport",4000,5);
new string[256], pname[MAX_PLAYER_NAME];
GetPlayerName(playerid, pname, sizeof(pname));
format(string, sizeof(string), "** %s has teleported to Los Santos Airport (/lsa).", pname);
SendClientMessageToAll(orange, string);
new vehicleid = GetPlayerVehicleID(playerid);
SetVehiclePos(vehicleid, 1960.8390,-2264.5425,13.5469);
PutPlayerInVehicle(playerid, vehicleid, 0);
SetPlayerFacingAngle(playerid, 183.9178);
}
case 1:
{
SetPlayerInterior(playerid,0);
SetPlayerPos(playerid,1615.1976,1163.9318,14.2188);
GameTextForPlayer(playerid,"~g~Las ~p~Venturas ~b~Airport",4000,5);
new string[256], pname[MAX_PLAYER_NAME];
GetPlayerName(playerid, pname, sizeof(pname));
format(string, sizeof(string), "** %s has teleported to Las Venturas Airport (/lva). ", pname);
SendClientMessageToAll(orange, string);
new vehicleid = GetPlayerVehicleID(playerid);
SetVehiclePos(vehicleid, 1647.5516,1599.1432,10.8203);
PutPlayerInVehicle(playerid, vehicleid, 0);
SetPlayerFacingAngle(playerid, 14.0895);
}
case 2:
{
SetPlayerInterior(playerid,0);
SetPlayerPos(playerid,-1185.4948,27.0993,14.1484);
GameTextForPlayer(playerid,"~g~San ~p~Fiego ~b~Airport",4000,5);
new string[256], pname[MAX_PLAYER_NAME];
GetPlayerName(playerid, pname, sizeof(pname));
format(string, sizeof(string), "** %s has teleported to San Fiego Airport (/sfa). ", pname);
SendClientMessageToAll(orange, string);
new vehicleid = GetPlayerVehicleID(playerid);
SetVehiclePos(vehicleid, -1254.2469,36.7461,14.1402);
PutPlayerInVehicle(playerid, vehicleid, 0);
}
}
}
}
}
if(dialogid == 3)
{
if(response)
{
switch(listitem)
{
case 0:
{
SetPlayerInterior(playerid,0);
SetPlayerPos(playerid,2053.6147,1556.6315,720.7741);
GameTextForPlayer(playerid,"~g~Vulcano ~p~Jump ~b~!!!",4000,5);
new string[256], pname[MAX_PLAYER_NAME];
GetPlayerName(playerid, pname, sizeof(pname));
format(string, sizeof(string), "** %s has teleported to Vulcano Jump (/vj).", pname);
new vehicleid = GetPlayerVehicleID(playerid);
SetVehiclePos(vehicleid, 2053.6147,1556.6315,720.7741);
PutPlayerInVehicle(playerid, vehicleid, 0);
SetPlayerFacingAngle(playerid, 358.7228);
}
case 1:
{
SetPlayerInterior(playerid,0);
SetPlayerPos(playerid,-3832.4019,2686.4294,704.1697);
GameTextForPlayer(playerid,"~g~Cliff ~p~Jump ~b~!!!",4000,5);
new string[256], pname[MAX_PLAYER_NAME];
GetPlayerName(playerid, pname, sizeof(pname));
format(string, sizeof(string), "** %s has teleported to Cliff Jump (/cj).", pname);
new vehicleid = GetPlayerVehicleID(playerid);
SetVehiclePos(vehicleid, -3832.4019,2686.4294,704.1697);
PutPlayerInVehicle(playerid, vehicleid, 0);
SetPlayerFacingAngle(playerid, 263.5099);
}
case 2:
{
SetPlayerInterior(playerid,0);
SetPlayerPos(playerid,1394.7571,-2425.7009,525.6313);
GameTextForPlayer(playerid,"~g~Pipe ~p~!!!",4000,5);
new string[256], pname[MAX_PLAYER_NAME];
GetPlayerName(playerid, pname, sizeof(pname));
format(string, sizeof(string), "** %s has teleported to Pipe (/pipe). ", pname);
SendClientMessageToAll(orange, string);
new vehicleid = GetPlayerVehicleID(playerid);
SetVehiclePos(vehicleid, 1394.7571,-2425.7009,525.6313);
PutPlayerInVehicle(playerid, vehicleid, 0);
SetPlayerFacingAngle(playerid, 269.3985);
}
}
}
}
return 0;
}

And this errors


Код:
(31) : error 002: only a single statement (or expression) can follow each "case"
(31 -- 32) : error 029: invalid expression, assumed zero
And I want if player will click on the stunts it will open him other dialog!
Reply
#4

I'd help you if you'd indent your code
Reply
#5

what
Reply
#6

Can someone fix it
Reply
#7

Please
Reply
#8

why did you change the code i just fixed for you?
Reply
#9

Dont change shit

Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == 2)
	{
		if(response)
		{
			switch(listitem)
			{
				case 0:
				{				
					SetPlayerInterior(playerid,0);
					SetPlayerPos(playerid,1926.0984,-2248.9475,16.4303);
					GameTextForPlayer(playerid,"~g~Los ~p~Santos ~b~Airport",4000,5);
					new string[256], pname[MAX_PLAYER_NAME];
					GetPlayerName(playerid, pname, sizeof(pname));
					format(string, sizeof(string), "** %s has teleported to Los Santos Airport (/lsa).", pname);
					SendClientMessageToAll(orange, string);
					new vehicleid = GetPlayerVehicleID(playerid);
					SetVehiclePos(vehicleid, 1960.8390,-2264.5425,13.5469);
					PutPlayerInVehicle(playerid, vehicleid, 0);
					SetPlayerFacingAngle(playerid, 183.9178);
				}
				case 1:
				{
					SetPlayerInterior(playerid,0);
					SetPlayerPos(playerid,1615.1976,1163.9318,14.2188);
					GameTextForPlayer(playerid,"~g~Las ~p~Venturas ~b~Airport",4000,5);
					new string[256], pname[MAX_PLAYER_NAME];
					GetPlayerName(playerid, pname, sizeof(pname));
					format(string, sizeof(string), "** %s has teleported to Las Venturas Airport (/lva). ", pname);
					SendClientMessageToAll(orange, string);
					new vehicleid = GetPlayerVehicleID(playerid);
					SetVehiclePos(vehicleid, 1647.5516,1599.1432,10.8203);
					PutPlayerInVehicle(playerid, vehicleid, 0);
					SetPlayerFacingAngle(playerid, 14.0895);
				}
				case 2:
				{
					SetPlayerInterior(playerid,0);
					SetPlayerPos(playerid,-1185.4948,27.0993,14.1484);
					GameTextForPlayer(playerid,"~g~San ~p~Fiego ~b~Airport",4000,5);
					new string[256], pname[MAX_PLAYER_NAME];
					GetPlayerName(playerid, pname, sizeof(pname));
					format(string, sizeof(string), "** %s has teleported to San Fiego Airport (/sfa). ", pname);
					SendClientMessageToAll(orange, string);
					new vehicleid = GetPlayerVehicleID(playerid);
					SetVehiclePos(vehicleid, -1254.2469,36.7461,14.1402);
					PutPlayerInVehicle(playerid, vehicleid, 0);
				}
			}
		}
	}
	if(dialogid == 2)
	{
		if(response)
		{
			switch(listitem)
			{
				case 0:
				{
					SetPlayerInterior(playerid,0);
					SetPlayerPos(playerid,2053.6147,1556.6315,720.7741);
					GameTextForPlayer(playerid,"~g~Vulcano ~p~Jump ~b~!!!",4000,5);
					new string[256], pname[MAX_PLAYER_NAME];
					GetPlayerName(playerid, pname, sizeof(pname));
					format(string, sizeof(string), "** %s has teleported to Vulcano Jump (/vj).", pname);
					new vehicleid = GetPlayerVehicleID(playerid);
					SetVehiclePos(vehicleid, 2053.6147,1556.6315,720.7741);
					PutPlayerInVehicle(playerid, vehicleid, 0);
					SetPlayerFacingAngle(playerid, 358.7228);
				}
				case 1:
				{
					SetPlayerInterior(playerid,0);
					SetPlayerPos(playerid,-3832.4019,2686.4294,704.1697);
					GameTextForPlayer(playerid,"~g~Cliff ~p~Jump ~b~!!!",4000,5);
					new string[256], pname[MAX_PLAYER_NAME];
					GetPlayerName(playerid, pname, sizeof(pname));
					format(string, sizeof(string), "** %s has teleported to Cliff Jump (/cj).", pname);
					new vehicleid = GetPlayerVehicleID(playerid);
					SetVehiclePos(vehicleid, -3832.4019,2686.4294,704.1697);
					PutPlayerInVehicle(playerid, vehicleid, 0);
					SetPlayerFacingAngle(playerid, 263.5099);
				}
				case 2:
				{
					SetPlayerInterior(playerid,0);
					SetPlayerPos(playerid,1394.7571,-2425.7009,525.6313);
					GameTextForPlayer(playerid,"~g~Pipe ~p~!!!",4000,5);
					new string[256], pname[MAX_PLAYER_NAME];
					GetPlayerName(playerid, pname, sizeof(pname));
					format(string, sizeof(string), "** %s has teleported to Pipe (/pipe). ", pname);
					SendClientMessageToAll(orange, string);
					new vehicleid = GetPlayerVehicleID(playerid);
					SetVehiclePos(vehicleid, 1394.7571,-2425.7009,525.6313);
					PutPlayerInVehicle(playerid, vehicleid, 0);
					SetPlayerFacingAngle(playerid, 269.3985);
				}
			}
		}
	}
	return 1;
}

CMD:jumps(playerid)
{
	ShowPlayerDialog(playerid, 3, DIALOG_STYLE_LIST, "Jumps:", "/Vj-Vulcano Jump\n/Cj-Cliff Jump\n/Pipe-Pipe Jump", "Teleport", "Cancel");
	return 1;
}
CMD:airports(playerid)
{
	ShowPlayerDialog(playerid, 2, DIALOG_STYLE_LIST, "Stunts:", "Lsa\nLva\nSfa", "Teleport", "Cancel");
	return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)