coordinates admin 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: coordinates admin gate (
/showthread.php?tid=77199)
coordinates admin gate -
killer94nl - 09.05.2009
Hey people , i got question
i made a admin base , and for that admin base i needed a gate that only admins can open , so i made one and it works , it goes open but does not close and if its opens the gate moves away and not in the ground so i thought maby the coordinates were wrong ,
and can someone tell me how to fix this , and does someone now a good way to make a gate open coordinat
these are my coordinates:
open admin gate = // -1620.044106, 681.946533, 0.960892, 2.00
and the normal close gate =// -1643.084106, 681.946533, 8.960892, 2.00
Re: coordinates admin gate -
Paladin - 09.05.2009
It is on the Wiki but I cannot find it so I'll explain anyway since I have time.
I will start with a basic /usegate command on you're gate.
Step 1:
At the top of your script under you're color(colour) definitions, forwards and anything else you have, but above all the publics please place:
Step 2:
Go to the place that you added in all you're objects etc.. make sure you're gate open and closed objects are not there. then type the following:
Код:
admingate = CreateObject(-1643.084106, 681.946533, 8.960892, 2.00)
Step 3:
Now goto your "OnPlayerCommandText" and insert the following:
Код:
if(strcmp(cmdtext,"/usegate", true) == 0)
{
if([THIS IS WHERE YOU INSERT YOUR VARIABLE TO CHECK FOR AN ADMIN])
{
new gateuse;
if(gateuse == 0)
{
MoveObject(admingate, -1620.044106, 681.946533, 0.960892, 2.00);
gateuse = 1;
return 1;
}
else if(gateuse == 1)
{
MoveObject(whgate, -1643.084106, 681.946533, 8.960892, 2.00);
gateuse = 0;
}
else
{
SendClientMessage(playerid, COLOR_LIGHTRED, "You cannot open this gate");
}
}
}
and that should be set up... I haven't tested it, but if it doesn't work just tell me. or if you are stuck somewhere just tell me.
Re: coordinates admin gate -
HB - 09.05.2009
Quote:
Originally Posted by Paladin
It is on the Wiki but I cannot find it so I'll explain anyway since I have time.
I will start with a basic /usegate command on you're gate.
Step 1:
At the top of your script under you're color(colour) definitions, forwards and anything else you have, but above all the publics please place:
Step 2:
Go to the place that you added in all you're objects etc.. make sure you're gate open and closed objects are not there. then type the following:
Код:
admingate = CreateObject(-1643.084106, 681.946533, 8.960892, 2.00)
Step 3:
Now goto your "OnPlayerCommandText" and insert the following:
Код:
if(strcmp(cmdtext,"/usegate", true) == 0)
{
if([THIS IS WHERE YOU INSERT YOUR VARIABLE TO CHECK FOR AN ADMIN])
{
new gateuse;
if(gateuse == 0)
{
MoveObject(admingate, -1620.044106, 681.946533, 0.960892, 2.00);
gateuse = 1;
return 1;
}
else if(gateuse == 1)
{
MoveObject(whgate, -1643.084106, 681.946533, 8.960892, 2.00);
gateuse = 0;
}
else
{
SendClientMessage(playerid, COLOR_LIGHTRED, "You cannot open this gate");
}
}
}
and that should be set up... I haven't tested it, but if it doesn't work just tell me. or if you are stuck somewhere just tell me.
|
Use a bool instead of a integer.