#include <a_samp>#include <IsPlayerLAdmin>#if defined FILTERSCRIPT#elsenew kapu;new kapu2;new kapu3;new kapu4;new kapu5;new kapu6;new kapu7;public OnFilterScriptInit(){kapu = CreateObject(987, 2668.6069335938, 468.35043334961, 8.9748229980469, 0, 0, 172);kapu2 = CreateObject(987, 2665.7978515625, 468.70178222656, 8.9555511474609, 0, 0, 170);kapu3 = CreateObject(987, 2647.8645019531, 432.19100952148, 9.0050315856934, 0, 0, 262);kapu4 = CreateObject(987, 2647.0517578125, 426.33963012695, 9.1260852813721, 0, 0, 262);kapu5 = CreateObject(987, 2541.9711914063, 506.08053588867, 9.3554286956787, 0, 0, 173.03161621094);kapu6 = CreateObject(987, 2530.0517578125, 507.46173095703, 9.3517475128174, 0, 0, 173.43676757813);kapu7 = CreateObject(2990, 2237.653320, 2453.586914, 13.690311, 0.0000, 0.0000, 270.1600);SetTimer(\"CheckGate\",1000,true);return 1;}forward CheckGate();#endifpublic CheckGate(){new playerid; new kapu_status; new kapu2_status; new kapu3_status; new kapu4_status; new kapu5_status; new kapu6_status;new kapu7_status; for(new i;i<MAX_PLAYERS;i++) { if(!IsPlayerConnected(i)) continue; if(IsPlayerLAdmin(playerid)) if(IsPlayerInRangeOfPoint(i,20.0, 2668.6069335938, 468.35043334961, 8.9748229980469))kapu_status=1; if(IsPlayerLAdmin(playerid)) if(IsPlayerInRangeOfPoint(i,20.0, 2665.7978515625, 468.70178222656, 8.9555511474609))kapu2_status=1; if(IsPlayerLAdmin(playerid)) if(IsPlayerInRangeOfPoint(i,20.0, 2647.8645019531, 432.19100952148, 9.0050315856934))kapu3_status=1; if(IsPlayerLAdmin(playerid)) if(IsPlayerInRangeOfPoint(i,20.0, 2647.0517578125, 426.33963012695, 9.1260852813721))kapu4_status=1; if(IsPlayerLAdmin(playerid)) if(IsPlayerInRangeOfPoint(i,20.0, 2541.9711914063, 506.08053588867, 9.3554286956787))kapu5_status=1; if(IsPlayerLAdmin(playerid)) if(IsPlayerInRangeOfPoint(i,20.0, 2530.0517578125, 507.46173095703, 9.3517475128174))kapu6_status=1; } if(kapu_status)MoveObject(kapu, 2668.6069335938, 468.35043334961, -1.9748229980469,7); else MoveObject(kapu, 2668.6069335938, 468.35043334961, 8.9748229980469,7); if(kapu2_status)MoveObject(kapu2, 2665.7978515625, 468.70178222656, -1.9555511474609,7); else MoveObject(kapu2, 2665.7978515625, 468.70178222656, 8.9555511474609,7); if(kapu3_status)MoveObject(kapu3, 2647.8645019531, 432.19100952148, 2.0050315856934,7); else MoveObject(kapu3, 2647.8645019531, 432.19100952148, 9.0050315856934,7); if(kapu4_status)MoveObject(kapu4, 2647.0517578125, 426.33963012695, 2.1260852813721,7); else MoveObject(kapu4, 2647.0517578125, 426.33963012695, 9.1260852813721,7); if(kapu5_status)MoveObject(kapu5, 2541.9711914063, 506.08053588867, 2.3554286956787,7); else MoveObject(kapu5, 2541.9711914063, 506.08053588867, 9.3554286956787,7); if(kapu6_status)MoveObject(kapu6, 2530.0517578125, 507.46173095703, 2.3517475128174,7); else MoveObject(kapu6, 2530.0517578125, 507.46173095703, 9.3517475128174,7); if(kapu7_status)MoveObject(kapu7, 2237.634765, 2445.240722, 13.690311,7); else MoveObject(kapu7, 2237.653320, 2453.586914, 13.690311,7);} [/quote]Egyszerüen nem jövök rá. Segítsetek, köszönöm üdv: Dávid
Üdv, Nos ezt a scriptet arra írtam hogy ha egy admin a közelébe magy, kinyillik a kapu, majd bezár, eddig okés, de! Ha civil odamegy akkor is kinyillik, pedig benne van az #include <IsPlayerLAdmin>, és nem tudom mi a baj, hibaüzenet nincsen.
if(!IsPlayerLAdmin(playerid))
if(!IsPlayerAdmin(playerid))
if(IsPlayerLAdmin(playerid)) [/quote]-terre: if(!IsPlayerLAdmin(playerid)) [/quote]De semmi a civil is tudja nyitni....
if(!IsPlayerLAdmin(playerid)) [/quote]De semmi a civil is tudja nyitni....
Egyszer összejött hogy csak civil nyitja, kipróbáltam ezer variációt de semmi, úgy kellene hogy csak a rendorök nyithatják IsPlayerLAdmin. [/quote]
Lecseréltem az öszes if(IsPlayerLAdmin(playerid)) -terre: if(!IsPlayerLAdmin(playerid)) [/quote]De semmi a civil is tudja nyitni.... [/quote]Az if(!IsPlayerLAdmin(playerid)) az azt jelenti hogy ha NEM ladmin a játékos tehát el kell hagynunk a felkiáltó jelet #if defined FILTERSCRIPT, #else, #endif ezeket töröld ki mert nem szükségesa checkgatenél töröld ki a változókatés nem kell status mert sokkal egyszerubben is megtudod oldani pl.: if(IsPlayerLAdmin(i){ if(IsPlayerInRangeOfPoint(i,20.0, 2530.0517578125, 507.46173095703, 9.3517475128174)) { MoveObject(kapu2, 2665.7978515625, 468.70178222656, -1.9555511474609,7); }else{ MoveObject(kapu2, 2665.7978515625, 468.70178222656, -1.955553539,7); }} VAGYMaradhat az egész úgy ahogy van csak egy nagy hiba if(IsPlayerLAdmin(playerid)) ezt így kéne if(IsPlayerLAdmin(i)sry ha hülyeséget írtam
if(IsPlayerLAdmin(playerid))
if(!IsPlayerLAdmin(playerid)) [/quote]De semmi a civil is tudja nyitni.... [/quote]Az if(!IsPlayerLAdmin(playerid)) az azt jelenti hogy ha NEM ladmin a játékos tehát el kell hagynunk a felkiáltó jelet #if defined FILTERSCRIPT, #else, #endif ezeket töröld ki mert nem szükségesa checkgatenél töröld ki a változókatés nem kell status mert sokkal egyszerubben is megtudod oldani pl.: if(IsPlayerLAdmin(i){ if(IsPlayerInRangeOfPoint(i,20.0, 2530.0517578125, 507.46173095703, 9.3517475128174)) { MoveObject(kapu2, 2665.7978515625, 468.70178222656, -1.9555511474609,7); }else{ MoveObject(kapu2, 2665.7978515625, 468.70178222656, -1.955553539,7); }} VAGYMaradhat az egész úgy ahogy van csak egy nagy hiba if(IsPlayerLAdmin(playerid)) ezt így kéne if(IsPlayerLAdmin(i)sry ha hülyeséget írtam
if(IsPlayerLAdmin(i){ if(IsPlayerInRangeOfPoint(i,20.0, 2530.0517578125, 507.46173095703, 9.3517475128174)) { MoveObject(kapu2, 2665.7978515625, 468.70178222656, -1.9555511474609,7); }else{ MoveObject(kapu2, 2665.7978515625, 468.70178222656, -1.955553539,7); }}
public CheckGate(){new i;if(IsPlayerLAdmin(i)){ if(IsPlayerInRangeOfPoint(i,10.0, 2668.6069335938, 468.35043334961, 8.9748229980469)) { MoveObject(kapu, 2668.6069335938, 468.35043334961, -1.9748229980469,7); }else{ MoveObject(kapu, 2668.6069335938, 468.35043334961, 8.9748229980469,7); return 1; } if(IsPlayerInRangeOfPoint(i,10.0, 2665.7978515625, 468.70178222656, 8.9555511474609)) { MoveObject(kapu2, 2665.7978515625, 468.70178222656, -1.9555511474609,7); }else{ MoveObject(kapu2, 2665.7978515625, 468.70178222656, 8.9555511474609,7); return 1; } if(IsPlayerInRangeOfPoint(i,10.0, 2647.8645019531, 432.19100952148, 9.0050315856934)) { MoveObject(kapu3, 2647.8645019531, 432.19100952148, 2.0050315856934,7); }else{ MoveObject(kapu3, 2647.8645019531, 432.19100952148, 9.0050315856934,7); return 1; } if(IsPlayerInRangeOfPoint(i,10.0, 2647.0517578125, 426.33963012695, 9.1260852813721)) { MoveObject(kapu4, 2647.0517578125, 426.33963012695, 9.1260852813721,7); }else{ MoveObject(kapu4, 2647.0517578125, 426.33963012695, 9.1260852813721,7); return 1; } if(IsPlayerInRangeOfPoint(i,10.0, 2541.9711914063, 506.08053588867, 9.3554286956787)) { MoveObject(kapu5, 2541.9711914063, 506.08053588867, 2.3554286956787,7); }else{ MoveObject(kapu5, 2541.9711914063, 506.08053588867, 9.3554286956787,7); return 1; } if(IsPlayerInRangeOfPoint(i,10.0, 2530.0517578125, 507.46173095703, 9.3517475128174)) { MoveObject(kapu6, 2530.0517578125, 507.46173095703, 2.3517475128174,7); }else{ MoveObject(kapu6, 2530.0517578125, 507.46173095703, 9.3517475128174,7); return 1; } if(IsPlayerInRangeOfPoint(i,10.0, 2237.653320, 2453.586914, 13.690311)) { MoveObject(kapu7, 2237.634765, 2445.240722, 13.690311,7); }else{ MoveObject(kapu7, 2237.653320, 2453.586914, 13.690311,7); return 1; }} return 0;}[/quote]Üdv Dávid
public CheckGate(){for(new i;i<MAX_PLAYERS;i++){if(IsPlayerLAdmin(i)){ if(IsPlayerInRangeOfPoint(i,10.0, 2668.6069335938, 468.35043334961, 8.9748229980469)) { MoveObject(kapu, 2668.6069335938, 468.35043334961, -1.9748229980469,7); }else{ MoveObject(kapu, 2668.6069335938, 468.35043334961, 8.9748229980469,7); } if(IsPlayerInRangeOfPoint(i,10.0, 2665.7978515625, 468.70178222656, 8.9555511474609)) { MoveObject(kapu2, 2665.7978515625, 468.70178222656, -1.9555511474609,7); }else{ MoveObject(kapu2, 2665.7978515625, 468.70178222656, 8.9555511474609,7); } if(IsPlayerInRangeOfPoint(i,10.0, 2647.8645019531, 432.19100952148, 9.0050315856934)) { MoveObject(kapu3, 2647.8645019531, 432.19100952148, 2.0050315856934,7); }else{ MoveObject(kapu3, 2647.8645019531, 432.19100952148, 9.0050315856934,7); } if(IsPlayerInRangeOfPoint(i,10.0, 2647.0517578125, 426.33963012695, 9.1260852813721)) { MoveObject(kapu4, 2647.0517578125, 426.33963012695, 9.1260852813721,7); }else{ MoveObject(kapu4, 2647.0517578125, 426.33963012695, 9.1260852813721,7); } if(IsPlayerInRangeOfPoint(i,10.0, 2541.9711914063, 506.08053588867, 9.3554286956787)) { MoveObject(kapu5, 2541.9711914063, 506.08053588867, 2.3554286956787,7); }else{ MoveObject(kapu5, 2541.9711914063, 506.08053588867, 9.3554286956787,7); } if(IsPlayerInRangeOfPoint(i,10.0, 2530.0517578125, 507.46173095703, 9.3517475128174)) { MoveObject(kapu6, 2530.0517578125, 507.46173095703, 2.3517475128174,7); }else{ MoveObject(kapu6, 2530.0517578125, 507.46173095703, 9.3517475128174,7); } if(IsPlayerInRangeOfPoint(i,10.0, 2237.653320, 2453.586914, 13.690311)) { MoveObject(kapu7, 2237.634765, 2445.240722, 13.690311,7); }else{ MoveObject(kapu7, 2237.653320, 2453.586914, 13.690311,7); } }}} [/quote]Igaz most admin nyitja, de vagy egynek nyillik, vagy csak rconnak.....