Hi Leute ich habe ein Fehler beim DTDC carsystem der Server Crasht wenn man sich ein auto kaufen will.
Hier mal die Fehlercodes:
[20:19:33]: File 'C:\Users\WayNeTraiiN\Desktop\NY-RP Server\gamemodes\NewYorkRoleplay.pwn', line 3642
[20:19:33]: Dtdc_HandleLiveView(playerid=0)
[20:19:33]: File 'C:\Users\WayNeTraiiN\Desktop\NY-RP Server\gamemodes\NewYorkRoleplay.pwn'
[20:19:33]: OnPlayerUpdate(playerid=0) <-- entry point
[20:19:34]: Script[gamemodes\NewYorkRoleplay.amx]: In file 'C:\Users\WayNeTraiiN\Desktop\NY-RP Server\gamemodes\NewYorkRoleplay.pwn' at line 22873:
[20:19:34]: Script[gamemodes\NewYorkRoleplay.amx]: Run time error 3: "Stack/heap collision (insufficient stack size)"
Zeile 22873:
forward Dtdc_HandleLiveView(playerid);
public Dtdc_HandleLiveView(playerid)
{
if( (GetTickCount() - Dtdc_Player[playerid][LastTick]) < 500 ) return;
new string[200]; //Zeile 22873 Ich habe nix dran geändert...
new Keys,ud,lr;
GetPlayerKeys(playerid,Keys,ud,lr);
//KEYS
if(Keys & KEY_FIRE) {
new Float:px,Float:py,Float:pa;
px = Dtdc_Seller[Dtdc_Player[playerid][IsInSeller]][sIconPosX];
py = Dtdc_Seller[Dtdc_Player[playerid][IsInSeller]][sIconPosY];
pa = Dtdc_Seller[Dtdc_Player[playerid][IsInSeller]][sIconRot];
GetXYInFrontOf(pa,px,py,2.5);
SetPlayerPos(playerid,px,py,Dtdc_Seller[Dtdc_Player[playerid][IsInSeller]][sIconPosZ]);
SetPlayerFacingAngle(playerid,Dtdc_Seller[Dtdc_Player[playerid][IsInSeller]][sIconRot]);
SetPlayerInterior(playerid,0);
SetCameraBehindPlayer(playerid);
TogglePlayerControllable(playerid,1);
SetPlayerVirtualWorld(playerid, 0);
Dtdc_Player[playerid][IsInSeller] = (MaxSeller+1);
CallRemoteFunction("PlayerDTDCSellerStateChange","dd",playerid,0);
TextDrawHideForPlayer(playerid,Dtdc_Player[playerid][CarKauf][0]);
TextDrawHideForPlayer(playerid,Dtdc_Player[playerid][CarKauf][1]);
for(new i=0;i<4;i++){TextDrawHideForPlayer(playerid,Dtdc_BuyTexte[i]);}
//CAR SHOW
if(Dtdc_Player[playerid][CarShow] !=0){DestroyVehicle(Dtdc_Player[playerid][CarShow]);Dtdc_Player[playerid][CarShow] = 0;}
Dtdc_Player[playerid][LastTick] = GetTickCount();
return;
}
if(Keys & 16) {
if(Dtdc_OnCarBuy(playerid,Dtdc_Player[playerid][IsInSeller],Dtdc_Player[playerid][CarSelect]))
{
new Float:px,Float:py,Float:pa;
px = Dtdc_Seller[Dtdc_Player[playerid][IsInSeller]][sIconPosX];
py = Dtdc_Seller[Dtdc_Player[playerid][IsInSeller]][sIconPosY];
pa = Dtdc_Seller[Dtdc_Player[playerid][IsInSeller]][sIconRot];
GetXYInFrontOf(pa,px,py,2.5);
SetPlayerPos(playerid,px,py,Dtdc_Seller[Dtdc_Player[playerid][IsInSeller]][sIconPosZ]);
SetPlayerFacingAngle(playerid,Dtdc_Seller[Dtdc_Player[playerid][IsInSeller]][sIconRot]);
SetPlayerInterior(playerid,0);
SetCameraBehindPlayer(playerid);
TogglePlayerControllable(playerid,1);
SetPlayerVirtualWorld(playerid, 0);
Dtdc_Player[playerid][IsInSeller] = (MaxSeller+1);
CallRemoteFunction("PlayerDTDCSellerStateChange","dd",playerid,0);
TextDrawHideForPlayer(playerid,Dtdc_Player[playerid][CarKauf][0]);
TextDrawHideForPlayer(playerid,Dtdc_Player[playerid][CarKauf][1]);
for(new i=0;i<4;i++){TextDrawHideForPlayer(playerid,Dtdc_BuyTexte[i]);}
//CAR SHOW
if(Dtdc_Player[playerid][CarShow] !=0){DestroyVehicle(Dtdc_Player[playerid][CarShow]);Dtdc_Player[playerid][CarShow] = 0;}
}
Dtdc_Player[playerid][LastTick] = GetTickCount();
return;
}
if(lr > 0) { // right
Dtdc_Player[playerid][CarSelect] = 0;
Dtdc_Player[playerid][IsAtCar] ++;
if(Dtdc_Player[playerid][IsAtCar] >= Dtdc_Seller[Dtdc_Player[playerid][IsInSeller]][sCars]){Dtdc_Player[playerid][IsAtCar] = 0;}
new plus = 0;
for(new i = 0; i < Dtdc_SCarsNum; i++)
{
if(Dtdc_SCars[i][scSeller] == Dtdc_Player[playerid][IsInSeller])
{
if(plus == Dtdc_Player[playerid][IsAtCar]) {Dtdc_Player[playerid][CarSelect] = i; break;}
plus++;
}
}
//SHOW CAR
if(Dtdc_Player[playerid][CarShow] !=0){DestroyVehicle(Dtdc_Player[playerid][CarShow]);Dtdc_Player[playerid][CarShow] = 0;}
Dtdc_Player[playerid][CarShow] = CreateVehicle(Dtdc_SCars[Dtdc_Player[playerid][CarSelect]][scModel],Dtdc_Seller[Dtdc_Player[playerid][IsInSeller]][sLVCarPosX],Dtdc_Seller[Dtdc_Player[playerid][IsInSeller]][sLVCarPosY],Dtdc_Seller[Dtdc_Player[playerid][IsInSeller]][sLVCarPosZ],Dtdc_Seller[Dtdc_Player[playerid][IsInSeller]][sLVCarRot],Dtdc_Player[playerid][CarColorSelect1],Dtdc_Player[playerid][CarColorSelect2],-1);
SetVehicleVirtualWorld(Dtdc_Player[playerid][CarShow],GetPlayerVirtualWorld(playerid));
//Textdraw
format(string,sizeof(string),"Name: %s~n~Kategorie: %s~n~Preis: ~g~%d$",Dtdc_CarName[Dtdc_SCars[Dtdc_Player[playerid][CarSelect]][scModel]-400],Dtdc_NameCat[Dtdc_SCars[Dtdc_Player[playerid][CarSelect]][scCat]],Dtdc_SCars[Dtdc_Player[playerid][CarSelect]][scPreis]);
if(!Dtdc_Player[playerid][CarKauf][0])
{
Dtdc_Player[playerid][CarKauf][0] = TextDrawCreate(20.000000,328.000000,Dtdc_Seller[Dtdc_Player[playerid][IsInSeller]][sName]);
Dtdc_Player[playerid][CarKauf][1] = TextDrawCreate(11.000000,355.000000,string);
TextDrawAlignment(Dtdc_Player[playerid][CarKauf][0],0);
TextDrawAlignment(Dtdc_Player[playerid][CarKauf][1],0);
TextDrawBackgroundColor(Dtdc_Player[playerid][CarKauf][0],0x000000ff);
TextDrawBackgroundColor(Dtdc_Player[playerid][CarKauf][1],0x000000ff);
TextDrawFont(Dtdc_Player[playerid][CarKauf][0],0);
TextDrawLetterSize(Dtdc_Player[playerid][CarKauf][0],1.000000,2.299999);
TextDrawFont(Dtdc_Player[playerid][CarKauf][1],1);
TextDrawLetterSize(Dtdc_Player[playerid][CarKauf][1],0.499999,1.800000);
TextDrawColor(Dtdc_Player[playerid][CarKauf][0],0xffffffff);
TextDrawColor(Dtdc_Player[playerid][CarKauf][1],0xffffffff);
TextDrawSetOutline(Dtdc_Player[playerid][CarKauf][0],1);
TextDrawSetOutline(Dtdc_Player[playerid][CarKauf][1],1);
TextDrawSetProportional(Dtdc_Player[playerid][CarKauf][0],1);
TextDrawSetProportional(Dtdc_Player[playerid][CarKauf][1],1);
TextDrawSetShadow(Dtdc_Player[playerid][CarKauf][0],1);
TextDrawSetShadow(Dtdc_Player[playerid][CarKauf][1],1);
TextDrawShowForPlayer(playerid,Dtdc_Player[playerid][CarKauf][0]);
TextDrawShowForPlayer(playerid,Dtdc_Player[playerid][CarKauf][1]);
}
else
{
TextDrawHideForPlayer(playerid,Dtdc_Player[playerid][CarKauf][0]);
TextDrawSetString(Dtdc_Player[playerid][CarKauf][0],Dtdc_Seller[Dtdc_Player[playerid][IsInSeller]][sName]);
TextDrawShowForPlayer(playerid,Dtdc_Player[playerid][CarKauf][0]);
TextDrawHideForPlayer(playerid,Dtdc_Player[playerid][CarKauf][1]);
TextDrawSetString(Dtdc_Player[playerid][CarKauf][1],string);
TextDrawShowForPlayer(playerid,Dtdc_Player[playerid][CarKauf][1]);
}
Dtdc_Player[playerid][LastTick] = GetTickCount();
return;
}
else if(lr < 0) {
Dtdc_Player[playerid][CarSelect] = 0;
Dtdc_Player[playerid][IsAtCar] --;
if(Dtdc_Player[playerid][IsAtCar] <0){Dtdc_Player[playerid][IsAtCar] = Dtdc_Seller[Dtdc_Player[playerid][IsInSeller]][sCars]-1;}
new plus = 0;
for(new i = 0; i < Dtdc_SCarsNum; i++)
{
if(Dtdc_SCars[i][scSeller] == Dtdc_Player[playerid][IsInSeller])
{
if(plus == Dtdc_Player[playerid][IsAtCar]) {Dtdc_Player[playerid][CarSelect] = i; break;}
plus++;
}
}
//SHOW CAR
if(Dtdc_Player[playerid][CarShow] !=0){DestroyVehicle(Dtdc_Player[playerid][CarShow]);Dtdc_Player[playerid][CarShow] = 0;}
Dtdc_Player[playerid][CarShow] = CreateVehicle(Dtdc_SCars[Dtdc_Player[playerid][CarSelect]][scModel],Dtdc_Seller[Dtdc_Player[playerid][IsInSeller]][sLVCarPosX],Dtdc_Seller[Dtdc_Player[playerid][IsInSeller]][sLVCarPosY],Dtdc_Seller[Dtdc_Player[playerid][IsInSeller]][sLVCarPosZ],Dtdc_Seller[Dtdc_Player[playerid][IsInSeller]][sLVCarRot],Dtdc_Player[playerid][CarColorSelect1],Dtdc_Player[playerid][CarColorSelect2],-1);
SetVehicleVirtualWorld(Dtdc_Player[playerid][CarShow],GetPlayerVirtualWorld(playerid));
//Textdraw
format(string,sizeof(string),"Name: %s~n~Kategorie: %s~n~Preis: ~g~%d$",Dtdc_CarName[Dtdc_SCars[Dtdc_Player[playerid][CarSelect]][scModel]-400],Dtdc_NameCat[Dtdc_SCars[Dtdc_Player[playerid][CarSelect]][scCat]],Dtdc_SCars[Dtdc_Player[playerid][CarSelect]][scPreis]);
if(!Dtdc_Player[playerid][CarKauf][0])
{
Dtdc_Player[playerid][CarKauf][0] = TextDrawCreate(20.000000,328.000000,Dtdc_Seller[Dtdc_Player[playerid][IsInSeller]][sName]);
Dtdc_Player[playerid][CarKauf][1] = TextDrawCreate(11.000000,355.000000,string);
TextDrawAlignment(Dtdc_Player[playerid][CarKauf][0],0);
TextDrawAlignment(Dtdc_Player[playerid][CarKauf][1],0);
TextDrawBackgroundColor(Dtdc_Player[playerid][CarKauf][0],0x000000ff);
TextDrawBackgroundColor(Dtdc_Player[playerid][CarKauf][1],0x000000ff);
TextDrawFont(Dtdc_Player[playerid][CarKauf][0],0);
TextDrawLetterSize(Dtdc_Player[playerid][CarKauf][0],1.000000,2.299999);
TextDrawFont(Dtdc_Player[playerid][CarKauf][1],1);
TextDrawLetterSize(Dtdc_Player[playerid][CarKauf][1],0.499999,1.800000);
TextDrawColor(Dtdc_Player[playerid][CarKauf][0],0xffffffff);
TextDrawColor(Dtdc_Player[playerid][CarKauf][1],0xffffffff);
TextDrawSetOutline(Dtdc_Player[playerid][CarKauf][0],1);
TextDrawSetOutline(Dtdc_Player[playerid][CarKauf][1],1);
TextDrawSetProportional(Dtdc_Player[playerid][CarKauf][0],1);
TextDrawSetProportional(Dtdc_Player[playerid][CarKauf][1],1);
TextDrawSetShadow(Dtdc_Player[playerid][CarKauf][0],1);
TextDrawSetShadow(Dtdc_Player[playerid][CarKauf][1],1);
TextDrawShowForPlayer(playerid,Dtdc_Player[playerid][CarKauf][0]);
TextDrawShowForPlayer(playerid,Dtdc_Player[playerid][CarKauf][1]);
}
else
{
TextDrawHideForPlayer(playerid,Dtdc_Player[playerid][CarKauf][0]);
TextDrawSetString(Dtdc_Player[playerid][CarKauf][0],Dtdc_Seller[Dtdc_Player[playerid][IsInSeller]][sName]);
TextDrawShowForPlayer(playerid,Dtdc_Player[playerid][CarKauf][0]);
TextDrawHideForPlayer(playerid,Dtdc_Player[playerid][CarKauf][1]);
TextDrawSetString(Dtdc_Player[playerid][CarKauf][1],string);
TextDrawShowForPlayer(playerid,Dtdc_Player[playerid][CarKauf][1]);
}
Dtdc_Player[playerid][LastTick] = GetTickCount();
return;
}
if(ud < 0) {//up
if(Keys & KEY_CROUCH){Dtdc_Player[playerid][CarColorSelect2] ++;} else {Dtdc_Player[playerid][CarColorSelect1] ++;}
if(Dtdc_Player[playerid][CarColorSelect1] > 127){Dtdc_Player[playerid][CarColorSelect1] = 0;}
if(Dtdc_Player[playerid][CarColorSelect2] > 127){Dtdc_Player[playerid][CarColorSelect2] = 0;}
ChangeVehicleColor(Dtdc_Player[playerid][CarShow],Dtdc_Player[playerid][CarColorSelect1],Dtdc_Player[playerid][CarColorSelect2]);
Dtdc_Player[playerid][LastTick] = GetTickCount();
} else if(ud > 0) { //down
if(Keys & KEY_CROUCH){Dtdc_Player[playerid][CarColorSelect2] --;} else {Dtdc_Player[playerid][CarColorSelect1] --;}
if(Dtdc_Player[playerid][CarColorSelect1] < 0){Dtdc_Player[playerid][CarColorSelect1] = 127;}
if(Dtdc_Player[playerid][CarColorSelect2] < 0){Dtdc_Player[playerid][CarColorSelect2] = 127;}
ChangeVehicleColor(Dtdc_Player[playerid][CarShow],Dtdc_Player[playerid][CarColorSelect1],Dtdc_Player[playerid][CarColorSelect2]);
Dtdc_Player[playerid][LastTick] = GetTickCount();
}
}
Und die Zeile 3642:
if(Dtdc_Select == 0 && Dtdc_Player[playerid][IsInSeller] != MaxSeller +1 && (GetTickCount() - Dtdc_Player[playerid][LastTick]) >= 500 )
{
Dtdc_HandleLiveView(playerid); // Naja Grandlarc lässt grüßen xD Naja ahbe andere wege um a und d benutzen zu können versucht doch nur der ging zu 100%
}
if(Dtdc_Player[playerid][IsInRespray] != MaxResprayer +1 && (GetTickCount() - Dtdc_Player[playerid][LastTick]) >= 250 )
{
Dtdc_HandleResprayer(playerid); // Naja Grandlarc lässt grüßen xD Naja ahbe andere wege um a und d benutzen zu können versucht doch nur der ging zu 100%
}
if(GetPVarInt(playerid,"YEAH") == 1)
{//Das ist die Zeile 3642 habe ich auch nix dran geändert...
new Float:VPos[3], Float:Rotation;
GetVehiclePos(GetPlayerVehicleID(playerid),VPos[0],VPos[1],VPos[2]);
Rotation = PointAngle(playerid, VPos[0],VPos[1], GetPVarFloat(playerid,"Spongebob"), GetPVarFloat(playerid,"Mario"));
AttachObjectToVehicle(GPSObject[playerid], GetPlayerVehicleID(playerid), 0.0, 0.0, 1.5, 0.0, 90.0, Rotation);
}
Hoffe mir kann einer Helfen
//Edit fehler zeile Editiert habe mich verschrieben