Scripting an elevator in a carrier
#4

well heres a part of the wiki wich i modified to your interests;
new obj; // Somewhere at the top of your script

Код:
new Ellevator;
public OnGameModeInit()
{
    Ellevator = CreateObject(980, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0);
    return 1;
}
 
public OnPlayerCommandText(playerid, cmdtext[])
{
    if(strcmp(cmdtext, "/move", true) == 0)
    {
        MoveObject(Ellevator,x,y,z,speed);// (x,y,z coordinates where you want to object to move to, and speed how fast it moves)
        return 1;
    }
    return 0;
}
the Isplayerinrangeofpoint part should look something like this;
Код:
if(IsPlayerInRangeOfPoint(playerid, 7.0, x,y,z))//7.0 is the range from the point x,y,z the coordinates of the elevator object
{
MoveObject(Ellevator,x,y,z,speed);// (x,y,z coordinates where you want to object to move to, and speed how fast it moves)
}
the isplayerinrangeofpoint could be added under a command or timer that checks the range where you are..i prefer the command.
I suggest you try this out part by part copy and pasting this would fail big time

here are some recourses;
https://sampwiki.blast.hk/wiki/IsPlayerInRangeOfPoint
https://sampwiki.blast.hk/wiki/MoveObject
https://sampwiki.blast.hk/wiki/OnObjectMoved

you could add moveobject under objectmoved callback so the ellevator would move any time
good luck
Reply


Messages In This Thread
Scripting an elevator in a carrier - by Wolbol - 27.11.2010, 14:10
Re: Scripting an elevator in a carrier - by boelie - 27.11.2010, 14:56
Re: Scripting an elevator in a carrier - by Wolbol - 27.11.2010, 15:24
Re: Scripting an elevator in a carrier - by boelie - 27.11.2010, 18:18

Forum Jump:


Users browsing this thread: 1 Guest(s)