need help with moving objects -
luckie12 - 26.04.2009
Hi i whant make move-ing objects but i get errors

here are the errors:
C:\Documents and Settings\Luc\Bureaublad\Untitled.pwn(

: error 017: undefined symbol "objectid"
C:\Documents and Settings\Luc\Bureaublad\Untitled.pwn(10) : warning 217: loose indentation
C:\Documents and Settings\Luc\Bureaublad\Untitled.pwn(13) : error 017: undefined symbol "objectid"
C:\Documents and Settings\Luc\Bureaublad\Untitled.pwn(14) : error 030: compound statement not closed at the end of file (started at line 13)
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
3 Errors.
and here is the code:
#include <a_samp>
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/open", cmdtext, true, 10) == 0)
{
MoveObject(objectid, 1961.7462, -2188.8318, 15.3203, 0.0000, 0.0000, 0.0000, 500.0, 5000); // Type in the object id., and the X,Y,Z You want it to move to, and the speed of the object moving, ex: 5000
if (strcmp("/close", cmdtext, true, 10) == 0)
{
MoveObject(objectid, 1961.7462, -2188.8318, 15.3203, 0.0000, 0.0000, 0.0000, 500.0, 5000); // Type in the object id, and the NORMAL X,Y,Z of the object
i have closed all lines but i get all errors back can any 1 help me?
Re: need help with moving objects -
Backwardsman97 - 26.04.2009
Because you have not defined objectid.
pawn Code:
new object; // at the top
//OnGameModeInit or wherever you create the object
object = CreateObject(/* BLah */);
//The command
MoveObject(object,/*blah*/);
Re: need help with moving objects -
luckie12 - 26.04.2009
Quote:
Originally Posted by backwardsman97
Because you have not defined objectid.
pawn Code:
new object; // at the top
//OnGameModeInit or wherever you create the object object = CreateObject(/* BLah */);
//The command MoveObject(object,/*blah*/);
|
so i must only put in new object; // at the top
//OnGameModeInit or wherever you create the object
object = CreateObject(/* BLah */);
//The command
MoveObject(object,/*blah*/); ? and not the another things?
Re: need help with moving objects -
Backwardsman97 - 26.04.2009
Well I mean input your information where it says blah. The commented parts just don't mean anything except tell you where to put them. //OnGameModeInit means to put it under..
pawn Code:
public OnGameModeInit()
{
//Here
}
And so forth.
Re: need help with moving objects -
luckie12 - 26.04.2009
Quote:
Originally Posted by backwardsman97
Well I mean input your information where it says blah. The commented parts just don't mean anything except tell you where to put them. //OnGameModeInit means to put it under..
pawn Code:
public OnGameModeInit() { //Here }
And so forth.
|
ok ty i gonna try it
and i have a little question
i cant make a only admin command
I have MADE this:
pawn Code:
if (strcmp(cmdtext, "/ap2", true)==0)
{
if(DMArena[playerid] == 1) return SendClientMessage(playerid, RED, "You are not allowed to teleport while DeathMatching!");
new cartype = GetPlayerVehicleID(playerid);
new State=GetPlayerState(playerid);
SetPlayerInterior(playerid,0);
IsPlayerAdmin(playerid);
format(string, sizeof(string), "%s warped to Los Santos' Airport ! ( /ap2 )", player);
SendClientMessageToAll(YELLOW, string);
GameTextForPlayer(playerid, "~y~Welcome to the 2nd Airport !", 3000,6);
if(State!=PLAYER_STATE_DRIVER)
{SetPlayerPos(playerid,1398.4218,-2420.0742,13.2148);SetPlayerFacingAngle(playerid,263);}
else if(IsPlayerInVehicle(playerid, cartype) == 1)
{SetVehiclePos(cartype,1398.4218,-2420.0742,13.2148);
SetVehicleZAngle(cartype,78.1831);}
else
{SetPlayerPos(playerid,1398.4218,-2420.0742,13.2148);SetPlayerFacingAngle(playerid,263);}
return 1;}