SA-MP Forums Archive
[HELP] [0.3c] Server shuts down when command is done - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: [HELP] [0.3c] Server shuts down when command is done (/showthread.php?tid=199428)



[HELP] [0.3c] Server shuts down when command is done - Kyle_Olsen - 15.12.2010

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?


Re: [HELP] [0.3c] Server shuts down when command is done - SkizzoTrick - 15.12.2010

It just closes?I mean,not even a message?


Re: [HELP] [0.3c] Server shuts down when command is done - Baboon - 15.12.2010

dont use dini's lol?


Re: [HELP] [0.3c] Server shuts down when command is done - SkizzoTrick - 15.12.2010

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];


Re: [HELP] [0.3c] Server shuts down when command is done - XePloiT - 15.12.2010

male sure you have the folder "vehicles" inside your "Scriptfiles"


Re: [HELP] [0.3c] Server shuts down when command is done - SampStunta - 15.12.2010

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


Re: [HELP] [0.3c] Server shuts down when command is done - Moglizorz. - 15.12.2010

I have the EXACT same thing.


Re: [HELP] [0.3c] Server shuts down when command is done - Moglizorz. - 15.12.2010

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.


Re: [HELP] [0.3c] Server shuts down when command is done - Kyle_Olsen - 16.12.2010

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


Re: [HELP] [0.3c] Server shuts down when command is done - Steven82 - 16.12.2010

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.