whats wrong with this automatic gate? - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: whats wrong with this automatic gate? (
/showthread.php?tid=65056)
whats wrong with this automatic gate? -
gtalover12 - 09.02.2009
hey, well.. iv'e got one gate working but.. the others just WONT work .. thare using a skin check, here is the code
Top Of Script:
Код:
new SFPDGATE;
new IsNearSFPDGate[MAX_PLAYERS];
forward SFPDgate(playerid);
new GS;
stock IsACop(playerid)
GS = GetPlayerSkin(playerid)
OnGameModeInit:
Код:
SFPDGATE = CreateObject(968, -1572.186890, 658.823425, 6.962374, 0.0000, 268.8997, 270.0000);
SetTimer("SFPDgate",100, 1);
public SFPDgate:
Код:
public SFPDgate(playerid)
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(PlayerToPoint(i, 10.0, -1572.186890, 658.823425, 6.962374))
{
if(IsNearSFPDGate[i] == 0)
{
if(GS >= 281 && GS <= 280 && GS <= 282 && GS <= 283 && GS <= 288 && GS <= 284 && GS <= 285 && GS <= 286)
{
SetObjectRot(SFPDGATE, 0.0000, 347.9679, 270.0000);
IsNearSFPDGate[i] = 1;
}
}
else
{
if(IsNearSFPDGate[i] == 1)
{
SetObjectRot(SFPDGATE, 0.0000, 268.8997, 270.0000);
IsNearSFPDGate[i] = 0;
}
}
}
}
}
:/ wen i go up to the gate with the skin of the SWAT guy .. it doesnt move.. ? can someone help me out... ive got one working WITHOUT the skincheck.. but i want the gate for these skin ID's only:
281, 280, 282, 283, 288, 284, 285, 286.
THANKS in advanced
Re: whats wrong with this automatic gate? -
Auto-Sized - 09.02.2009
pawn Код:
//top of script after includes/defines etc.
IsACop(playerid)
{
if (GetPlayerSkin(playerid) >= 280 && GetPlayerSkin(playerid) <= 286)
{
return 1;
}
else if (GetPlayerSkin(playerid) == 288)
{
return 1;
}
return 0;
}
//change
if(GS >= 281 && GS <= 280 && GS <= 282 && GS <= 283 && GS <= 288 && GS <= 284 && GS <= 285 && GS <= 286)
//to
if (IsACop(playerid))
PlayerToPoint should only be needed to check if near gate.