28.11.2013, 16:34
(
Последний раз редактировалось Jony_Cruze; 28.11.2013 в 17:19.
)
Solved , i got this problem crash server it's urgent !! pls help it's not from logvehicle !
pawn Код:
[19:24:31] [debug] Server crashed while executing rp.amx
[19:24:31] [debug] AMX backtrace:
[19:24:31] [debug] #0 0011e320 in PlayerUpdateListener (playerid=44) at C:\Users\asd\Desktop\SERVER\gamemodes\rp.pwn:27580
[19:24:31] [debug] #1 0004c774 in public CrashListener () at C:\Users\asd\Desktop\SERVER\gamemodes\rp.pwn:5841
[19:24:31] [debug] System backtrace:
[19:24:31] [debug] #0 f6be035b in _ZN10StackTraceC1EPv () from plugins/crashdetect.so
[19:24:31] [debug] #1 f6bd9389 in _ZN11crashdetect20PrintSystemBacktraceEPv () from plugins/crashdetect.so
[19:24:31] [debug] #2 f6bdb8ed in _ZN11crashdetect11OnExceptionEPv () from plugins/crashdetect.so
[19:24:31] [debug] #3 f6bdfe68 in ?? () from plugins/crashdetect.so
[19:24:31] [debug] #4 f77fe410 in ?? ()
[19:24:31] [debug] #5 080c9c47 in ?? () from /home/gsp_1327/93.119.26.226-7777/samp03svr
[19:24:31] [debug] #6 080cba55 in ?? () from /home/gsp_1327/93.119.26.226-7777/samp03svr
[19:24:31] [debug] #7 f6be219f in amx_Exec () from plugins/crashdetect.so
[19:24:31] [debug] #8 f6bdbdab in _ZN11crashdetect9DoAmxExecEPii () from plugins/crashdetect.so
[19:24:31] [debug] #9 f6bde457 in ?? () from plugins/crashdetect.so
[19:24:31] [debug] #10 080dc115 in ?? () from /home/gsp_1327/93.119.26.226-7777/samp03svr
[19:24:31] [debug] #11 080b5cfb in ?? () from /home/gsp_1327/93.119.26.226-7777/samp03svr
[19:24:31] [debug] #12 080b14d3 in ?? () from /home/gsp_1327/93.119.26.226-7777/samp03svr
[19:24:31] [debug] #13 f751ee46 in __libc_start_main () from /lib/i386-linux-gnu/i686/cmov/libc.so.6
[19:24:31] [debug] #14 0804b521 in ?? () from /home/gsp_1327/93.119.26.226-7777/samp03svr
pawn Код:
public CrashListener()
{
for(new i = 0; i < MAX_PLAYERS; i ++)
{
if(IsPlayerConnected(i) && !IsPlayerNPC(i)) PlayerUpdateListener(i);
//here if(IsPlayerConnectedEx(i))
{
if(IsPlayerInAnyVehicle(i) && !crash_detection_disabled[i])
{
new veh = GetPlayerVehicleID(i);
new Float:hp;
GetVehicleHealth(veh,hp);
if(hp < crash_vhp[veh])
{
new Float:difference;
difference = (crash_vhp[veh] - hp);
if(difference > 100)
{
new Float:speed_x, Float:speed_y, Float:speed_z;
GetVehicleVelocity(GetPlayerVehicleID(i),speed_x,speed_y,speed_z);
new Float:final_speed = floatsqroot(((speed_x*speed_x)+(speed_y*speed_y))+(speed_z*speed_z))*99.4166672; // 250.666667 = kmph // 199,4166672 = mph
new speed = floatround(final_speed,floatround_round);
if(speed < player_vehicle_speed[i])
{
new Float:sdifference;
sdifference = (player_vehicle_speed[i] - speed);
if(sdifference > 20)
{
new drunk_gain = 4000;
if(seatbelt[i]) { drunk_gain = 3000; }
SetPlayerDrunkLevel(i,(GetPlayerDrunkLevel(i) + drunk_gain));
if(difference > 100)
{
new Float:phploss;
phploss = floatround((difference / 4));
if(seatbelt[i]) { phploss = floatround(phploss / 2); if(phploss < 0) { phploss = 0; } }
new Float:php;
GetPlayerHealth(i,php);
SetPlayerHealth(i,(php - phploss));
}
TextDrawShowForPlayer(i,crash_screen);
SetTimerEx("HideCrash",250,0,"i",i);
}
}
}
}
}
if(!speedcamera_cooldown[i] && GetPlayerState(i) == PLAYER_STATE_DRIVER)
{
for(new a = 0; a < sizeof(speed_cameras); a ++)
{
if(IsPlayerInRangeOfPoint(i,30.0,speed_cameras[a][0],speed_cameras[a][1],speed_cameras[a][2]))
{
if(player_vehicle_speed[i] >= 61)
{
if(!InCopCar(i) && !InAmbulance(i) && !IsAircraft(GetPlayerVehicleID(i)) && GetVehicleModel(GetPlayerVehicleID(i)) != 407)
{
new Float:X, Float:Y, Float:Z;
GetPlayerPos(i,X,Y,Z);
new name[MAX_PLAYER_NAME];
GetCharacterNameEx(i,name);
new str[256];
format(str,sizeof(str),"** FLASH ** Radarul a facut o poza asupra vehiculului lui %s",name);
SendServerEmote(str,X, Y, Z, 30.0, 0);
speedcamera_cooldown[i] = 60;
printf("Inainte de banca si amenda!");
if(CharacterInfo[i][active_character[i]][cBank] >= 420) { CharacterInfo[i][active_character[i]][cBank] -= 420; FactionInfo[0][fBank] += 420; CharacterInfo[i][active_character[i]][cSpeedTicket] += 420; }
printf("Dupa banca si amenda!");
PlayerPlaySound(i,1132,0.0,0.0,0.0);
if(speed_camera_stats[a] == -1)
{
X = speed_cameras[a][0];
Y = speed_cameras[a][1];
GetPosInFrontOfCoord(X, Y, speed_cameras[a][2], 2.0);
speed_camera_flash[a] = CreateObject(18670,X, Y,(speed_cameras[a][2] + 4.5),0.0,0.0,0.0);
speed_camera_stats[a] = 3;
}
}
}
}
}
}
// Buildings
for(new h = 0; h < sizeof(InteriorInfo); h++)
{
new string[128];
if(IsPlayerInRangeOfPoint(i,1.5,InteriorInfo[h][iSpawnX], InteriorInfo[h][iSpawnY], InteriorInfo[h][iSpawnZ]))
{
format(string, sizeof(string), "%s", InteriorInfo[h][iNames]);
GameTextForPlayer(i, string, 2000, 3);
}
}
new weapons[13][2];
for(new a = 0; a < 13; a ++) { GetPlayerWeaponData(i,a,weapons[a][0],weapons[a][1]); }
if((weapons[5][0] == WEAPON_AK47 && weapons[5][1] > 0 && GetPlayerWeapon(i) != WEAPON_M4 && GetPlayerWeapon(i) != WEAPON_AK47) || (weapons[5][0] == WEAPON_M4 && weapons[5][1] > 0 && GetPlayerWeapon(i) != WEAPON_M4 && GetPlayerWeapon(i) != WEAPON_AK47))
{
if(!cl_SlotUsed(i,CLOTHING_HIDEWEAPON))
{
new object = (weapons[5][0] == WEAPON_M4) ? 356 : 355;
cl_SetClothing(i,CLOTHING_HIDEWEAPON,object,15,-0.2,0.15,0.0,0.0,45.0,0.0,1.0,1.0,1.0);
}
}
else if(cl_SlotUsed(i,CLOTHING_HIDEWEAPON) && (GetPlayerWeapon(i) == WEAPON_M4 || GetPlayerWeapon(i) == WEAPON_AK47 || (!HasWeapon(i,WEAPON_M4) && !HasWeapon(i,WEAPON_AK47))))
{
cl_RemoveClothing(i,CLOTHING_HIDEWEAPON);
}
if((weapons[3][0] == WEAPON_SHOTGUN && weapons[3][1] > 0 && GetPlayerWeapon(i) != WEAPON_SHOTGUN && GetPlayerWeapon(i) != 27) || (weapons[3][0] == 27 && weapons[3][1] > 0 && GetPlayerWeapon(i) != 27 && GetPlayerWeapon(i) != WEAPON_SHOTGUN))
{
if(!cl_SlotUsed(i,CLOTHING_HIDEWEAPONTWO))
{
new object = (weapons[3][0] == WEAPON_SHOTGUN) ? 349 : 351;
cl_SetClothing(i,CLOTHING_HIDEWEAPONTWO,object,15,-0.10,0.15,-0.35,0.0,-40.0,0.0,1.0,1.0,1.0);
}
}
else if(cl_SlotUsed(i,CLOTHING_HIDEWEAPONTWO) && (GetPlayerWeapon(i) == WEAPON_SHOTGUN || GetPlayerWeapon(i) == 27 || (!HasWeapon(i,WEAPON_SHOTGUN))))
{
cl_RemoveClothing(i,CLOTHING_HIDEWEAPONTWO);
}
}
}
for(new b = 0; b < MAX_VEHICLES; b ++) { new Float:hp; GetVehicleHealth(b,hp); crash_vhp[b] = hp; }
}
pawn Код:
stock PlayerUpdateListener(playerid)
{
/*new Float:armor;
GetPlayerArmour(playerid,armor);
if(armor > 0.0)
{
if(!armor_display_enabled[playerid] && armor_display_tog[playerid])
{
armor_display_enabled[playerid] = 1;
}
}
else if(armor <= 0.0)
{
if(armor_display_enabled[playerid])
{
armor_display_enabled[playerid] = 0;
}
}*/
if(driving_test[playerid] && driving_test_reversing[playerid])
{
new key, leftright, updown;
GetPlayerKeys(playerid,key,updown,leftright);
if(key == KEY_UP)
{
driving_test_failed[playerid] = 1;
}
}
if(spraying_vehicle[playerid])
{
new key, leftright, updown;
GetPlayerKeys(playerid,key,updown,leftright);
if(leftright == KEY_RIGHT)
{
new newcol = (spraying_vehicle_color[playerid] + 1);
if(newcol > 0 && newcol < 255)
{
spraying_vehicle_color[playerid] ++;
RefreshSprayPos(playerid);
PlayerPlaySound(playerid,1083,0.0,0.0,0.0);
}
else
{
PlayerPlaySound(playerid,1085,0.0,0.0,0.0);
}
}
else if(leftright == KEY_LEFT)
{
new newcol = (spraying_vehicle_color[playerid] - 1);
if(newcol > 0 && newcol < 255)
{
spraying_vehicle_color[playerid] --;
RefreshSprayPos(playerid);
PlayerPlaySound(playerid,1083,0.0,0.0,0.0);
}
else
{
PlayerPlaySound(playerid,1085,0.0,0.0,0.0);
}
}
else if(key == KEY_SPRINT)
{
new slot = GetVehicleSlot(GetPlayerVehicleID(playerid));
if(slot > -1)
{
if(spraying_vehicle[playerid] == 1)
{
VehicleInfo[slot][vColor1] = spraying_vehicle_color[playerid];
SendClientMessage(playerid,COLOR_GREEN,"Prima culoare setata , alege-o pe ceea secundara.");
spraying_vehicle[playerid] = 2;
}
else
{
VehicleInfo[slot][vColor2] = spraying_vehicle_color[playerid];
spraying_vehicle[playerid] = 0;
spraying_vehicle_color[playerid] = 0;
SendClientMessage(playerid,COLOR_GREEN,"Vehiculul tau a fost revopsit.");
leave_spray[playerid] = 1;
}
}
}
}
if(vehicle_showroom_position[playerid] > -1)
{
if(donator_vehicle_purchasing[playerid] == -1)
{
new key, leftright, updown;
GetPlayerKeys(playerid,key,updown,leftright);
if(leftright == KEY_RIGHT)
{
new tmp = FetchNextVehiclePosition(playerid,vehicle_showroom_type[playerid]);
if(tmp != -1) { vehicle_showroom_position[playerid] = tmp; } else { PlayerPlaySound(playerid,1085,0.0,0.0,0.0); }
RefreshPlayerShowroomPosition(playerid);
PlayerPlaySound(playerid,1083,0.0,0.0,0.0);
}
else if(leftright == KEY_LEFT)
{
new tmp = FetchPrevVehiclePosition(playerid,vehicle_showroom_type[playerid]);
if(tmp != -1) { vehicle_showroom_position[playerid] = tmp; } else { PlayerPlaySound(playerid,1085,0.0,0.0,0.0); }
RefreshPlayerShowroomPosition(playerid);
PlayerPlaySound(playerid,1083,0.0,0.0,0.0);
}
else if(key == KEY_SPRINT && !(key & KEY_WALK))
{
if(vehicle_select_cooldown[playerid] == 0)
{
new vehicle = vehicle_showroom_position[playerid];
new price = VehicleModelInfo[vehicle][vmPrice];
if(CharacterInfo[playerid][active_character[playerid]][cMoney] >= price || IsDonatorVehicle(VehicleModelInfo[vehicle][vmModel]))
{
if(NumberOfVehicles(playerid) < 3)
{
if(CharacterInfo[playerid][active_character[playerid]][cFaction] == 0 || CharacterInfo[playerid][active_character[playerid]][cFactionPermissions] != FAC_PERM_LEAD)
{
if(CanBuyVehicle(playerid) && !VehicleModelInfo[vehicle][vmEmerVeh] && !VehicleModelInfo[vehicle][vmNews])
{
RefreshVehicleColorScreen(playerid);
}
else
{
SendClientMessageA(playerid,COLOR_LIGHTRED,"Nu poti cumpara acest vehicul.");
}
}
else if(CharacterInfo[playerid][active_character[playerid]][cFactionPermissions] == FAC_PERM_LEAD)
{
if(CanBuyVehicle(playerid))
{
ShowPlayerDialog(playerid,DIALOG_BUYFAC,DIALOG_STYLE_MSGBOX,"Ai dori sa o cumperi pentru factiune?","Poti cumpara acest vehicul pentru factiune , doresti asta?","Da","Nu");
}
else
{
SendClientMessageA(playerid,COLOR_LIGHTRED,"Nu poti cumpara acest vehicul.");
}
}
else
{
if(CanBuyVehicle(playerid))
{
RefreshVehicleColorScreen(playerid);
}
else
{
SendClientMessageA(playerid,COLOR_LIGHTRED,"Nu poti cumpara acest vehicul.");
}
}
}
else
{
SendClientMessageA(playerid,COLOR_LIGHTRED,"Ai ajuns la nivelul maxim de vehicule(3 max)");
}
}
else
{
SendClientMessageA(playerid,COLOR_LIGHTRED,"Nu ai destui bani pentru a cumpara acest vehicul");
PlayerPlaySound(playerid,1085,0.0,0.0,0.0);
}
}
}
}
}
if(choosing_character[playerid])
{
new key, leftright, updown;
GetPlayerKeys(playerid,key,updown,leftright);
if(leftright == KEY_RIGHT)
{
new tmp = (character_offset[playerid] + 1);
if(tmp < NumberOfCharacters(playerid))
{
character_offset[playerid] ++;
RefreshCharSelection(playerid,character_offset[playerid]);
PlayerPlaySound(playerid,1083,0.0,0.0,0.0);
}
else
{
PlayerPlaySound(playerid,1085,0.0,0.0,0.0);
}
}
else if(leftright == KEY_LEFT)
{
new tmp = (character_offset[playerid] - 1);
if(tmp >= 0)
{
character_offset[playerid] --;
RefreshCharSelection(playerid,character_offset[playerid]);
PlayerPlaySound(playerid,1083,0.0,0.0,0.0);
}
else
{
PlayerPlaySound(playerid,1085,0.0,0.0,0.0);
}
}
else if(key == KEY_SPRINT)
{
active_character[playerid] = character_offset[playerid];
choosing_character[playerid] = false;
SetPlayerName(playerid,CharacterInfo[playerid][active_character[playerid]][cName]);
//herecharacter_chosen[playerid] = true;
ProcessSpawn(playerid);
LoadNotes(playerid);
LoadInventory(playerid);
LoadRingtone(playerid);
format(accent[playerid],16,"%s",CharacterInfo[playerid][active_character[playerid]][cAccent]);
SetPlayerHealth(playerid,CharacterInfo[playerid][active_character[playerid]][cHealth]);
SetPlayerArmour(playerid,CharacterInfo[playerid][active_character[playerid]][cArmor]);
character_offset[playerid] = 0;
}
}
/**************SPIKES*************/
if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
{
for(new i = 0; i < sizeof(SpikeInfo); i++)
{
if(IsPlayerInRangeOfPoint(playerid, 3.0, SpikeInfo[i][sX], SpikeInfo[i][sY], SpikeInfo[i][sZ]))
{
if(SpikeInfo[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);
}
}
}
}
/***********END SPIKES************/
}
pawn Код:
public IsPlayerConnectedEx(playerid)
{
if(IsPlayerConnected(playerid) && character_chosen[playerid]) { return true; }
return false;
}