Problem with using MoveObject
#1

Hi all, i want to make moving gate, but it copies itself: when i'm writing cmd to open it - it's opening but it's copying and leaving closed.
Closed:
sa-mp-000.jpg
Opened:
sa-mp-001.jpg

And code:
Код HTML:
#include <a_samp>
#pragma tabsize 0
#define FILTERSCRIPT
#if defined FILTERSCRIPT
new mhs;
#endif
public OnFilterScriptInit()
{

	mhs = CreateObject(980,-2276.5000000,2354.1999500,6.7000000,0.0000000,0.0000000,54.0000000); 
	return 0;
}
public OnPlayerCommandText(playerid, cmdtext[]) {
if (strcmp(cmdtext, "/otk", true)==0) {
MoveObject (mhs, -2276.5000000,2354.1999500,10.7000000 , 2);
return 1;
}
if (strcmp(cmdtext, "/zak", true)==0) {
MoveObject (mhs, -2276.5000000,2354.1999500,6.7000000 , 3);
return 1;
}
return 0;
}
Reply
#2

search threw your script(s) if the gate isnt created elsewhere again
Reply
#3

Seems like the arguments in your MoveObject are not correct. Take a look here:
https://sampwiki.blast.hk/wiki/MoveObject

Or as AIped said,try to look at your other scripts if you didn't create an object at the same coordinates. If not, try what I said.

EDIT: I didn't noticed that the rotation arguments are optional, my mistake.
Reply
#4

i don't see anything wrong about the arguments..
Reply
#5

Quote:
Originally Posted by AIped
Посмотреть сообщение
search threw your script(s) if the gate isnt created elsewhere again
No, it isn't, it was created as simple object, but i commented it and made moving script... And that's always happening with me when i'm trying to make something moving, idk why...

UPD. Fixed it: gate was "stucked" in the other object and copied itself, thread might be closed. And thanks to all for the answers!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)