Hi Leute.
Da an manchen Plätzen die Objekte erst sichtbar werden, wenn
man aus dem Auto steigt, wollte ich folgende Funktion schreiben:
stock CreateStuntTeleport(playerid,Float:X,Float:Y,Float:Z,Float:Angle,bool:WithCar,int,vir,price)
{
new Float:pX,Float:pY,Float:pZ;
if(IsPlayerInAnyMinigame(playerid) == 1)
{
iSendClientMessage(playerid,COLOR_ERROR," You're still in a minigame. First type /exit."," Du bist schon in einem Minigame, mach erst /beenden.");
return 0;
}
if(GetPlayerMoney(playerid) < price)
{
iSendClientMessage(playerid,COLOR_ERROR,"You haven't enough money!","Du hast zu wenig Geld!");
return 0;
}
else if(!IsValidTeleVeh(GetPlayerVehicleID(playerid)) && WithCar)
{
iSendClientMessage(playerid,COLOR_ERROR,"This isn't a teleport valid vehicle!","Dieses Fahrzeug ist nicht zum Teleport geeignet!");
return 0;
}
else if(WithCar)
{
if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
{
SetVehiclePos(GetPlayerVehicleID(playerid),Float:X,Float:Y,Float:Z);
SetVehicleZAngle(GetPlayerVehicleID(playerid),Float:Angle);
LinkVehicleToInterior(GetPlayerVehicleID(playerid),int);
SetVehicleVirtualWorld(GetPlayerVehicleID(playerid),vir);
}
else
{
SetPlayerPos(playerid,Float:X,Float:Y,Float:Z);
SetPlayerFacingAngle(playerid,Float:Angle);
InCar[playerid] = 0;
}
}
else if(!WithCar)
{
SetPlayerPos(playerid,Float:X,Float:Y,Float:Z);
SetPlayerFacingAngle(playerid,Float:Angle);
InCar[playerid] = 0;
}
SetCameraBehindPlayer(playerid);
GivePlayerMoney(playerid,-price);
SetPlayerInterior(playerid,int);
SetPlayerVirtualWorld(playerid,vir);
PlayerPlaySound(playerid,1058,0,0,0);
if(IsPlayerInAnyVehicle(playerid)) {
FreezePlayer(playerid);
MyState[playerid] = GetPlayerState(playerid);
GetPlayerPos(playerid,pX,pY,pZ);
SetPlayerPos(playerid,pX,pY,pZ+1.25);
PutInCarTimer[playerid] = SetTimerEx("PutInCar",1*1000,0,"d",playerid);
} return 1;
}
public PutInCar(playerid)
{
PutPlayerInVehicle(playerid,WhatCar[playerid],MyState[playerid]);
UnFreezePlayer(playerid);
KillTimer(PutInCarTimer[playerid]);
return 1;
}
Folgendes passiert:
1. Ich selbst werde nicht teleportiert, sondern
nur hoch gesetzt und gefreezed. Dann nach 1 Sek
spring die Kamera zu meinem Auto. Ich sehe mich
nicht im Auto sitzen und drücke ich enter kommt:
[20:13:41] Warning(game): Exception 0xC0000005 at 0x523E6B
[20:13:41] Warning(game): Exception 0xC0000005 at 0x523E6B
[20:13:41] Warning(game): Exception 0xC0000005 at 0x523E6B
[20:13:41] Warning(game): Exception 0xC0000005 at 0x523E6B
[20:13:41] Warning(game): Exception 0xC0000005 at 0x523E6B
[20:13:41] Warning(game): Exception 0xC0000005 at 0x523E6B
[20:13:41] Warning(game): Exception 0xC0000005 at 0x523E6B
[20:13:41] Warning(game): Exception 0xC0000005 at 0x523E6B
[20:13:41] Warning(game): Exception 0xC0000005 at 0x523E6B
[20:13:41] Warning(game): Exception 0xC0000005 at 0x523E6B
[20:13:41] Warning(game): Exception 0xC0000005 at 0x523E6B
Alles anzeigen
Hoffe ihr könnt mir helfen.