Errors in Carspawner
#1

Hey,
i have made a 2nd Menu to spawn cars

news
Quote:

new Menu:autospawn;
new Menu:bikespawn;

command
Quote:

if (strcmp("/bike", cmdtext, true, 10) == 0)
{
ShowMenuForPlayer(bikespawn, playerid);
TogglePlayerControllable(playerid, false);
return 1;
}

Quote:

if (strcmp("/auto", cmdtext, true, 10) == 0)
{
ShowMenuForPlayer(autospawn, playerid);
TogglePlayerControllable(playerid, false);
return 1;
}

GameModeini
Quote:

autospawn = CreateMenu("~r~Auto Auswahl", 2, 400.0, 100.0, 150.0, 150.0);
AddMenuItem(autospawn, 0, "Infernus");
AddMenuItem(autospawn, 0, "Bullet");
AddMenuItem(autospawn, 0, "Sultan");
AddMenuItem(autospawn, 0, "Elegy");
AddMenuItem(autospawn, 0, "Turismo");
///////////// 2nd menu
bikespawn = CreateMenu("~r~Bike Auswahl", 2, 400.0, 100.0, 150.0, 150.0);
AddMenuItem(autospawn, 0, "NRG-500");
AddMenuItem(autospawn, 0, "PCJ-600");
AddMenuItem(autospawn, 0, "FCR-900");
AddMenuItem(autospawn, 0, "Sanchez");
AddMenuItem(autospawn, 0, "Freeway");

Now the the menu...
Quote:

[....]
[....]
[....]
case 4:
{
if(IsPlayerInAnyVehicle(playerid))
{
HideMenuForPlayer(bikespawn, playerid);
SendClientMessage(playerid,0xffffffff, "Du musst das Auto verlassen, wenn du ein Auto spawnen willst!");
TogglePlayerControllable(playerid, true);
}
else
{
new Float:X,Float:Y,Float:Z,Float:Angle, carid;
GetPlayerPos(playerid,X,Y,Z);
GetPlayerFacingAngle(playerid,Angle);
carid = GetPlayerVehicleID(playerid);
carid = CreateVehicle(463,X,Y,Z,Angle,-1,-1,600);
PutPlayerInVehicle(playerid,carid,0);
TogglePlayerControllable(playerid, true);
return SendClientMessage(playerid, 0xffffffff, "Bike [Freeway] wurde erfolgreich gespawnt!");
}
}
}
}
return 0;
}

Errors

warning 225: unreachable code
warning 209: function "OnPlayerSelectedMenuRow" should return a value
error 010: invalid function or declaration

Quote:

Where i get the errors

}
}
}
}
return 0;
}

warning

//==========================Bike spawn =========================
// new Menu:Current = GetPlayerMenu(playerid);
// if(Current == autospawn) {
switch(row)

Pls help me....



Reply
#2

Can you check your PM box?

Send me the whole menu. (from (Current = autospawn))
Then i may help you.
Reply
#3

return 1 ;not return 0;
and i think that you have to much }
Reply
#4

Check your e-mails....

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)