spawn planes
#1

Hello, so I ma trying to make a command which spawns the planes on the list given, but I keep getting a error. This is what I've done :


Код:
enum TPlane
{
	PlaneName[50], // Holds the name of the Plane
	PlaneModel // Holds the model-ID of the Plane
}

new APlanes[][TPlane] =
{
	{"Andromada", 592},		{"AT400", 577}, 	        {"Beagle", 511},			        {"Cargobob", 548},          // ID 0, 1, 2, 3
	{"Cropduster", 512},	        {"Dodo", 593},		{"Hunter", 425},				{"Hydra", 520},             // ID 4, 5, 6, 7
	{"Leviathan", 417},		{"Maverick", 487},	{"Nevada", 553},				{"Police Maverick", 497},   // ID 8, 9, 10, 11
	{"Raindance", 563},		{"Rustler", 476},	{"SAN News Maverick", 488},		{"Seasparrow", 447},        // ID 12, 13, 14, 15
	{"Shamal", 519},		{"Skimmer", 460},	{"Sparrow", 469},				{"Stuntplane", 513}         // ID 16, 17, 18, 19
};
//==============================================================================
CMD:vplane(playerid, params[])
{
    // Check if the player's admin-level is at least 1
    if(PlayerInfo[playerid][pVIP] >= 2)
    {
         // Make sure the player isn't inside a vehicle
         if (GetPlayerVehicleID(playerid) == 0)
         {
             // Ask which motorcycle the player wants to have
             ShowPlayerDialog(playerid, APlanes, DIALOG_STYLE_LIST);
             // Let the server know that this was a valid command
             return 1;

		 }
	}
	else
	    return 0;

	// Let the server know that this was a valid command
	return 1;
}
Here is there error:

Код:
(222) : error 035: argument type mismatch (argument 2)
Here is line 222:

Код:
ShowPlayerDialog(playerid, APlanes, DIALOG_STYLE_LIST);
Reply
#2

pawn Код:
ShowPlayerDialog(playerid, DIALOG_ID, DIALOG_STYLE_LIST, "Planes", APlanes, "Button1", "Button2");
Reply
#3

Still got an error:

Код:
(222) : error 048: array dimensions do not match
This is how the command looks now.

Код:
CMD:vplane(playerid, params[])
{
    // Check if the player's admin-level is at least 1
    if(PlayerInfo[playerid][pVIP] >= 2)
    {
         // Make sure the player isn't inside a vehicle
         if (GetPlayerVehicleID(playerid) == 0)
         {
             // Ask which plane the player wants to have
             ShowPlayerDialog(playerid, DialogPlane, DIALOG_STYLE_LIST, "Planes", APlanes, "Spawn", "Cancel");
             // Let the server know that this was a valid command
             return 1;

		 }
	}
	else
	    return 0;

	// Let the server know that this was a valid command
	return 1;
}
Reply
#4

C'mon guys, what's the problem? Why do i get that error ?

Here is everything related to this command :

Код:
#define DialogPlane                 103
Код:
enum TPlane
{
	PlaneName[50], // Holds the name of the Plane
	PlaneModel // Holds the model-ID of the Plane
}

new APlanes[][TPlane] =
{
	{"Andromada", 592},		{"AT400", 577}, 	{"Beagle", 511},				{"Cargobob", 548},          // ID 0, 1, 2, 3
	{"Cropduster", 512},	{"Dodo", 593},		{"Hunter", 425},				{"Hydra", 520},             // ID 4, 5, 6, 7
	{"Leviathan", 417},		{"Maverick", 487},	{"Nevada", 553},				{"Police Maverick", 497},   // ID 8, 9, 10, 11
	{"Raindance", 563},		{"Rustler", 476},	{"SAN News Maverick", 488},		{"Seasparrow", 447},        // ID 12, 13, 14, 15
	{"Shamal", 519},		{"Skimmer", 460},	{"Sparrow", 469},				{"Stuntplane", 513}         // ID 16, 17, 18, 19
};
//==============================================================================
CMD:vplane(playerid, params[])
{
    // Check if the player's admin-level is at least 1
    if(PlayerInfo[playerid][pVIP] >= 2)
    {
         // Make sure the player isn't inside a vehicle
         if (GetPlayerVehicleID(playerid) == 0)
         {
             // Ask which motorcycle the player wants to have
             ShowPlayerDialog(playerid, DialogPlane, DIALOG_STYLE_LIST, "Planes", APlanes, "Spawn", "Cancel");
             // Let the server know that this was a valid command
             return 1;

		 }
	}
	else
	    return 0;

	// Let the server know that this was a valid command
	return 1;
}
Error:

Код:
(222) : error 048: array dimensions do not match
Reply
#5

Wiki:https://sampwiki.blast.hk/wiki/How_to_Create_a_Dialog
You can edit this script,just with planes:https://sampforum.blast.hk/showthread.php?tid=270242
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)