Help with objects
#1

Hi, how can I add a command into my server that will create a specific object in a specific location, and then I need a command that can destroy that same object. I can use CreateObject but I'm just not sure on the command part and DestryObject because I dont know how to get the "ObjectId". Also the player must be close to a point.
Please help
Reply
#2

what command processor you using?
Reply
#3

I am using the "if(strcmp(cmd" thing. I was thinking of adding "IsPlayerInRangeOfPoint" so that the player must be near a certain place to type the command.
Reply
#4

Anynody?, I really need help with this.
Reply
#5

sounds like your on the correct path!
Just use the wiki if you run into problems once you have some code written then post your code so we can
show you where you went wrong,

youll find you may not even need help beyond the wiki.
Reply
#6

The object id is returned when creating the object itself:

Код:
new objectid = CreateObject(2587, 2001.195679, 1547.113892, 14.283400, 0.0, 0.0, 96.0);
To destroy the previously created object:

Код:
DestroyObject(objectid);
Reply
#7

Quote:
Originally Posted by Jonny5
Посмотреть сообщение
sounds like your on the correct path!
Just use the wiki if you run into problems once you have some code written then post your code so we can
show you where you went wrong,

youll find you may not even need help beyond the wiki.
Yeah, thanks

Quote:
Originally Posted by Jaxson
Посмотреть сообщение
The object id is returned when creating the object itself:

Код:
new objectid = CreateObject(2587, 2001.195679, 1547.113892, 14.283400, 0.0, 0.0, 96.0);
To destroy the previously created object:

Код:
DestroyObject(objectid);
Oh I see, I will script it now and post the script if it goes wrong.
Reply
#8

When I added this code: (BTW if you want to know which line is which tho top line that says "CMD: smokeon(playerid, params[])" is line number "5668".
Код:
CMD:smokeon(playerid, params[])
{
  new objectid = CreateObject(2780,487.70001221,-2.40000010,999.70001221,0.00000000,0.00000000,0.00000000); //object(cj_smoke_mach) (3)
  SendClientMessage(playerid, COLOR_RED, "Smoke turned on");
  return 1;
}
CMD:smokeoff(playerid, params[])
{
  DestroyObject(objectid);
  SendClientMessage(playerid, COLOR_RED, "Smoke turned off");
  return 1;
}
I got this:

Код:
(5670) : warning 204: symbol is assigned a value that is never used: "objectid"
(5676) : error 017: undefined symbol "objectid"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase
How can I fix this?
PLEASE Help I will +rep anyone that can help me
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)