Need help fast
#1

Ok i realy need help as fast as i can get


When i type my menu /tele the whole game crashes does anyone no why heres part of my code that i think is causing this

pawn Код:
if(CurrentMenu == stuntzone)
        {
    switch(row)
    {
        case 0:
        {
       
        new tele;
        tele=GetPlayerVehicleID(playerid);
        SetPlayerPos(playerid,326.7174,-1804.6351,4.5760);
        SetVehiclePos(tele,326.7174,-1804.6351,4.5760);
        PutPlayerInVehicle(playerid,tele,0);
        TogglePlayerControllable(playerid,1);
        new string[64],pName[MAX_PLAYER_NAME];
        GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
        format(string,sizeof string,"%s has has teleported to LS Beach Stunt, type /lsb to join! ",pName, playerid);
        SendClientMessageToAll(0x00B2FFFF,string);
       
        }
        case 1:
        {
        new tele;
        tele=GetPlayerVehicleID(playerid);
        SetPlayerPos(playerid,370.6686,2533.5835,16.6388);
        SetVehiclePos(tele,370.6686,2533.5835,16.6388);
        PutPlayerInVehicle(playerid,tele,0);
       
        new string[64],pName[MAX_PLAYER_NAME];
        GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
        format(string,sizeof string,"%s has has teleported to LV Abanend Airport Stunt, type /aa to join! ",pName, playerid);
        SendClientMessageToAll(0x00B2FFFF,string);
        TogglePlayerControllable(playerid,1);
        }
        case 2:
        {
        new tele;
        tele=GetPlayerVehicleID(playerid);
        SetPlayerPos(playerid,-2331.4001,-1693.5679,484);
        SetVehiclePos(tele,-2331.4001,-1693.5679,484);
        PutPlayerInVehicle(playerid,tele,0);
       
        new string[64],pName[MAX_PLAYER_NAME];
        GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
        format(string,sizeof string,"%s has has teleported to Mount Chilliad Stunt, type /mc to join! ",pName, playerid);
        SendClientMessageToAll(0x00B2FFFF,string);
        TogglePlayerControllable(playerid,1);
       
        }

        case 4: //main menu
        {
        new tele;
        tele=GetPlayerVehicleID(playerid);
        SetPlayerPos(playerid,1484.3639,-2638.3069,13.5469);
        SetVehiclePos(tele,1484.3639,-2638.3069,13.5469);
        PutPlayerInVehicle(playerid,tele,0);
       
        new string[64],pName[MAX_PLAYER_NAME];
        GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
        format(string,sizeof string,"%s has has teleported to Los Antos Airport Stunt, type /lsair to join! ",pName, playerid);
        SendClientMessageToAll(0x00B2FFFF,string);
        TogglePlayerControllable(playerid,1);
       
        }
        case 5:
        {
        ShowMenuForPlayer(teles,playerid);
        }
Reply
#2

Is it just crashing when you respond to a menu, when you teleport or return to that 'teles' menu?
Reply
#3

Quote:
Originally Posted by Hiddos
Посмотреть сообщение
Is it just crashing when you respond to a menu, when you teleport or return to that 'teles' menu?
No only if i type /tele it shows options for teleports

Then server crashes are show u a few more possible causes.


pawn Код:
teles = CreateMenu("~b~Tele",1,20,120,150,40);
        SetMenuColumnHeader(teles, 0, "Choose an item");
        AddMenuItem(teles,0,"StuntZones");
        AddMenuItem(teles,0,"Skyroads");
        AddMenuItem(teles,0,"Halfpipes");
        AddMenuItem(teles,0,"Drifts");
        AddMenuItem(teles,0,"Derbys");
        AddMenuItem(teles,0,"Tuning");


        stuntzone = CreateMenu("~b~StuntZones", 1,20,120,150,40);
        SetMenuColumnHeader(stuntzone, 0,"Choose a zone");
        AddMenuItem(stuntzone, 0, "Los Antos Beach stuntzone");
        AddMenuItem(stuntzone, 0, "Abanend Airport Stuntzone");
        AddMenuItem(stuntzone, 0, "Mount Chilliad Stuntzone");
        AddMenuItem(stuntzone, 0, "Los antos Airport StuntZone");
        AddMenuItem(stuntzone, 0, "~r~back");
       

        drift = CreateMenu("~b~Skyroads", 1,20,120,150,40);
        SetMenuColumnHeader(drift, 0, "Choose a skyroad!");
        AddMenuItem(drift, 0, "Death tunnel");
        AddMenuItem(drift, 0, "Smalljump");
        AddMenuItem(drift, 0, "City Jump");
        AddMenuItem(drift, 0, "~r~back");
       

        stuntzones = CreateMenu("~b~Halfpipes", 1,20,120,150,40);
        SetMenuColumnHeader(stuntzones, 0, "Choose a halfpipe");
        AddMenuItem(stuntzones, 0, "Huge Halfpipe ");
        AddMenuItem(stuntzones, 0, "~r~back");
       

        weapons = CreateMenu("~b~Drifts", 1,20,120,150,40);
        SetMenuColumnHeader(weapons, 0, "Choose a drift");
        AddMenuItem(weapons, 0,"Big ear drifting");
        AddMenuItem(weapons, 0, "~r~back");


        inter = CreateMenu("~b~Derbys", 1,20,120,150,40);
        SetMenuColumnHeader(inter, 0, "Choose a derby");
        AddMenuItem(inter, 0, "Dumper madness");
        AddMenuItem(inter, 0, "~r~back");


        dm = CreateMenu("~b~Tuning", 1,20,120,150,40);
        SetMenuColumnHeader(dm, 0, "Choose a tune garage");
        AddMenuItem(dm, 0, "Transfender tune");
        AddMenuItem(dm, 0, "Wheel Arch Angel tune");
        AddMenuItem(dm, 0, "Lo Co Loc Tune ");
        AddMenuItem(dm, 0, "~r~back");
Reply
#4

Can we see the command?
Reply
#5

Do you get any warnings in your GameMode?
Wrong arguments, ect. ?
Reply
#6

Quote:
Originally Posted by MikkelGutten
Посмотреть сообщение
Do you get any warnings in your GameMode?
Wrong arguments, ect. ?
No no warnings or errors.
Reply
#7

pawn Код:
if (strcmp("/tele", cmdtext, true, 10) == 0)
    {   ShowMenuForPlayer(teles,playerid);
       
        return 1;
    }
That shows the menu
Reply
#8

Are colors like ~b~ and ~r~ even allowed in menus?

Try removing those and see if you still crash.
Reply
#9

Quote:
Originally Posted by Grim_
Посмотреть сообщение
Are colors like ~b~ and ~r~ even allowed in menus?

Try removing those and see if you still crash.
No i've had them in other menus before and they don't cause anything.

Help ;(
Reply
#10

Try debugging the code.

Start adding print() messages in OnPlayerCommandText, then in the command.
See if ShowPlayerMenu() is being executed before the server crashes.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)