forward kapucheck();
new kapu;
new Float:coords[2][3] = {{x, y, z},{x, y, z}};
kapu = CreateObject(OBJECT ID, coords[0][0], coords[0][1], coords[0][2], 0, 0, 0);SetTimer(\"kapucheck\", 1000, 1);
public kapucheck() {new kozelbenvan;for(new i = 0; i <= MAX_PLAYERS; i++) { if(IsPlayerConnected(i)) { if(GetPlayerDistanceToPointEx(i, coords[0][0], coords[0][1], coords[0][2]) < 10) { kozelbenvan = 1; break; } }}if(kozelbenvan) nyitas();else zaras();}
nyitas() {new Float:x, Float:y, Float:z;GetObjectPos(kapu, x, y, z);if(x == coords[0][0]) {MoveObject(kapu, coords[1][0], coords[1][1], coords[1][2], 4);}}zaras() {new Float:x, Float:y, Float:z;GetObjectPos(kapu, x, y, z);if(x == coords[1][0]) {MoveObject(kapu, coords[0][0], coords[0][1], coords[0][2], 4);}}GetPlayerDistanceToPointEx(playerid,Float:x,Float:y,Float:z) {new Float:x1,Float:y1,Float:z1;new Float:tmpdis;GetPlayerPos(playerid,x1,y1,z1);tmpdis = floatsqroot(floatpower(floatabs(floatsub(x,x1)),2)+floatpower(floatabs(floatsub(y,y1)),2)+floatpower(floatabs(floatsub(z,z1)),2));return floatround(tmpdis);}
IKösz sikerült elég sokat szenvedtem vele de sikerült.
#include <a_samp>#define FILTERSCRIPT#if defined FILTERSCRIPTnew kapu;public OnFilterScriptInit(){kapu = CreateObject(980, -9.530863, 2066.887207, 19.265579, 0.0000, 0.0000, 270.0000 ); return 1;}#endifpublic OnPlayerCommandText(playerid, cmdtext[]){ if(strcmp(cmdtext, \"/close\", true) == 0) { MoveObject(kapu, -9.530863, 2066.887207, 19.265579, 2);return 1; } if(strcmp(cmdtext, \"/open\", true) == 0) { MoveObject(kapu, -9.175781, 2055.247803, 19.599146, 2); return 1; } return 0;}
Jó kis TUT de nekem van vele egy gondom:mikor mindent megcsinalok ahogy az a tut ban le van irva az elejen compilalom de nem jelenik meg abban az ablakban semmiaztan megnyitom a samp-server.exe-t es aztan kiirja h runtime error 17 : invalid/unsupported p-code file format!mi lehet ezzel a baj???kerlek segitsetek nekem.en csak sima kaput akarok kinyitni es becsukni semmi timer meg stb...ugy akarom megcsinalni ahogy az a topic elejen van...koszonom a segitsegeteket...
C:\\Users\\Bundi\\Desktop\\tm\\pawno\\include\\xStreamer.inc(25) : warning 219: local variable \"x\" shadows a variable at a preceding levelC:\\Users\\Bundi\\Desktop\\tm\\pawno\\include\\xStreamer.inc(35) : warning 219: local variable \"x\" shadows a variable at a preceding levelC:\\Users\\Bundi\\Desktop\\tm\\pawno\\include\\YSI/Visual/YSI_objects.own(1320) : warning 219: local variable \"X\" shadows a variable at a preceding levelC:\\Users\\Bundi\\Desktop\\tm\\pawno\\include\\YSI/Visual/YSI_objects.own(1320) : warning 219: local variable \"Y\" shadows a variable at a preceding levelC:\\Users\\Bundi\\Desktop\\tm\\pawno\\include\\YSI/Visual/YSI_objects.own(1320) : warning 219: local variable \"Z\" shadows a variable at a preceding levelC:\\Users\\Bundi\\Desktop\\tm\\pawno\\include\\YSI/Visual/YSI_objects.own(1350) : warning 219: local variable \"X\" shadows a variable at a preceding levelC:\\Users\\Bundi\\Desktop\\tm\\pawno\\include\\YSI/Visual/YSI_objects.own(1350) : warning 219: local variable \"Y\" shadows a variable at a preceding levelC:\\Users\\Bundi\\Desktop\\tm\\pawno\\include\\YSI/Visual/YSI_objects.own(1350) : warning 219: local variable \"Z\" shadows a variable at a preceding levelC:\\Users\\Bundi\\Desktop\\tm\\pawno\\include\\YSI/Visual/YSI_objects.own(1387) : warning 219: local variable \"X\" shadows a variable at a preceding levelC:\\Users\\Bundi\\Desktop\\tm\\pawno\\include\\YSI/Visual/YSI_objects.own(1387) : warning 219: local variable \"Y\" shadows a variable at a preceding levelC:\\Users\\Bundi\\Desktop\\tm\\pawno\\include\\YSI/Visual/YSI_objects.own(1387) : warning 219: local variable \"Z\" shadows a variable at a preceding levelC:\\Users\\Bundi\\Desktop\\tm\\pawno\\include\\YSI/Visual/YSI_objects.own(1425) : warning 219: local variable \"X\" shadows a variable at a preceding levelC:\\Users\\Bundi\\Desktop\\tm\\pawno\\include\\YSI/Visual/YSI_objects.own(1425) : warning 219: local variable \"Y\" shadows a variable at a preceding levelC:\\Users\\Bundi\\Desktop\\tm\\pawno\\include\\YSI/Visual/YSI_objects.own(1425) : warning 219: local variable \"Z\" shadows a variable at a preceding levelC:\\Users\\Bundi\\Desktop\\tm\\pawno\\include\\YSI/Visual/YSI_objects.own(1472) : warning 219: local variable \"x\" shadows a variable at a preceding levelC:\\Users\\Bundi\\Desktop\\tm\\pawno\\include\\YSI/Visual/YSI_objects.own(1557) : warning 219: local variable \"x\" shadows a variable at a preceding levelC:\\Users\\Bundi\\Desktop\\tm\\pawno\\include\\YSI/Visual/YSI_objects.own(1909) : warning 219: local variable \"x\" shadows a variable at a preceding levelC:\\Users\\Bundi\\Desktop\\tm\\pawno\\include\\YSI/Visual/YSI_objects.own(1944) : warning 219: local variable \"x\" shadows a variable at a preceding levelC:\\Users\\Bundi\\Desktop\\tm\\pawno\\include\\YSI/Visual/YSI_objects.own(1999) : warning 219: local variable \"x\" shadows a variable at a preceding levelC:\\Users\\Bundi\\Desktop\\tm\\pawno\\include\\YSI/Visual/YSI_objects.own(2042) : warning 219: local variable \"x\" shadows a variable at a preceding levelC:\\Users\\Bundi\\Desktop\\tm\\pawno\\include\\YSI/Visual/YSI_objects.own(2079) : warning 219: local variable \"x\" shadows a variable at a preceding levelC:\\Users\\Bundi\\Desktop\\tm\\pawno\\include\\YSI/Visual/YSI_objects.own(2376) : warning 219: local variable \"x\" shadows a variable at a preceding levelC:\\Users\\Bundi\\Desktop\\tm\\pawno\\include\\YSI/Visual/YSI_objects.own(2418) : warning 219: local variable \"x\" shadows a variable at a preceding levelC:\\Users\\Bundi\\Desktop\\tm\\pawno\\include\\YSI/Visual/YSI_objects.own(2520) : warning 219: local variable \"X\" shadows a variable at a preceding levelC:\\Users\\Bundi\\Desktop\\tm\\pawno\\include\\YSI/Visual/YSI_objects.own(2520) : warning 219: local variable \"Y\" shadows a variable at a preceding levelC:\\Users\\Bundi\\Desktop\\tm\\pawno\\include\\YSI/Visual/YSI_objects.own(2520) : warning 219: local variable \"Z\" shadows a variable at a preceding levelC:\\Users\\Bundi\\Desktop\\tm\\pawno\\include\\YSI/Visual/YSI_objects.own(2599) : warning 219: local variable \"X\" shadows a variable at a preceding levelC:\\Users\\Bundi\\Desktop\\tm\\pawno\\include\\YSI/Visual/YSI_objects.own(2599) : warning 219: local variable \"Y\" shadows a variable at a preceding levelC:\\Users\\Bundi\\Desktop\\tm\\pawno\\include\\YSI/Visual/YSI_objects.own(2599) : warning 219: local variable \"Z\" shadows a variable at a preceding levelC:\\Users\\Bundi\\Desktop\\tm\\pawno\\include\\YSI/Visual/YSI_objects.own(2698) : warning 219: local variable \"x\" shadows a variable at a preceding levelC:\\Users\\Bundi\\Desktop\\tm\\pawno\\include\\YSI/Visual/YSI_objects.own(2743) : warning 219: local variable \"X\" shadows a variable at a preceding levelC:\\Users\\Bundi\\Desktop\\tm\\pawno\\include\\YSI/Visual/YSI_objects.own(2743) : warning 219: local variable \"Y\" shadows a variable at a preceding levelC:\\Users\\Bundi\\Desktop\\tm\\pawno\\include\\YSI/Visual/YSI_objects.own(2743) : warning 219: local variable \"Z\" shadows a variable at a preceding levelC:\\Users\\Bundi\\Desktop\\tm\\pawno\\include\\YSI/Visual/YSI_objects.own(2786) : warning 219: local variable \"X\" shadows a variable at a preceding levelC:\\Users\\Bundi\\Desktop\\tm\\pawno\\include\\YSI/Visual/YSI_objects.own(2786) : warning 219: local variable \"Y\" shadows a variable at a preceding levelC:\\Users\\Bundi\\Desktop\\tm\\pawno\\include\\YSI/Visual/YSI_objects.own(2786) : warning 219: local variable \"Z\" shadows a variable at a preceding levelC:\\Users\\Bundi\\Desktop\\tm\\pawno\\include\\YSI/Visual/YSI_objects.own(3056) : warning 219: local variable \"x\" shadows a variable at a preceding levelC:\\Users\\Bundi\\Desktop\\tm\\pawno\\include\\YSI/Visual/YSI_objects.own(3094) : warning 219: local variable \"x\" shadows a variable at a preceding levelC:\\Users\\Bundi\\Desktop\\tm\\pawno\\include\\YSI/Visual/YSI_objects.own(3187) : warning 219: local variable \"x\" shadows a variable at a preceding levelC:\\Users\\Bundi\\Desktop\\tm\\pawno\\include\\YSI/Visual/YSI_objects.own(3191) : warning 219: local variable \"i\" shadows a variable at a preceding levelC:\\Users\\Bundi\\Desktop\\tm\\pawno\\include\\YSI/Visual/YSI_objects.own(3334) : warning 219: local variable \"x\" shadows a variable at a preceding levelC:\\Users\\Bundi\\Desktop\\tm\\pawno\\include\\YSI/Visual/YSI_objects.own(3415) : warning 219: local variable \"i\" shadows a variable at a preceding levelC:\\Users\\Bundi\\Desktop\\tm\\pawno\\include\\YSI/Visual/YSI_objects.own(3428) : warning 219: local variable \"i\" shadows a variable at a preceding levelC:\\Users\\Bundi\\Desktop\\tm\\pawno\\include\\YSI/Visual/YSI_objects.own(3485) : warning 219: local variable \"x\" shadows a variable at a preceding levelC:\\Users\\Bundi\\Desktop\\tm\\pawno\\include\\YSI/Visual/YSI_objects.own(3587) : warning 219: local variable \"i\" shadows a variable at a preceding levelC:\\Users\\Bundi\\Desktop\\tm\\pawno\\include\\YSI/Visual/YSI_objects.own(4040) : warning 219: local variable \"x\" shadows a variable at a preceding levelC:\\Users\\Bundi\\Desktop\\tm\\gamemodes\\lvdma.pwn(330) : warning 219: local variable \"gangnum\" shadows a variable at a preceding levelC:\\Users\\Bundi\\Desktop\\tm\\gamemodes\\lvdma.pwn(333) : warning 219: local variable \"i\" shadows a variable at a preceding levelC:\\Users\\Bundi\\Desktop\\tm\\gamemodes\\lvdma.pwn(379) : warning 219: local variable \"X\" shadows a variable at a preceding levelC:\\Users\\Bundi\\Desktop\\tm\\gamemodes\\lvdma.pwn(379) : warning 219: local variable \"Y\" shadows a variable at a preceding levelC:\\Users\\Bundi\\Desktop\\tm\\gamemodes\\lvdma.pwn(379) : warning 219: local variable \"Z\" shadows a variable at a preceding levelC:\\Users\\Bundi\\Desktop\\tm\\gamemodes\\lvdma.pwn(393) : warning 219: local variable \"X\" shadows a variable at a preceding levelC:\\Users\\Bundi\\Desktop\\tm\\gamemodes\\lvdma.pwn(393) : warning 219: local variable \"Y\" shadows a variable at a preceding levelC:\\Users\\Bundi\\Desktop\\tm\\gamemodes\\lvdma.pwn(393) : warning 219: local variable \"Z\" shadows a variable at a preceding levelC:\\Users\\Bundi\\Desktop\\tm\\gamemodes\\lvdma.pwn(416) : warning 219: local variable \"i\" shadows a variable at a preceding levelC:\\Users\\Bundi\\Desktop\\tm\\gamemodes\\lvdma.pwn(429) : warning 219: local variable \"i\" shadows a variable at a preceding levelC:\\Users\\Bundi\\Desktop\\tm\\gamemodes\\lvdma.pwn(450) : warning 219: local variable \"i\" shadows a variable at a preceding levelC:\\Users\\Bundi\\Desktop\\tm\\gamemodes\\lvdma.pwn(478) : warning 219: local variable \"i\" shadows a variable at a preceding levelC:\\Users\\Bundi\\Desktop\\tm\\gamemodes\\lvdma.pwn(481) : warning 219: local variable \"i\" shadows a variable at a preceding levelC:\\Users\\Bundi\\Desktop\\tm\\gamemodes\\lvdma.pwn(499) : warning 219: local variable \"i\" shadows a variable at a preceding levelC:\\Users\\Bundi\\Desktop\\tm\\gamemodes\\lvdma.pwn(516) : warning 219: local variable \"i\" shadows a variable at a preceding levelC:\\Users\\Bundi\\Desktop\\tm\\gamemodes\\lvdma.pwn(534) : warning 219: local variable \"i\" shadows a variable at a preceding levelC:\\Users\\Bundi\\Desktop\\tm\\gamemodes\\lvdma.pwn(594) : warning 219: local variable \"i\" shadows a variable at a preceding levelC:\\Users\\Bundi\\Desktop\\tm\\gamemodes\\lvdma.pwn(623) : warning 219: local variable \"i\" shadows a variable at a preceding levelC:\\Users\\Bundi\\Desktop\\tm\\gamemodes\\lvdma.pwn(639) : warning 219: local variable \"i\" shadows a variable at a preceding levelC:\\Users\\Bundi\\Desktop\\tm\\gamemodes\\lvdma.pwn(649) : warning 219: local variable \"i\" shadows a variable at a preceding levelC:\\Users\\Bundi\\Desktop\\tm\\gamemodes\\lvdma.pwn(678) : error 026: no matching \"#if...\"C:\\Users\\Bundi\\Desktop\\tm\\gamemodes\\lvdma.pwn(682) : error 017: undefined symbol \"lift\"C:\\Users\\Bundi\\Desktop\\tm\\gamemodes\\lvdma.pwn(688) : error 017: undefined symbol \"lift\"C:\\Users\\Bundi\\Desktop\\tm\\gamemodes\\lvdma.pwn(662) : warning 203: symbol is never used: \"weaponid\"C:\\Users\\Bundi\\Desktop\\tm\\gamemodes\\lvdma.pwn(662) : warning 203: symbol is never used: \"moneys\"C:\\Users\\Bundi\\Desktop\\tm\\gamemodes\\lvdma.pwn(662) : warning 203: symbol is never used: \"giveplayerid\"C:\\Users\\Bundi\\Desktop\\tm\\gamemodes\\lvdma.pwn(660) : warning 204: symbol is assigned a value that is never used: \"giveplayer\"C:\\Users\\Bundi\\Desktop\\tm\\gamemodes\\lvdma.pwn(659) : warning 204: symbol is assigned a value that is never used: \"sendername\"C:\\Users\\Bundi\\Desktop\\tm\\gamemodes\\lvdma.pwn(658) : warning 203: symbol is never used: \"playermoney\"C:\\Users\\Bundi\\Desktop\\tm\\gamemodes\\lvdma.pwn(657) : warning 204: symbol is assigned a value that is never used: \"string\"C:\\Users\\Bundi\\Desktop\\tm\\gamemodes\\lvdma.pwn(657 -- 696) : error 010: invalid function or declarationC:\\Users\\Bundi\\Desktop\\tm\\gamemodes\\lvdma.pwn(657 -- 700) : error 010: invalid function or declarationC:\\Users\\Bundi\\Desktop\\tm\\gamemodes\\lvdma.pwn(657 -- 700) : fatal error 107: too many error messages on one lineCompilation aborted.Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase 6 Errors.
valaki segiteni hogy hova mit kell irni tehat pl. hogy hova kell Float:X Float:Y Float:Z irni? PLS valaki HELP ME :\'(
new Float:X, Float:Y, Float:Z;
Spatrik\" post=\"18381\" timestamp=\"1249301671\"]Nem erre gondolt hanem arra, hogy a CreatEObject fuhgvenyben houa kel irni a koordinatakat. -.- lama [/quote]Ja tényleg, bocs. Már nem írom le a választ, úgyis egy hónappal ezelõtt írta már, és nem hiszem, hogy járna a fórumra.
new kapu1;new kapu2;new kapu3;
//Clubhouse ObjectsCreateObject(985, 1938.7079, 1476.5225, 10.8383, 0.0000, 0.0000, 0.0000);kapu1 = CreateObject(985, 1938.7079, 1476.5225, 10.8383, 0.0000, 0.0000, 0.0000);CreateObject(985, 1945.6532, 1476.5601, 10.8408, 0.0000, 0.0000, 0.0000);kapu2 = CreateObject(985, 1945.6532, 1476.5601, 10.8408, 0.0000, 0.0000, 0.0000); CreateObject(991, 1967.7844, 1543.5049, 12.1184, 179.6224, 90.2409, 93.6786);kapu3 = CreateObject(991, 1967.7844, 1543.5049, 12.1184, 179.6224, 90.2409, 93.6786);
if(strcmp(cmdtext, \"/szazam-ki\", true) == 0) { MoveObject(kapu1, 1930.9591, 1476.3705, 10.9961, 2);MoveObject(kapu2, 1953.4380, 1476.5281, 10.8310, 2);MoveObject(kapu3, 1967.7754, 1543.4941, 5.6979, 2); return 1; }return 0;} if(strcmp(cmdtext, \"/szazam-be\", true) == 0) { MoveObject(kapu1, 1938.7079, 1476.5225, 10.8383, 2);MoveObject(kapu2, 1945.6532, 1476.5601, 10.8408, 2);MoveObject(kapu3, 1967.7844, 1543.5049, 12.1184, 2); return 1; }return 0;}
#include <a_samp>new kapu[3];public OnGameModeInit(){//Clubhouse ObjectsCreateObject(985, 1938.7079, 1476.5225, 10.8383, 0.0000, 0.0000, 0.0000);kapu[0] = CreateObject(985, 1938.7079, 1476.5225, 10.8383, 0.0000, 0.0000, 0.0000);CreateObject(985, 1945.6532, 1476.5601, 10.8408, 0.0000, 0.0000, 0.0000);kapu[1] = CreateObject(985, 1945.6532, 1476.5601, 10.8408, 0.0000, 0.0000, 0.0000); CreateObject(991, 1967.7844, 1543.5049, 12.1184, 179.6224, 90.2409, 93.6786);kapu[2] = CreateObject(991, 1967.7844, 1543.5049, 12.1184, 179.6224, 90.2409, 93.6786);return 1;}public OnPlayerCommandText(playerid, cmdtext[]){if(strcmp(cmdtext, \"/szazam-ki\", true) == 0) { MoveObject(kapu[0], 1930.9591, 1476.3705, 10.9961, 2);MoveObject(kapu[1], 1953.4380, 1476.5281, 10.8310, 2);MoveObject(kapu[2], 1967.7754, 1543.4941, 5.6979, 2); return 1; }if(strcmp(cmdtext, \"/szazam-be\", true) == 0) { MoveObject(kapu[0], 1938.7079, 1476.5225, 10.8383, 2);MoveObject(kapu[1], 1945.6532, 1476.5601, 10.8408, 2);MoveObject(kapu[2], 1967.7844, 1543.5049, 12.1184, 2); return 1; }return 0;}