Well this is embarissing...
#1

Well I have an issue. My client crashes when I enter any vehicle, but only on my script.

I've tested all vehicles and the same, crash. Below I have all stuff that can affect a player when entering a vehicle.

What is going on?

Thanks in advance.

P.S I don't have any preloaded vehicles.

pawn Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
   
/*
    if(newstate == PLAYER_STATE_DRIVER)
    {
     
    new vname[50];
    if(VehicleInfo[GetPlayerVehicleID(playerid)][Rented] == false && VehicleInfo[GetPlayerVehicleID(playerid)][Rentable] == TRUE && VehicleInfo[GetPlayerVehicleID(playerid)][Type] == TYPE_RENTABLE)
    {
            TogglePlayerControllable(playerid, 0);
            GetVehicleName(VehicleInfo[GetPlayerVehicleID(playerid)][vModel], vname, sizeof(vname));
            format(string, sizeof(string), "{FF0000}%s {FFFFFF}for Rent\n\nYou can rent this {FF0000}%s{FFFFFF} for the price of {00800096}${FF0000}%i.", vname, vname, VehicleInfo[GetPlayerVehicleID(playerid)][RentPrice]);
            ShowPlayerDialog(playerid,DIALOG_RENT,DIALOG_STYLE_MSGBOX,"Vehicle",string,"Rent","Cancel");
            return 0;
    }
    if(VehicleInfo[GetPlayerVehicleID(playerid)][Type] == TYPE_BUYABLE && strcmp(VehicleInfo[GetPlayerVehicleID(playerid)][Owner], "None", true))
    {
        TogglePlayerControllable(playerid, 0);
        GetVehicleName(VehicleInfo[GetPlayerVehicleID(playerid)][vModel], vname, sizeof(vname));
        format(string, sizeof(string), "This %s is for sale\n\nYou can buy this %s for the price of $%i.", vname, vname, VehicleInfo[GetPlayerVehicleID(playerid)][Price]);
        ShowPlayerDialog(playerid,DIALOG_BUY,DIALOG_STYLE_MSGBOX,"Vehicle",string,"Purchase","Cancel");
    }*/

    return 1;
}


public OnPlayerEnterVehicle(playerid, vehicleid)
{
    return 1;
}

public OnPlayerUpdate(playerid)
{
/*
    if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
    {
        for(new i = 0; i < sizeof(SpikeData); i++)
        {
            if(IsPlayerInRangeOfPoint(playerid, 3.0, SpikeData[i][sX], SpikeData[i][sY], SpikeData[i][sZ]))
              {
                if(SpikeData[i][sCreated] == 1)
                  {
                    new panels, doors, lights, tires;
                    new carid = GetPlayerVehicleID(playerid);
                    GetVehicleDamageStatus(carid, panels, doors, lights, tires);
                    tires = encode_tires(1, 1, 1, 1);
                    UpdateVehicleDamageStatus(carid, panels, doors, lights, tires);
                    return 0;
                }
            }
        }
    }*/

    return 1;
}
command(veh, playerid, params[]) {
    if(sscanf(params, "iii", SscanfArray[0], SscanfArray[1], SscanfArray[2])) return SendClientMessage(playerid, COLOR_YELLOW, "[SYNTAX]: /veh [model] [color1] [color2]");
    if(IsPlayerServerAdmin(playerid, 4)) {
        new Float:Pos[4];
        GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
        GetPlayerFacingAngle(playerid, Pos[3]);
        SpawnedV[playerid] = CreateVehicle(SscanfArray[0], Pos[0], Pos[1], Pos[2], Pos[3], SscanfArray[1], SscanfArray[2], -1);
        VehicleInfo[SpawnedV[playerid]][Type] = 0;
        VehicleInfo[SpawnedV[playerid]][Engine] = true;
        VehicleInfo[SpawnedV[playerid]][Fuel] = 99;//I've tried changing this to 0, 1, 99999 but still....
    }
    else
{
        SendNonAdminErrorMessage (playerid, 4);
    }
    return 1;
}
Reply
#2

What is this doin in that string?

{00800096}

pawn Код:
format(string, sizeof(string), "{FF0000}%s {FFFFFF}for Rent\n\nYou can rent this {FF0000}%s{FFFFFF} for the price of {00800096}${FF0000}%i.", vname, vname, VehicleInfo[GetPlayerVehicleID(playerid)][RentPrice]);
Incorrect RGB codes can crash your game as far as i know.
Reply
#3

Oops I forgot about that. Anyways I have commented that part as you see, so no that's not the problem, but thanks about the invalid color part.
Reply
#4

Includes/filterscripts?
Reply
#5

pawn Код:
#include <a_samp>
#include <mysql>
#include <zcmd>
#include <sscanf2>
#include <streamer>
#include <foreach>
....and no Filter scripts....But I think it's something wrong with my PC, I'm re-installing Windows now on my desktop...
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)