gate wont close - 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: gate wont close (
/showthread.php?tid=185372)
gate wont close -
Tom1412 - 24.10.2010
hi,
i have got the gate to open but how do i get it to close, i have tried but with no luck.
PHP код:
#include <a_samp>
#define COLOR_RED 0xAA3333AA
new gateobject;
public OnFilterScriptInit()
{
gateobject = CreateObject(980,1101.7249755859, -1741.2767333984, 15.273958206177, 0, 0, 90);
return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/buyticket", cmdtext, true, 10) == 0)
{
if(GetPlayerMoney(playerid) <= 50) return SendClientMessage(playerid, 0xFFFFFF, "You are to far to pay.");
GivePlayerMoney(playerid, -25); MoveObject(gateobject,1101.7249755859, -1752.2767333984, 15.273958206177, 5.0);
SendClientMessage(playerid,COLOR_RED,"You have just paid and the gate is open");
return 1;
}
return 0;
}
Re: gate wont close -
JaTochNietDan - 24.10.2010
Use
MoveObject(gateobject,1101.7249755859, -1741.2767333984, 15.273958206177, 5.0);
Where you want to close the gate...such as a timer, or a new command.
Re: gate wont close -
TheXIII - 24.10.2010
You create the gate at already opened coordinates. Instead of checking the distance from the gate you check if player has 50$ and even then it costs only 25$ anyway.
You can close the gate with timer for example, by moving it to the closed state coords.
Re: gate wont close -
Tom1412 - 24.10.2010
iv added a close command bit but im getting errors
errors
PHP код:
C:\Users\tom\Desktop\MOB Real Server\filterscripts\pay.pwn(7) : error 017: undefined symbol "playerid"
C:\Users\tom\Desktop\MOB Real Server\filterscripts\pay.pwn(10) : error 010: invalid function or declaration
C:\Users\tom\Desktop\MOB Real Server\filterscripts\pay.pwn(11) : error 010: invalid function or declaration
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
3 Errors.
PHP код:
#include <a_samp>
#define COLOR_RED 0xAA3333AA
new gateobject;
public OnFilterScriptInit()
{
MoveObject(gateobject,1101.7249755859, -1741.2767333984, 15.273958206177, 0.97);
PlayerPlaySound(playerid,1101.7249755859, -1741.2767333984, 15.273958206177);
return 1;
}
gateobject = CreateObject(980,1101.7249755859, -1741.2767333984, 15.273958206177, 0, 0, 90);
return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/buyticket", cmdtext, true, 10) == 0)
{
if(GetPlayerMoney(playerid) <= 50) return SendClientMessage(playerid, 0xFFFFFF, "You are to far to pay.");
GivePlayerMoney(playerid, -25); MoveObject(gateobject,1101.7249755859, -1752.2767333984, 15.273958206177, 0.97);
SendClientMessage(playerid,COLOR_RED,"You have just paid and the gate is open");
return 1;
}
return 0;
}