28.01.2011, 07:24
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.
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;
}