Help doors
#2

I don't know on what level of pawn skills you are at, so I will just tell you what to do and if you don't know how to do any of the below, you ask.

First, declare variables that will hold the ID of the door objects that will be created. Just name it anything, for example:
Код:
new door_pd_1;
Under OnGameModeInit(), create the objects and assign the previous variables to them. When the function used for creation of objects is called, it returns the ID of the created object and we want that ID because we will need it to move the door. Right? So...
Код:
door_pd_1 = CreateObject(modelid, Float:X, Float:Y, Float:Z, Float:rX, Float:rY, Float:rZ, Float:DrawDistance);
Haven't got a clue what command system you are using, but you can change the code in adequate places. When you use the command, you want to check which door the player is next to. Use the proximity detector function as a condition:
Код:
if(IsPlayerInRangeOfPoint(playerid, 5.0, x, y, z))
    // rest of code
Obviously, the coordinates that you put into the above function have to be the object coordinates. If the 'if' condition is satisfied, you can move onto the actual moving. So you just move the object using the function you mentioned and the ID we stored in the door_pd_1 variable...

Код:
MoveObject(pd_door_1, x, y, z, speed);
Reply


Messages In This Thread
Help doors - by Fjclip99 - 30.07.2014, 20:04
Re: Help doors - by Rifa4life - 30.07.2014, 20:34
Re: Help doors - by Fjclip99 - 30.07.2014, 20:45
Re: Help doors - by Rifa4life - 31.07.2014, 09:35

Forum Jump:


Users browsing this thread: 1 Guest(s)