SERVER:UNknown Command
#1

IO get Unkwon Command, why?

pawn Код:
if(strcmp(cmd, "/fill", true) == 0)
    {
      if(IsPlayerConnected(playerid))
      {
        if(IsPlayerInAnyVehicle(playerid))
        {
            if (AccountInfo[playerid][aLogged] == 0)
                {
                  format(string, sizeof(string), "Du bist nicht eingeloggt.");
                  format(string2, sizeof(string2),"You are not logged in.");
                  SendLanguageMessage(playerid, COLOR_GREY, string, string2);
                    return 1;
                }
                new gs = GetPlayerGasStation(playerid);
                if(GasStation[gs][gFuel] < 1)
                {
                  format(string, sizeof(string), "Diese Tankstelle ist leer.");
                  format(string2, sizeof(string2), "This gas station has no fuel left.");
                  SendLanguageMessage(playerid, COLOR_GREY, string, string2);
                    return 1;
                }
                if(gs == 21)
                {
                  format(string, sizeof(string), "Du bist nicht an einer Tankstelle.");
                  format(string2, sizeof(string2), "You are not at a gas station.");
                  SendLanguageMessage(playerid, COLOR_GREY, string, string2);
                    return 1;
                }
                if(spawncar_gas[GetPlayerVehicleID(playerid)] == spawncar_gas_volume[GetPlayerVehicleID(playerid)])
                {
                  format(string, sizeof(string), "Du kannst nichts Tanken, weil dein Tank voll ist.");
                  format(string2, sizeof(string2), "You can't fill your car, because you have max. gas.");
                  SendLanguageMessage(playerid, COLOR_GREY, string, string2);
                    return 1;
                }
                if(spawncar_gas_type[GetPlayerVehicleID(playerid)] == 7)
                {
                  format(string, sizeof(string), "Du kannst mit diesem Fahrzeug nicht Tanken.");
                  format(string2, sizeof(string2), "You can't fill up this car.");
                  SendLanguageMessage(playerid, COLOR_GREY, string, string2);
                    return 1;
                }
                if(AccountInfo[playerid][aLanguage] == 2)
                {
                  format(string2, sizeof(string2), "Gasoline ($%d)\nBenzin ($%d) \nSuper Plus ($%d) \nSuperBenzin ($%d) \nKersoin ($%d)",
                  GasStation[gs-1][gDieselPrice], GasStation[gs-1][gBenzinPrice], GasStation[gs-1][gSuperPlusPrice],
                  GasStation[gs-1][gSuperBenzinPrice], GasStation[gs-1][gKerosinPrice]);
                  ShowPlayerDialog(playerid, 4000, DIALOG_STYLE_LIST, "Gas Station - Fill Up", string2,"Accept","Cancel");
                  return 1;
                }
                else
                {
                  format(string, sizeof(string), "Diesel ($%d)\nBenzin ($%d) \nSuper Plus ($%d) \nSuperBenzin ($%d) \nKersoin ($%d)",
                  GasStation[gs-1][gDieselPrice], GasStation[gs-1][gBenzinPrice], GasStation[gs-1][gSuperPlusPrice],
                  GasStation[gs-1][gSuperBenzinPrice], GasStation[gs-1][gKerosinPrice]);
                  ShowPlayerDialog(playerid, 4000, DIALOG_STYLE_LIST, "Tankstelle - Tanken", string,"Auswдhlen","Abbrechen");
                  return 1;
                }
            }
        }//not connected
        return 1;
    }
Reply
#2

debug it

eg:

http://files.uploadffs.com/3/157a3159/fill.pwn
Reply
#3

Check your variables. If you over flow an array it causes a script hault. Example
pawn Код:
new array[32];
array[36]=13; //36 is obviously outside the range of the array
Also, why do you have a 'IsPlayerConnected" check in there? How is a player going to type the command if he isn't even connected?
Reply
#4

where I put this code?
Reply
#5

Quote:
Originally Posted by Leixx
where I put this code?
If you want complete filterscripts or gamemodes you'll have to look at the other section mate.
http://forum.sa-mp.com/index.php?board=62.0
http://forum.sa-mp.com/index.php?board=30.0
Reply
#6

Quote:
Originally Posted by KnooL
If you want complete filterscripts or gamemodes you'll have to look at the other section mate.
http://forum.sa-mp.com/index.php?board=62.0
http://forum.sa-mp.com/index.php?board=30.0
I do not understand, could send one with command ...
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)