24.06.2012, 06:15
Cool. Open up the gamemode you're working on, CTRL+F then search for OnGameModeInit (Read more about it here.) once you find it add these 2 lines into it
Now, when the gamemode starts it will create the gates. Now let's place the commands, CTRL+F then find OnPlayerCommandText (Read more about it here) and add these codes into it
Still don't get it? See FULL CODE!
pawn Код:
gate[0] = CreateObject(971, -1060.2998046875, -1338.19921875, 132.5, 0, 0, 347.99743652344);
gate[1] = CreateObject(971, -1046.7998046875, -1334.3994140625, 132.60000610352, 0, 0, 347.99743652344);
pawn Код:
if(strcmp("/opengate1", cmdtext, true) == 0)
{
MoveObject(gate[0], -1060.2998046875, -1338.19921875, 126.5, 7.5);
return 1;
}
if(strcmp("/o1", cmdtext, true) == 0)
{
MoveObject(gate[1], -1046.7998046875, -1334.3994140625, 126.5, 7.5);
return 1;
}