Hallo
Ich habe ein Problem, wenn ich in ein Pickup laufe (Nur dieses, der Rest geht), crasht das Game (auch bei anderen Usern). Ich kann mich aber per /enter oder /exit ins SFPD rein- und wieder herausteleportieren (Per Teleport). Nur wenn ich drauf stehen bleibe, crasht das Game.
Hier der Code, das SFPD Enter Pickup wurde wegen den langen Laufzeiten zum LSPD verschobe, im Park.
Code
#define MAX_PICKS 9
new Float:gPickKoords[MAX_PICKS][3] = {
{1554.4130, -1675.6237, 16.1953}, //LSPD Enter
{246.7760, 63.7749, 1003.6406}, //LSPD Exit
{246.4243,87.5934,1003.6406}, //LSPD Garage Enter
{1568.7732,-1690.3076,5.8906}, //LSPD Garage Exit
{243.2254,66.3764,1003.6406}, //LSPD Dach Enter
{1556.8009,-1675.5671,28.3955}, //LSPD Dach Exit
{1568.6473, -1694.1110, 5.8906}, //LSPD Arrest
{1512.9003,-1694.4792,14.0469}, //SFPD Enter
{246.375991,109.245994,1003.218750}//SFPD Exit
};
Alles anzeigen
Code
new gPickup[MAX_PICKS][3] = {
{1247, -1, 1}, //LSPD Enter
{1247, -1, 1}, //LSPD Exit
{1247, -1, 1}, //LSPD Garage Enter
{1247, -1, 1}, //LSPD Garage Exit
{1247, -1, 1}, //LSPD Dach Enter
{1247, -1, 1}, //LSPD Dach Exit
{1239, -1, 1}, //LSPD Arrest
{1247, -1, 1}, //SFPD Enter
{1247, -1, 1} //SFPD Exit
};
Alles anzeigen
Code
public IsPlayerAtEnterExit(playerid)
{
for(new i = 0; i<MAX_PLAYERS; i++)
{
if(IsPlayerInRangeOfPoint(i, 1.0, gPickKoords[0][0], gPickKoords[0][1], gPickKoords[0][2]))
{
GameTextForPlayer(i, "~r~Los Santos Police Department~n~~w~Betreten: ~g~/enter", 4000, 5);
return 1;
}
if(IsPlayerInRangeOfPoint(i, 1.0, gPickKoords[1][0], gPickKoords[1][1], gPickKoords[1][2]))
{
GameTextForPlayer(i, "Verlassen: ~r~/exit", 4000, 5);
return 1;
}
if(IsPlayerInRangeOfPoint(i, 1.0, gPickKoords[2][0], gPickKoords[2][1], gPickKoords[2][2]))
{
GameTextForPlayer(i, "~r~Garage~n~~w~Betreten: ~g~/enter", 4000, 5);
return 1;
}
if(IsPlayerInRangeOfPoint(i, 1.0, gPickKoords[3][0], gPickKoords[3][1], gPickKoords[3][2]))
{
GameTextForPlayer(playerid, "Verlassen: ~r~/exit", 4000, 5);
return 1;
}
if(IsPlayerInRangeOfPoint(i, 1.0, gPickKoords[4][0], gPickKoords[4][1], gPickKoords[4][2]))
{
GameTextForPlayer(i, "~r~Dach~n~~w~Betreten: ~g~/enter", 4000, 5);
return 1;
}
if(IsPlayerInRangeOfPoint(i, 1.0, gPickKoords[5][0], gPickKoords[5][1], gPickKoords[5][2]))
{
GameTextForPlayer(i, "Verlassen: ~r~/exit", 4000, 5);
return 1;
}
if(IsPlayerInRangeOfPoint(i, 1.0, gPickKoords[6][0], gPickKoords[6][1], gPickKoords[6][2]))
{
if(PlayerInfo[i][pTeam] == 2)
{
GameTextForPlayer(i, "~g~/einsperren~w~ (ID) (Geld) (Zeit)", 4000, 5);
return 1;
}
}
if(IsPlayerInRangeOfPoint(i, 1.0, gPickKoords[7][0], gPickKoords[7][1], gPickKoords[7][2]))
{
GameTextForPlayer(i, "r~San Fierro Police Department~n~~w~Betreten: ~g~/enter", 4000, 5);
return 1;
}
if(IsPlayerInRangeOfPoint(i, 1.0, gPickKoords[8][0], gPickKoords[8][1], gPickKoords[8][2]))
{
GameTextForPlayer(i, "Verlassen: ~r~/exit", 4000, 5);
return 1;
}
}
return 0;
}
Alles anzeigen
Code
dcmd_enter(playerid, params[])
{
#pragma unused params
if(IsPlayerConnected(playerid))
{
if(IsPlayerInRangeOfPoint(playerid, 2.0, gPickKoords[0][0], gPickKoords[0][1], gPickKoords[0][2]))
{
SetPlayerPos(playerid, 246.783996, 63.900199, 1003.640625);
SetPlayerInterior(playerid, 6);
return 1;
}
else if(IsPlayerInRangeOfPoint(playerid, 2.0, gPickKoords[2][0], gPickKoords[2][1], gPickKoords[2][2]))
{
SetPlayerPos(playerid, 1568.7732,-1690.3076,5.8906);
SetPlayerInterior(playerid, 0);
return 1;
}
else if(IsPlayerInRangeOfPoint(playerid, 2.0, gPickKoords[4][0], gPickKoords[4][1], gPickKoords[4][2]))
{
SetPlayerPos(playerid, 1556.8009,-1675.5671,28.3955);
SetPlayerInterior(playerid, 0);
return 1;
}
else if(IsPlayerInRangeOfPoint(playerid, 2.0, gPickKoords[7][0], gPickKoords[7][1], gPickKoords[7][2]))
{
SetPlayerPos(playerid, 246.375991, 109.245994, 1003.218750);
SetPlayerInterior(playerid, 10);
return 1;
}
}
return 1;
}
dcmd_exit(playerid, params[])
{
#pragma unused params
if(IsPlayerConnected(playerid))
{
if(IsPlayerInRangeOfPoint(playerid, 2.0, 246.783996, 63.900199, 1003.640625))
{
SetPlayerPos(playerid, gPickKoords[0][0], gPickKoords[0][1], gPickKoords[0][2]);
SetPlayerInterior(playerid, 0);
return 1;
}
else if(IsPlayerInRangeOfPoint(playerid, 2.0, 1568.7732,-1690.3076,5.8906))
{
SetPlayerPos(playerid, gPickKoords[2][0], gPickKoords[2][1], gPickKoords[2][2]);
SetPlayerInterior(playerid, 6);
return 1;
}
else if(IsPlayerInRangeOfPoint(playerid, 2.0, 1556.8009,-1675.5671,28.3955))
{
SetPlayerPos(playerid, gPickKoords[4][0], gPickKoords[4][1], gPickKoords[4][2]);
SetPlayerInterior(playerid, 6);
return 1;
}
else if(IsPlayerInRangeOfPoint(playerid, 2.0, 246.375991, 109.245994, 1003.218750))
{
SetPlayerPos(playerid, gPickKoords[7][0], gPickKoords[7][1], gPickKoords[7][2]);
SetPlayerInterior(playerid, 0);
return 1;
}
}
return 1;
}
Alles anzeigen
Entschuldigung für die Klammersetzung, die nicht richtig übernommen wurde, ich machs schnell. Wer kann mir helfen, da ich nicht weiss, woran es leigt, da alle ausser den einen gehen.
MfG dUDALUS