So sieht es bei OnPlayerConnect aus:
if(GetPVarInt(playerid,"HatAuto")==1)
{ PlayerCar[playerid]=CreateVehicle(GetPVarInt(playerid,"AutoModel"),GetPVarInt(playerid,"AutoXPos"),GetPVarInt(playerid,"AutoYPos"),GetPVarInt(playerid,"AutoZPos"),GetPVarInt(playerid,"AutoAngle"),GetPVarInt(playerid,"AutoColor1"),GetPVarInt(playerid,"AutoColor2"),-1);
}
Bei OnPlayerDisconnect dann das:
DestroyVehicle(PlayerCar[playerid]);
Und der Befehl:
if(strcmp(cmdtext,"/buycar",true) == 0)
{
if(isInBilligAuto(playerid))
{
new Float:x,Float:y,Float:z,Float:angle;
new vid = GetPlayerVehicleID(playerid);
new model=GetVehicleModel(vid);
GetPlayerPos(playerid,x,y,z);
GetPlayerFacingAngle(playerid,angle);
PlayerCar[playerid]=CreateVehicle(model,2127.1682,-1137.9630,25.3805,356.9368,0,0,-1);
SendClientMessage(playerid,GELB,"Du hast dir einen Wagen gekauft.");
SetPVarInt(playerid,"HatAuto",1);
SetPVarInt(playerid,"AutoModel",model);
SetPVarInt(playerid,"AutoXPos",2127);
SetPVarInt(playerid,"AutoYPos",1138);
SetPVarInt(playerid,"AutoZPos",25);
SetPVarInt(playerid,"AutoAngle",357);
SetPVarInt(playerid,"AutoColor1",0);
SetPVarInt(playerid,"AutoColor2",0);
}
else SendClientMessage(playerid,ROT,"Du bist in keinem Autohaus Auto.");
}
Mein Problem:
Er löscht die Autos nicht...
Aber Createt sie auch nicht neu
Pls helft mir