Need help with this
#7

Quote:
Originally Posted by JaTochNietDan
Посмотреть сообщение
That's pretty simple, because you're checking if the cmdtext array is equal to "/up" and if it is, you run that section of code and then return 1, which means any of the other code in that callback won't be run. Instead, why don't you have different command checks for each gate? Or if you want them all to happen at the same time, why don't you have all of the MoveObject code under one of the if statements?
He means that you need to have different commands to each gate.

do like /up to gate 1,up2 to gate 2 and up3 to gate 3.

Thats why its not working -.-' you have the same command to 3 different functions

Quote:

public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp(cmdtext, "/up", true) == 0)
{
MoveObject(ufo, 268.65, 1883.09, 774.00, 3);
SendClientMessage(playerid, 0xDEEE20FF, "To the moon!");
return 1;
}

if (strcmp(cmdtext, "/down", true) == 0)
{
MoveObject(ufo, 268.6500, 1883.0900, -35.0000, 5);
SendClientMessage(playerid, 0xDEEE20FF, "Back to Earth!");
return 1;
}
if (strcmp(cmdtext, "/up2", true) == 0)
{
MoveObject(ufo1, 268.65, 1883.09, 774.00, 3);
SendClientMessage(playerid, 0xDEEE20FF, "To the moon!");
return 1;
}

if (strcmp(cmdtext, "/down2", true) == 0)
{
MoveObject(ufo1, 268.6500, 1883.0900, -2.9000, 5);
SendClientMessage(playerid, 0xDEEE20FF, "Back to Earth!");
return 1;
}
if (strcmp(cmdtext, "/up3", true) == 0)
{
MoveObject(ufo2, 268.7174, 1883.0188, 832.4000, 3);
SendClientMessage(playerid, 0xDEEE20FF, "To the moon!");
return 1;
}

if (strcmp(cmdtext, "/down3", true) == 0)
{
MoveObject(ufo2, 268.7200, 1883.0200, 23.5000, 5);
SendClientMessage(playerid, 0xDEEE20FF, "Back to Earth!");
return 1;
}
return 0;
}

Put like this
Reply


Messages In This Thread
Need help with this - by Neo Karls - 31.08.2011, 00:35
Re: Need help with this - by =WoR=G4M3Ov3r - 31.08.2011, 00:37
Re: Need help with this - by JaTochNietDan - 31.08.2011, 00:38
Re: Need help with this - by Neo Karls - 31.08.2011, 00:52
Re: Need help with this - by IceCube! - 31.08.2011, 01:16
Re: Need help with this - by =WoR=G4M3Ov3r - 31.08.2011, 01:20
Re: Need help with this - by =WoR=Bruno - 31.08.2011, 01:21
Re: Need help with this - by Neo Karls - 31.08.2011, 01:31
Re: Need help with this - by Neo Karls - 31.08.2011, 01:40
Re: Need help with this - by IceCube! - 31.08.2011, 01:42

Forum Jump:


Users browsing this thread: 1 Guest(s)