02.11.2013, 10:12
After 12-13 hours of running well...
pawn Код:
[02/11/2013 12:05:31] [debug] Run time error 4: "Array index out of bounds"
[02/11/2013 12:05:31] [debug] Accessing element at index 65535 past array upper bound 1999
[02/11/2013 12:05:31] [debug] AMX backtrace:
[02/11/2013 12:05:31] [debug] #0 000e3d04 in public CarSpawner (playerid=9, model=522) at C:\Documents and Settings\user\Desktop\Stunt Evolution - Beta\gamemodes\STUNT-EVOLUTION.pwn:17794
[02/11/2013 12:05:31] [debug] #1 0011f484 in public cmd_nrg (playerid=9, params[]=@0x002f5748 "") at C:\Documents and Settings\user\Desktop\Stunt Evolution - Beta\gamemodes\STUNT-EVOLUTION.pwn:22335
[02/11/2013 12:05:31] [debug] #2 00009464 in public OnPlayerCommandText (playerid=9, cmdtext[]=@0x002f5734 "") at C:\Documents and Settings\user\Desktop\Stunt Evolution - Beta\pawno\include\zcmd.inc:102
pawn Код:
function CarSpawner( playerid, model )
{
if ( IsPlayerInAnyVehicle( playerid ) )
return SendError( playerid, "You already drive a car!" );
else
{
new
Float:x,
Float:y,
Float:z,
Float:angle
;
GetPlayerPos( playerid, x, y, z );
GetPlayerFacingAngle( playerid, angle );
if ( PlayerInfo[ playerid ][ pCar ] != -1 )
CarDeleter( PlayerInfo[ playerid ][ pCar ] );
new vehicleid = CreateVehicle( model, x, y, z, angle, -1, -1, -1 );
PutPlayerInVehicle( playerid, vehicleid, 0 );
SetVehicleNumberPlate( vehicleid, ""R"S"W"tun"O"T" );
SetVehicleVirtualWorld( vehicleid, GetPlayerVirtualWorld( playerid ) );
LinkVehicleToInterior( vehicleid, GetPlayerInterior( playerid ) );
ChangeVehicleColor( vehicleid, 0,7 );
PlayerInfo[ playerid ][ pCar ] = vehicleid;
format( VehicleOwner[ vehicleid ], 25, "Server" );
for ( new Any = 0; Any < MAX_VEHICLE_ATTACHED_OBJECTS; Any++ )
if ( IsValidDynamicObject( p_Object[ playerid ][ Any ] ) )
DestroyDynamicObject( p_Object[ playerid ][ Any ] );
}
return ( 1 );
}
CMD:nrg( playerid, params[ ] )
{
if ( IsPlayerInAnyVehicle( playerid ) )
return SendError( playerid, "You already have a vehicle!" );
CarSpawner( playerid, 522 );
SendClientMessage( playerid, COLOR_ABLUE, "Enjoy your new bike!" );
return ( 1 );
}