[HELP] [0.3c] Server shuts down when command is done
#1

Of some wierd reason, the server window just closes itself when I perform the command /alarm.

Here is the code of the command:

pawn Код:
if (!strcmp(cmdtext, "/alarm", true, 6))
    {
        new vehicleid = GetClosestVehicle(playerid);
        if(IsPlayerInAnyVehicle(playerid) || GetDistanceToVehicle(playerid, vehicleid) <= 10){

            new vehfile[128];
            format(vehfile, sizeof(vehfile), "vehicles/Vehicle_%d", vehicleid);
                 
                 new Locked = dini_Int(vehfile, "Locked");
                 new vehfaction = dini_Int(vehfile, "Faction");
                 new vehowner = dini_Int(vehfile, "Owner");
                 new vehjob = dini_Int(vehfile, "Job");
                 new name[MAX_PLAYER_NAME], usrvehfile[256];

                 GetPlayerName(playerid, name, sizeof(name));
                 format(usrvehfile, sizeof(usrvehfile), SERVER_USER_FILE, name);
                 new Faction = dini_Int(usrvehfile, "Faction");
                 new usrjob = dini_Int(usrvehfile, "Job");
                 new AdminLevel = dini_Int(usrvehfile, "AdminLevel");
                 if(Faction == vehfaction && Faction != 0 || usrjob == vehjob && usrjob != 0 || vehowner == GetPlayerName(playerid) || AdminLevel >= 2){
                 new loccet;
                 new engine, lights, alarm, doors, bonnet, boot, objective;
                 GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);


            if(alarm != 1){
                  loccet = 1;
                  SendClientMessage(playerid, WHITE, "The alarm was toggled on" );
                  dini_IntSet(vehfile, "Alarm", 1);
                  SetVehicleParamsEx(vehicleid, engine, lights, 1, doors, bonnet, boot, objective);
                 
            }else{
                  loccet = 0;
                  SendClientMessage(playerid, WHITE, "The alarm was toggled off" );
                  dini_IntSet(vehfile, "Alarm", 0);
                  SetVehicleParamsEx(vehicleid, engine, lights, 0, doors, bonnet, boot, objective);
                 
            }

                }else{
                      SendClientMessage(playerid, WHITE, "You may only toggle the alarm of a vehicle belonging to you or your faction." );
                }

        }else{
            SendClientMessage(playerid, WHITE, "You have to be in or near the vehicle you want to toggle the alarm of." );
        }
        return 1;
    }

Any ideas?
Reply
#2

It just closes?I mean,not even a message?
Reply
#3

dont use dini's lol?
Reply
#4

Yes,i didn't saw the dini's
This is kinda hard for you if your an beginner,but let's guess that your not .

enum pInfo
{
pAdminLevel,
pCash,
pScore,
}
new PlayerInfo[MAX_PLAYERS][pInfo];
Reply
#5

male sure you have the folder "vehicles" inside your "Scriptfiles"
Reply
#6

Also, next tune put this topic in the 0.3c Scripting Area
Reply
#7

I have the EXACT same thing.
Reply
#8

I fixed it by removing my logging features, as the table wasn't in the database for it to log to, therefore on command, it was crashing.
Reply
#9

The files are actually there, and loading, but the server closes, without an error message anyway.

And the 0.3c section is not the right section for this
Reply
#10

Quote:
Originally Posted by Kyle_Olsen
Посмотреть сообщение
The files are actually there, and loading, but the server closes, without an error message anyway.

And the 0.3c section is not the right section for this
Yes it is, since your using 0.3c right? Then this would go in there.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)