02.08.2011, 19:25
Put this just under the #include
Now, put this in before return 1; in public OnGameModeInit, like so:
Now, here comes the somewhat hard part. I'll use strcmp, the native PAWN command processor, forsake of experience of your scripting.
To close, all you have to do is basically reverse it!
And all you have to do is change the coordinates!
NOTE:THIS COMMAND IS FOR EVERYONE.
(Rep please, lol)
pawn Код:
#include <a_samp>
new admingate;
pawn Код:
public OnGameModeInit()
{
SetGameModeText("Your Script");
AddPlayerClass(0, 5.0, 5.0, 5.0, 269.1425, 0, 0, 0, 0, 0, 0);
admingate = CreateObject(969, 0.0, 0.0, 3.0, 0.0, 0.0, 0.0);
return 1;
}
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/move", cmdtext, true, 10) == 0)
{
MoveObject(admingate, 0.0, 0.0, 10.0, 1.6);
SendClientMessage(playerid, 0xFFFFFF, "The gate has magically moved!");
return 1;
}
return 0;
}
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/moveback", cmdtext, true, 10) == 0)
{
MoveObject(admingate, 0.0, 0.0, 3.0, 1.6);
SendClientMessage(playerid, 0xFFFFFF, "The gate has magically moved back down!");
return 1;
}
return 0;
}
NOTE:THIS COMMAND IS FOR EVERYONE.
(Rep please, lol)