Move Object question
#1

Код:
#else


main()
{
	print("\n----------------------------------");
	print(" Blank Gamemode by your name here");
	print("----------------------------------\n");
}

#endif
new gate;

public OnGameModeInit()
{
	//Moving Gate
	gate = CreateObject(985,1545.1000000,-1627.6000000,14.1000000,0.0000000,0.0000000,90.0000000);
	return 1;
}

public OnPlayerCommandText(playerid, cmdtext[])
{

	if(strcmp(cmdtext,"/openthegate",true)== 0)
	{
	MoveObject(gate,1545.1000000,-1620.1000000,14.1000000,3;
	return 1;
	}
	if(strcmp(cmdtext,"/closethegate",true)== 0)
	{
	MoveObject(gate,1545.1000000,-1627.6000000,14.1000000,3;
	return 1;
	}
}
And i have this error... ?
PHP код:
C:\Users\Борисов\Desktop\The Walking Dead\gamemodes\TWD1.0.pwn(302) : error 001expected token","but found ";"
C:\Users\Борисов\Desktop\The Walking Dead\gamemodes\TWD1.0.pwn(307) : error 001expected token","but found ";"
C:\Users\Борисов\Desktop\The Walking Dead\gamemodes\TWD1.0.pwn(310) : warning 209: function "OnPlayerCommandText" should return a value
Pawn compiler 3.2.3664              Copyright 
(c1997-2006ITB CompuPhase
2 Errors

Reply
#2

You forgot to add a ")" to
Код:
MoveObject(gate,1545.1000000,-1627.6000000,14.1000000,3;
//See below code
MoveObject(gate,1545.1000000,-1627.6000000,14.1000000,3);
You also forgot to put "return 0;" in OnPlayerCommandText(). Use this instead:
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{

    if(strcmp(cmdtext,"/openthegate",true)== 0)
    {
    MoveObject(gate,1545.1000000,-1620.1000000,14.1000000,3);
    return 1;
    }
    if(strcmp(cmdtext,"/closethegate",true)== 0)
    {
    MoveObject(gate,1545.1000000,-1627.6000000,14.1000000,3);
    return 1;
    }
        return 0;
}
In Floats and math overall, there is no need to display "0" if there's not a number afterwars equal to not "0".
Код:
1545.1000000
is the same as
Код:
1545.1
Reply
#3

thank you so much ill try now i and i say what it happened
Reply
#4

everything is just PERFECT! Thank you so much again! i give you REP!
Reply
#5

can you fix this two [CODE]C:\Users\Борисов\Desktop\The Walking Dead\gamemodes\TWD1.0.pwn(274) : error 017: undefined symbol "TEAM_ARMY"
C:\Users\Борисов\Desktop\The Walking Dead\gamemodes\TWD1.0.pwn(28 : error 017: undefined symbol "TEAM_ARMY"
C:\Users\Борисов\Desktop\The Walking Dead\gamemodes\TWD1.0.pwn(299) : error 017: undefined symbol "COLOR_GREY"
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


3 Errors.
[CODE]
Reply
#6

Quote:
Originally Posted by Bulgaria
Посмотреть сообщение
can you fix this two [CODE]C:\Users\Борисов\Desktop\The Walking Dead\gamemodes\TWD1.0.pwn(274) : error 017: undefined symbol "TEAM_ARMY"
C:\Users\Борисов\Desktop\The Walking Dead\gamemodes\TWD1.0.pwn(28 : error 017: undefined symbol "TEAM_ARMY"
C:\Users\Борисов\Desktop\The Walking Dead\gamemodes\TWD1.0.pwn(299) : error 017: undefined symbol "COLOR_GREY"
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


3 Errors.
[CODE]
You have not defined TEAM_ARMY or COLOR_GREY.

For a quick solution, put this on the top of your script:
pawn Код:
#define COLOR_GREY 0xABABABFF
#define TEAM_ARMY 1337
However I do really suggest you check how many teams there are at the moment, then define TEAM_ARMY to the next available.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)