more gates
#1

i whanted to make 2 gates but first i maked 1 but then i wanted to add in the second 1 but that wont work pleas help me

public OnPlayerCommandText(playerid, cmdtext[])
{
if(strcmp(cmdtext, "/open1", true) == 0)
{
MoveObject(Gate, 249.687729, 433.796722, 0.0898772, 3.00);
SendClientMessage(playerid, 0x00ff00, "Gate Down");
return 1;
}
if(strcmp(cmdtext, "/close1", true) == 0)
{
MoveObject(Gate, 249.692200, 433.822876, 57.365799, 3.00);
SendClientMessage(playerid, 0x00ff00, "Gate Up");
return 1;
}
if(strcmp(cmdtext, "/open2", true) == 0)
{
MoveObject(Gate, 18450, 277.404968, 369.266449, 3.00);
SendClientMessage(playerid, 0x00ff00, "Roof Open");
return 1;
}
if(strcmp(cmdtext, "/close2", true) == 0)
{
MoveObject(Gate, 18450, 277.404968, 369.266449, 3.00);
SendClientMessage(playerid, 0x00ff00, "Roof Closed");
}

i know open and closed are still the same
Reply
#2

MoveObject(gate,codehere);

they are all the same.

make different objects and different names
Reply
#3

You're using the same variable 'Gate' for both commands. You will need to create an object for your second gate and store it's object id in it's own variable such as 'Gate2' or whatever you want.
Reply
#4

thx problem solved

but i got a new problem my 2nd gate moves away to nowhere not to the place in the script

public OnPlayerCommandText(playerid, cmdtext[])
{
if(strcmp(cmdtext, "/xsd", true) == 0)
{
MoveObject(Gate, 249.687729, 433.796722, 0.0898772, 3.00);
SendClientMessage(playerid, 0x00ff00, "Gate Down");
return 1;
}
if(strcmp(cmdtext, "/xsu", true) == 0)
{
MoveObject(Gate, 249.692200, 433.822876, 57.365799, 3.00);
SendClientMessage(playerid, 0x00ff00, "Gate Up");
return 1;
}
if(strcmp(cmdtext, "/xsro", true) == 0)
{
MoveObject(Roof, 18450, 283.639709, 354.576416, 3.00);
SendClientMessage(playerid, 0x00ff00, "Roof Open");
return 1;
}
if(strcmp(cmdtext, "/xsrc", true) == 0)
{
MoveObject(Roof, 18450, 277.404968, 369.266449, 3.00);
SendClientMessage(playerid, 0x00ff00, "Roof Closed");
return 1;
}
return 0;
}
Reply
#5

pleas help me
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)