27.11.2010, 18:18
well heres a part of the wiki wich i modified to your interests;
new obj; // Somewhere at the top of your script
the Isplayerinrangeofpoint part should look something like this;
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
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; }
Код:
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) }
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