/buildrace shuts of server
#1

Hi guys im using a Ryders Racing system, that i transported to my GM, and have all the files that are needed. So i type /buildrace everythings fine, i name the race, pick a car that i want the race to be with, and the when im drving and i get to the point where i will have race cars spawn im suppose to press LMB, which i do and in a few seconds the server just dies. This is the part of the script that is activated(no file gets created tho):

pawn Код:
if(newkeys & KEY_FIRE)
    {
        if(BuildRace == playerid+1)
        {
            if(BuildTakeVehPos == true)
            {
                if(!IsPlayerInAnyVehicle(playerid)) return// SendClientMessage(playerid, RED, ">> You need to be in a vehicle");
                format(rFile, sizeof(rFile), "/rRaceSystem/%s.RRACE", BuildName);
                GetVehiclePos(GetPlayerVehicleID(playerid), vPos[0], vPos[1], vPos[2]);
                GetVehicleZAngle(GetPlayerVehicleID(playerid), vPos[3]);
                dini_Create(rFile);
                dini_IntSet(rFile, "vModel", BuildModeVID);
                dini_IntSet(rFile, "rType", BuildRaceType);
                format(string, sizeof(string), "vPosX_%d", BuildVehPosCount), dini_FloatSet(rFile, string, vPos[0]);
                format(string, sizeof(string), "vPosY_%d", BuildVehPosCount), dini_FloatSet(rFile, string, vPos[1]);
                format(string, sizeof(string), "vPosZ_%d", BuildVehPosCount), dini_FloatSet(rFile, string, vPos[2]);
                format(string, sizeof(string), "vAngle_%d", BuildVehPosCount), dini_FloatSet(rFile, string, vPos[3]);
                format(string, sizeof(string), ">> Vehicle Pos '%d' has been taken.", BuildVehPosCount+1);
                SendClientMessage(playerid, YELLOW, string);
                BuildVehPosCount++;
            }
            if(BuildVehPosCount >= 2)
            {
                BuildVehPosCount = 0;
                BuildTakeVehPos = false;
                ShowDialog(playerid, 605);
            }
            if(BuildTakeCheckpoints == true)
            {
                if(BuildCheckPointCount > MAX_RACE_CHECKPOINTS_EACH_RACE) return SendClientMessage(playerid, raudona, ">> Pasiekei maximuma, checkpointu!");
                if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, raudona, ">> You need to be in a vehicle");
                format(rFile, sizeof(rFile), "/rRaceSystem/%s.RRACE", BuildName);
                GetVehiclePos(GetPlayerVehicleID(playerid), vPos[0], vPos[1], vPos[2]);
                format(string, sizeof(string), "CP_%d_PosX", BuildCheckPointCount), dini_FloatSet(rFile, string, vPos[0]);
                format(string, sizeof(string), "CP_%d_PosY", BuildCheckPointCount), dini_FloatSet(rFile, string, vPos[1]);
                format(string, sizeof(string), "CP_%d_PosZ", BuildCheckPointCount), dini_FloatSet(rFile, string, vPos[2]);
                format(string, sizeof(string), ">> Checkpoint '%d' has been setted!", BuildCheckPointCount+1);
                SendClientMessage(playerid, YELLOW, string);
                BuildCheckPointCount++;
            }
        }
    }
What could be the issue?
Reply
#2

Try to debug so, you can know where exactly is the problem:
Here's an example:
pawn Код:
if(newkeys & KEY_FIRE)
    {
        print("1: It got called.");
        if(BuildRace == playerid+1)
        {
            print("2: It got called.");
            if(BuildTakeVehPos == true)
            {
                print("3: It got called.");
Try to use this plugin aswell:
https://sampforum.blast.hk/showthread.php?tid=262796

---------
Make sure you have rRaceSystem folder in your scriptfiles folder.
Reply
#3

Nope, nope..
I doubt if you've created all the necessary folders inside scriptfiles for it to create the FILES.
Reply
#4

What? Why did you uncomment?
Код:
if(!IsPlayerInAnyVehicle(playerid)) return// SendClientMessage(playerid, RED, ">> You need to be in a vehicle");
What to do after return? Nothing, no closing sentence, crash.

Here:
Код:
if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, RED, ">> You need to be in a vehicle");
Reply
#5

Thank you guys it worked!
Reply
#6

I have one tip for you, get rid of dini saving system use something more efficient like y_ini(******) or SQLitei(Slice).
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)