Aloha zusammen, ich hab mal ein Haus gemappt mit einer schranke... hab es ohne befehle versucht und alles so gemacht wie es im tutorial stand^^
aber wenn ich davor stehe öffnet sie sich nicht
hier das Filterscript
#include <a_samp>
#pragma tabsize 0
#define FILTERSCRIPT
#if defined FILTERSCRIPT
new Hausschranke;
forward checkparea(playerid);
forward closehausschranke();
forward PlayerToPoint(Float:radi, playerid, Float:x, Float:y, Float:z);
public OnFilterScriptInit()
{
CreateObject(17037, 1528.729248, -680.242126, 96.241470, 0.0000, 0.0000, 180.0000);
CreateObject(17037, 1528.729004, -673.183777, 96.241470, 0.0000, 0.0000, 180.0000);
CreateObject(17037, 1528.729004, -666.121277, 96.241470, 0.0000, 0.0000, 180.0000);
CreateObject(1419, 1486.916138, -702.460999, 94.266388, 0.0000, 0.0000, 281.2500);
CreateObject(1419, 1488.438232, -706.164673, 94.275581, 0.0000, 0.0000, 303.7500);
CreateObject(1419, 1491.254150, -709.008972, 94.271706, 0.0000, 0.0000, 326.2500);
CreateObject(1419, 1508.385376, -701.982300, 94.275581, 0.0000, 0.0000, 258.7500);
CreateObject(1419, 1506.878906, -705.663147, 94.274872, 0.0000, 0.0000, 236.2501);
CreateObject(1419, 1504.094604, -708.522278, 94.263260, 0.0000, 0.0000, 213.7500);
CreateObject(626, 1500.328979, -688.945435, 95.798599, 0.0000, 0.0000, 0.0000);
CreateObject(626, 1493.950195, -688.974854, 95.798599, 0.0000, 0.0000, 0.0000);
CreateObject(870, 1504.558594, -710.349731, 93.718170, 0.0000, 0.0000, 0.0000);
CreateObject(870, 1503.434326, -712.325745, 93.600220, 0.0000, 0.0000, 0.0000);
CreateObject(870, 1504.976685, -712.881348, 93.348343, 0.0000, 0.0000, 0.0000);
CreateObject(870, 1506.384888, -710.883728, 93.320503, 0.0000, 0.0000, 0.0000);
CreateObject(870, 1504.110718, -714.294312, 93.428375, 0.0000, 0.0000, 0.0000);
CreateObject(870, 1502.649414, -714.331421, 93.646973, 0.0000, 0.0000, 0.0000);
CreateObject(871, 1490.364746, -711.009094, 93.982574, 0.0000, 0.0000, 0.0000);
CreateObject(871, 1489.904785, -710.273193, 93.976021, 0.0000, 0.0000, 0.0000);
CreateObject(871, 1491.296265, -712.323914, 93.996910, 0.0000, 0.0000, 0.0000);
CreateObject(871, 1487.877075, -712.155823, 93.946770, 0.0000, 0.0000, 0.0000);
CreateObject(871, 1486.404419, -709.152222, 93.948135, 0.0000, 0.0000, 0.0000);
CreateObject(871, 1487.186279, -707.154602, 93.981407, 0.0000, 0.0000, 0.0000);
CreateObject(871, 1488.167847, -709.148560, 93.966705, 0.0000, 0.0000, 0.0000);
CreateObject(871, 1489.389160, -711.331665, 93.968719, 0.0000, 0.0000, 0.0000);
CreateObject(871, 1487.353882, -710.659119, 93.938736, 0.0000, 0.0000, 0.0000);
CreateObject(871, 1489.817017, -713.000122, 93.975395, 0.0000, 0.0000, 0.0000);
CreateObject(3810, 1499.747192, -688.215332, 100.609428, 0.0000, 0.0000, 270.0000);
CreateObject(3810, 1494.137695, -688.246094, 100.616173, 0.0000, 0.0000, 270.0000);
CreateObject(3660, 1471.615234, -692.921753, 96.104279, 0.0000, 0.0000, 0.0000);
CreateObject(3660, 1466.323975, -692.922241, 96.105057, 0.0000, 0.0000, 0.0000);
CreateObject(966, 1494.152100, -710.186340, 93.745926, 0.0000, 0.0000, 180.0000);
Hausschranke = CreateObject(968, 1494.024536, -710.179565, 94.644562, 0.0000, 91.1861, 0.0000);
CreateObject(716, 1492.764526, -710.442322, 93.486000, 0.0000, 0.0000, 4.2187);
CreateObject(716, 1502.151367, -710.589783, 93.486832, 0.0000, 0.0000, 4.2187);
print("\n--------------------------------------");
print(" Hausschranke by Hoscht xD");
print("--------------------------------------\n");
return 1;
}
public OnFilterScriptExit()
{
return 1;
}
#else
#endif
public PlayerToPoint(Float:radi, playerid, Float:x, Float:y, Float:z)
{
if(IsPlayerConnected(playerid))
{
new Float:oldposx, Float:oldposy, Float:oldposz;
new Float:tempposx, Float:tempposy, Float:tempposz;
GetPlayerPos(playerid, oldposx, oldposy, oldposz);
tempposx = (oldposx -x);
tempposy = (oldposy -y);
tempposz = (oldposz -z);
//printf("DEBUG: X:%f Y:%f Z:%f",posx,posy,posz);
if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
{
return 1;
}
}
return 0;
}
public OnPlayerSpawn(playerid)
{
SetTimer("checkparea", 1500, 1);
return 1;
}
public checkparea(playerid)
{
if(PlayerToPoint(10.0, playerid, 1494.024536, -710.179565, 94.644562)) // 10.0 ist der Radius
{
MoveObject(Hausschranke,1494.023926, -710.179871, 94.646111,4); // 4 ist glaub ich die Geschwindigkeit
SetTimer("closehausschranke", 5000, 0);
}
return 1;
}
public closehausschranke()
{
MoveObject(Hausschranke,1494.024536, -710.179565, 94.644562,4);
return 1;
}
warum nicht?^^