PDA

View Full Version : Door Script


AarabMoney
25/11/2012, 12:53 PM
I need a door script, to place a door en type /open to open it.

I'll pay one dollar in paypal if you find it for me working.

Thanks!

MrMaarud
25/11/2012, 12:56 PM
No problem to fix ;)
Add me on skype and i script one for you ;)
Skype : Ben.Pettersen

AarabMoney
25/11/2012, 12:58 PM
Added

MrMaarud
25/11/2012, 12:58 PM
No problem to fix ;)
Add me on skype and i script one for you ;)
Skype : Ben.Pettersen

Skimmer
25/11/2012, 01:01 PM
Well, i can script for you. First of all create a variable top of your script.
new myGate; // Top of the script
Then create an object below OnGameModeInit(). Here's an example.
myGate = CreateObject(974, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0);
0.0 is the coordinat from x, y, z, rX, rY, rZ Position. You can change it.
CreateObject() (http://wiki.sa-mp.com/wiki/CreateObject)
Then go to OnPlayerCommandText(), we'll create a command.
if (strcmp("/open", cmdtext, true, 10) == 0)
{
MoveObject(myGate, 1.0, 1.0, 1.0, 3.0);
return 1;
}
We created /open command, it opens the gate. 1.0 is the new x, y, z position. Like i said you can change it. 3.0 = Speed. 3 Seconds.
Here's /close command
if (strcmp("/close", cmdtext, true, 10) == 0)
{
MoveObject(myGate, 0.0, 0.0, 0.0, 3.0);
return 1;
}
0.0 is the old x, y, z Position, you know.