[DtenHost-22:19:15] [debug] AMX backtrace:
[DtenHost-22:19:15] [debug] #0 00006e28 in ?? (0x000005ae) from BEG2.amx
[DtenHost-22:19:15] [debug] #1 00027e34 in public VeloDiego () from BEG2.amx
[DtenHost-22:19:15] [debug] Run time error 4: "Array index out of bounds"
[DtenHost-22:19:15] [debug] Accessing element at negative index -400
[DtenHost-22:19:15] [debug] AMX backtrace:
[DtenHost-22:19:15] [debug] #0 00006e28 in ?? (0x000005ae) from BEG2.amx
[DtenHost-22:19:15] [debug] #1 00027e34 in public VeloDiego () from BEG2.amx
[DtenHost-22:19:15] [debug] Run time error 4: "Array index out of bounds"
[DtenHost-22:19:15] [debug] Accessing element at negative index -400
[DtenHost-22:19:15] [debug] AMX backtrace:
[DtenHost-22:19:15] [debug] #0 00006e28 in ?? (0x000005ae) from BEG2.amx
[DtenHost-22:19:15] [debug] #1 00027e34 in public VeloDiego () from BEG2.amx
[DtenHost-22:19:15] [debug] Run time error 4: "Array index out of bounds"
[DtenHost-22:19:15] [debug] Accessing element at negative index -400
[DtenHost-22:19:15] [debug] AMX backtrace:
[DtenHost-22:19:15] [debug] #0 00006e28 in ?? (0x000005ae) from BEG2.amx
[DtenHost-22:19:15] [debug] #1 00027e34 in public VeloDiego () from BEG2.amx
[DtenHost-22:19:15] [debug] Run time error 4: "Array index out of bounds"
[DtenHost-22:19:15] [debug] Accessing element at negative index -400
[DtenHost-22:19:15] [debug] AMX backtrace:
[DtenHost-22:19:15] [debug] #0 00006e28 in ?? (0x000005ae) from BEG2.amx
[DtenHost-22:19:15] [debug] #1 00027e34 in public VeloDiego () from BEG2.amx
[DtenHost-22:19:15] [debug] Run time error 4: "Array index out of bounds"
[DtenHost-22:19:15] [debug] Accessing element at negative index -400
[DtenHost-22:19:15] [debug] AMX backtrace:
[DtenHost-22:19:15] [debug] #0 00006e28 in ?? (0x000005ae) from BEG2.amx
[DtenHost-22:19:15] [debug] #1 00027e34 in public VeloDiego () from BEG2.amx
[DtenHost-22:19:15] [debug] Run time error 4: "Array index out of bounds"
[DtenHost-22:19:15] [debug] Accessing element at negative index -400
[DtenHost-22:19:15] [debug] AMX backtrace:
[DtenHost-22:19:15] [debug] #0 00006e28 in ?? (0x000005ae) from BEG2.amx
[DtenHost-22:19:15] [debug] #1 00027e34 in public VeloDiego () from BEG2.amx
[DtenHost-22:19:16] [debug] Run time error 4: "Array index out of bounds"
[DtenHost-22:19:16] [debug] Accessing element at negative index -400
[DtenHost-22:19:16] [debug] AMX backtrace:
[DtenHost-22:19:16] [debug] #0 00006e28 in ?? (0x000005ae) from BEG2.amx
[DtenHost-22:19:16] [debug] #1 00027e34 in public VeloDiego () from BEG2.amx
[DtenHost-22:19:16] [debug] Run time error 4: "Array index out of bounds"
[DtenHost-22:19:16] [debug] Accessing element at negative index -400
[DtenHost-22:19:16] [debug] AMX backtrace:
[DtenHost-22:19:16] [debug] #0 00006e28 in ?? (0x000005ae) from BEG2.amx
[DtenHost-22:19:16] [debug] #1 00027e34 in public VeloDiego () from BEG2.amx
[DtenHost-22:19:16] [debug] Run time error 4: "Array index out of bounds"
[DtenHost-22:19:16] [debug] Accessing element at negative index -400
[DtenHost-22:19:16] [debug] AMX backtrace:
[DtenHost-22:19:16] [debug] #0 00006e28 in ?? (0x000005ae) from BEG2.amx
[DtenHost-22:19:16] [debug] #1 00027e34 in public VeloDiego () from BEG2.amx
[DtenHost-22:19:16] [debug] Run time error 4: "Array index out of bounds"
[DtenHost-22:19:16] [debug] Accessing element at negative index -400
[DtenHost-22:19:16] [debug] AMX backtrace:
[DtenHost-22:19:16] [debug] #0 00006e28 in ?? (0x000005ae) from BEG2.amx
[DtenHost-22:19:16] [debug] #1 00027e34 in public VeloDiego () from BEG2.amx
[DtenHost-22:19:16] [debug] Run time error 4: "Array index out of bounds"
[DtenHost-22:19:16] [debug] Accessing element at negative index -400
[DtenHost-22:19:16] [debug] AMX backtrace:
[DtenHost-22:19:16] [debug] #0 00006e28 in ?? (0x000005ae) from BEG2.amx
[DtenHost-22:19:16] [debug] #1 00027e34 in public VeloDiego () from BEG2.amx
[DtenHost-22:19:16] [debug] Run time error 4: "Array index out of bounds"
[DtenHost-22:19:16] [debug] Accessing element at negative index -400
[DtenHost-22:19:16] [debug] AMX backtrace:
[DtenHost-22:19:16] [debug] #0 00006e28 in ?? (0x000005ae) from BEG2.amx
[DtenHost-22:19:16] [debug] #1 00027e34 in public VeloDiego () from BEG2.amx
[DtenHost-22:19:16] [debug] Run time error 4: "Array index out of bounds"
[DtenHost-22:19:16] [debug] Accessing element at negative index -400
[DtenHost-22:19:16] [debug] AMX backtrace:
[DtenHost-22:19:16] [debug] #0 00006e28 in ?? (0x000005ae) from BEG2.amx
[DtenHost-22:19:16] [debug] #1 00027e34 in public VeloDiego () from BEG2.amx
[DtenHost-22:19:16] [debug] Run time error 4: "Array index out of bounds"
[DtenHost-22:19:16] [debug] Accessing element at negative index -400
[DtenHost-22:19:16] [debug] AMX backtrace:
[DtenHost-22:19:16] [debug] #0 00006e28 in ?? (0x000005ae) from BEG2.amx
[DtenHost-22:19:16] [debug] #1 00027e34 in public VeloDiego () from BEG2.amx
[DtenHost-22:19:16] [debug] Run time error 4: "Array index out of bounds"
[DtenHost-22:19:16] [debug] Accessing element at negative index -400
[DtenHost-22:19:16] [debug] AMX backtrace:
[DtenHost-22:19:16] [debug] #0 00006e28 in ?? (0x000005ae) from BEG2.amx
[DtenHost-22:19:16] [debug] #1 00027e34 in public VeloDiego () from BEG2.amx
[DtenHost-22:19:17] [debug] Run time error 4: "Array index out of bounds"
[DtenHost-22:19:17] [debug] Accessing element at negative index -400
[DtenHost-22:19:17] [debug] AMX backtrace:
[DtenHost-22:19:17] [debug] #0 00006e28 in ?? (0x000005ae) from BEG2.amx
[DtenHost-22:19:17] [debug] #1 00027e34 in public VeloDiego () from BEG2.amx
[DtenHost-22:19:17] [debug] Run time error 4: "Array index out of bounds"
[DtenHost-22:19:17] [debug] Accessing element at negative index -400
[DtenHost-22:19:17] [debug] AMX backtrace:
[DtenHost-22:19:17] [debug] #0 00006e28 in ?? (0x000005ae) from BEG2.amx
[DtenHost-22:19:17] [debug] #1 00027e34 in public VeloDiego () from BEG2.amx
[DtenHost-22:19:17] [debug] Run time error 4: "Array index out of bounds"
[DtenHost-22:19:17] [debug] Accessing element at negative index -400
[DtenHost-22:19:17] [debug] AMX backtrace:
[DtenHost-22:19:17] [debug] #0 00006e28 in ?? (0x000005ae) from BEG2.amx
[DtenHost-22:19:17] [debug] #1 00027e34 in public VeloDiego () from BEG2.amx
[DtenHost-22:19:17] [debug] Run time error 4: "Array index out of bounds"
[DtenHost-22:19:17] [debug] Accessing element at negative index -400
[DtenHost-22:19:17] [debug] AMX backtrace:
[DtenHost-22:19:17] [debug] #0 00006e28 in ?? (0x000005ae) from BEG2.amx
[DtenHost-22:19:17] [debug] #1 00027e34 in public VeloDiego () from BEG2.amx
[DtenHost-22:19:17] [debug] Run time error 4: "Array index out of bounds"
[DtenHost-22:19:17] [debug] Accessing element at negative index -400
[DtenHost-22:19:17] [debug] AMX backtrace:
[DtenHost-22:19:17] [debug] #0 00006e28 in ?? (0x000005ae) from BEG2.amx
[DtenHost-22:19:17] [debug] #1 00027e34 in public VeloDiego () from BEG2.amx
[DtenHost-22:19:17] [debug] Run time error 4: "Array index out of bounds"
[DtenHost-22:19:17] [debug] Accessing element at negative index -400
[DtenHost-22:19:17] [debug] AMX backtrace:
[DtenHost-22:19:17] [debug] #0 00006e28 in ?? (0x000005ae) from BEG2.amx
[DtenHost-22:19:17] [debug] #1 00027e34 in public VeloDiego () from BEG2.amx
public VeloDiego()
{
new Float:Speedo_X,Float:Speedo_Y,Float:Speedo_Z;
new Float:Speedo_HP;
for(new i=0; i<MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i) && IsPlayerInAnyVehicle(i))
{
GetPlayerPos(i, Speedo_X, Speedo_Y, Speedo_Z);
GetPlayerVehicleID(i);
GetVehicleHealth(GetPlayerVehicleID(i), Speedo_HP);
new str1[256], str2[256], str4[256], str6[256], str7[256];
new newcar = GetPlayerVehicleID(i);
TextDrawShowForPlayer(i, box[i]);
TextDrawShowForPlayer(i, fahrzeug[i]);
TextDrawShowForPlayer(i, IdBVJ[i]);
TextDrawShowForPlayer(i, mph[i]);
TextDrawShowForPlayer(i, combustivelt[i]);
TextDrawShowForPlayer(i, zustand[i]);
TextDrawShowForPlayer(i, gps[i]);
TextDrawShowForPlayer(i, hoehe[i]);
format(str1,sizeof(str1),"~w~~d~Veiculo: ~b~~h~~h~%s", GetVehicleName(GetPlayerVehicleID(i)));
TextDrawSetString(fahrzeug[i], str1);
format(str2,sizeof(str2),"~w~~d~KM/H: ~y~%d", GetPlayerSpeed(i, true));
TextDrawSetString(mph[i], str2);
if(IsACopCar(newcar) || IsAExCar(newcar) || IsAnAmbulanceCar(newcar) || IsAPoliciaCivilCar(newcar) || IsAPFCar(newcar) || IsAROTAMsCar(newcar) || IsAGOVCar(newcar))
{
format(str4,sizeof(str4),"~w~~d~Blindagem: ~r~~h~Sim");
}
else
{
format(str4,sizeof(str4),"~w~~d~Lataria: ~r~~h~%0.0f%%", Speedo_HP/10);
}
TextDrawSetString(zustand[i], str4);
format(str6,sizeof(str6),"~w~~d~Altura: ~p~~h~%.1f", Speedo_Z);
TextDrawSetString(hoehe[i], str6);
format(str7,sizeof(str7),"~w~~d~Id: ~g~%d", GetVehicleModel(GetPlayerVehicleID(i)));
TextDrawSetString(IdBVJ[i], str7);
}
if(GPS_Spawned[i] == 1 && PlayerInfo[i][AreaName] != PlayerText:INVALID_TEXT_DRAW)
{
new str5[256];
format(str5,sizeof(str5),"~w~~d~GPS: ~p~~h~%s", GetPlayerArea(i));
TextDrawSetString(gps[i], str5);
}
SaveBVJPlayerPos[i][LastX] = Speedo_X, SaveBVJPlayerPos[i][LastY] = Speedo_Y, SaveBVJPlayerPos[i][LastZ] = Speedo_Z;
}
for(new i=0; i<MAX_PLAYERS; i++)
{
if(!IsPlayerInAnyVehicle(i))
{
TextDrawHideForPlayer(i, box[i]);
TextDrawHideForPlayer(i, fahrzeug[i]);
TextDrawHideForPlayer(i, IdBVJ[i]);
TextDrawHideForPlayer(i, mph[i]);
TextDrawHideForPlayer(i, combustivelt[i]);
TextDrawHideForPlayer(i, zustand[i]);
TextDrawHideForPlayer(i, gps[i]);
TextDrawHideForPlayer(i, hoehe[i]);
//SpeedoON[i] = 0;
}
}
}
Aparentemente, й em alguma stock relacionada ao nome do veiculo (sei por prбtica).
Mande seu GetVehicleName ... |
stock GetPlayerSpeed(playerid,bool:kmh)
{
new Float:Vx,Float:Vy,Float:Vz,Float:rtn;
if(IsPlayerInAnyVehicle(playerid)) GetVehicleVelocity(GetPlayerVehicleID(playerid), Vx, Vy, Vz); else GetPlayerVelocity(playerid, Vx, Vy, Vz);
rtn = floatsqroot(floatabs(floatpower(Vx + Vy + Vz,2)));
return kmh?floatround(rtn * 100 * 1.61):floatround(rtn * 100);
}
stock ReturnPlayerZone(playerid)
{
new location[MAX_ZONE_NAME];
GetPlayer2DZone(playerid, location, MAX_ZONE_NAME);
return location;
}
stock GetPlayer2DZone(playerid, zone[], len)
{
new Float:x, Float:y, Float:z;
GetPlayerPos(playerid, x, y, z);
for(new i = 0; i != sizeof(gSAZones); i++)
{
if(x >= gSAZones[i][SAZONE_AREA][0] && x <= gSAZones[i][SAZONE_AREA][3] && y >= gSAZones[i][SAZONE_AREA][1] && y <= gSAZones[i][SAZONE_AREA][4])
{
return format(zone, len, gSAZones[i][SAZONE_NAME], 0);
}
}
return 0;
stock GetPlayerArea(playerid)
{
new str[130];
format(str,sizeof(str), "%s", Zones[GetPlayerZone(playerid)][zone_name]);
return str;
}
}
se for erro de stock nгo e esta porque eu troquei era
estб vehName[GetVehicleModel(vehicle)-400]); ai eu troquei pra ver |
stock GetVehicleName(vehicleid) {
new v[50];
if(GetVehicleModel(vehicleid) > 0)
format(v, 50, vehName[GetVehicleModel(vehicle)-400]);
return v;
}
Use a lуgica. o erro й acesso invбlido a -400
E o nome й acessado usando -400 '-' Isso ocorre provavelmente quando o player й retirado inesperada do veнculo. Entгo, deve usar algo pra ver se o modelo do veнculo nгo й 0. pawn Code:
|
G:\Pen Drive\Brasil Vida Juvenil\gamemodes\BEG2.pwn(1287) : error 017: undefined symbol "vehicle"
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
new vehName[][] =
{
"Landstalker","Bravura","Buffalo","Linerunner","Pereniel","Sentinel","Dumper","Firetruck","Trashmaster","Stretch","Manana","Infernus","Voodoo","Pony","Mule","Cheetah","Ambulance","Leviathan","Moonbeam","Esperanto","Taxi","Washington","Bobcat","Mr Whoopee","BF Injection",
"Hunter","Premier","Enforcer","Securicar","Banshee","Predator","Bus","Rhino","Barracks","Hotknife","Trailer","Previon","Coach","Cabbie","Stallion","Rumpo","RC Bandit","Romero","Packer","Monster","Admiral","Squalo","Seasparrow","Pizzaboy","Tram","Trailer","Turismo","Speeder",
"Reefer","Tropic","Flatbed","Yankee","Caddy","Solair","Berkley's RC Van","Skimmer","PCJ-600","Faggio","Freeway","RC Baron","RC Raider","Glendale","Oceanic","Sanchez","Sparrow","Patriot","Quad","Coastguard","Dinghy","Hermes","Sabre","Rustler","ZR3 50","Walton","Regina",
"Comet","BMX","Burrito","Camper","Marquis","Baggage","Dozer","Maverick","News Chopper","Rancher","FBI Rancher","Virgo","Greenwood","Jetmax","Hotring","Sandking","Blista Compact","Police Maverick","Boxville","Benson","Mesa","RC Goblin","Hotring Racer","Hotring Racer",
"Bloodring Banger","Rancher","Super GT","Elegant","Journey","Bike","Mountain Bike","Beagle","Cropdust","Stunt","Tanker","RoadTrain","Nebula","Majestic","Buccaneer","Shamal","Hydra","FCR-900","NRG-500","HPV1000","Cement Truck","Tow Truck","Fortune","Cadrona","FBI Truck",
"Willard","Forklift","Tractor","Combine","Feltzer","Remington","Slamvan","Blade","Freight","Streak","Vortex","Vincent","Bullet","Clover","Sadler","Firetruck","Hustler","Intruder","Primo","Cargobob","Tampa","Sunrise","Merit","Utility","Nevada","Yosemite","Windsor","Monster A",
"Monster B","Uranus","Jester","Sultan","Stratum","Elegy","Raindance","RC Tiger","Flash","Tahoma","Savanna","Bandito","Freight","Trailer","Kart","Mower","Duneride","Sweeper","Broadway","Tornado","AT-400","DFT-30","Huntley","Stafford","BF-400","Newsvan","Tug","Trailer","Emperor",
"Wayfarer","Euros","Hotdog","Club","Trailer B","Trailer C","Andromada","Dodo","RC Cam","Launch","Police Car","Police Car","Police Car","Police Ranger","Picador","S.W.A.T.","Alpha","Phoenix","Glendale","Sadler","Luggage Trailer","Luggage Trailer",
"Stair Trailer","Boxville","Farm Plow","Utility Trailer"
};
stock GetVehicleNameBVJ(vehicleid)
{
new v[50];
if(GetVehicleModel(vehicleid) > 0)
format(v, 50, vehName[GetVehicleModel(vehicle)-400]);
return v;
}
stock GetVehicleNameBVJ(vehicleid)
{
new v[50];
if(GetVehicleModel(vehicleid) > 0)
format(v, 50, vehName[GetVehicleModel(vehicleid)-400]);
return v;
}
pawn Code:
|