object destroy
#1

I've done on the machine objects, and how do I do to prescribe a specific command, and the objects could be removed?

я вот сделал на машину объекты, а как мне сделать чтобы прописать определенную команду, и объекты смогли удалится?
Reply
#2

Well, something like this. I also recommend you check the wikipedia for more, in-depth help.

pawn Код:
new object = CreateObject(params);

DestroyObject(object); //Just add this to a command.
Reply
#3

Quote:
Originally Posted by rangerxxll
Посмотреть сообщение
Well, something like this. I also recommend you check the wikipedia for more, in-depth help.

pawn Код:
new object = CreateObject(params);

DestroyObject(object); //Just add this to a command.
and the team will be able to write?
Reply
#4

For example:

Under ongamemodeinit you put the object like this:

pawn Код:
new nana = CreateObject(1318, 3214.0, 2412.3, 13.24, 0.0, 0.0, 0.0, 90.0);
and the command to destroy it should be like this:

pawn Код:
CMD:destroyobjects(playerid, params[])
{
    if(IsPlayerConnected(playerid))
    {
        if(IsPlayerAdmin(playerid)) // remove this if you want (rcon administrator)
        {
            DestroyObject(nana);
        }
    }
    return 1;
}
I've used ZCMD, so if you're going to use it make sure you have
pawn Код:
#include <zcmd>
by Zeex in the top of your script!.
Reply
#5

Quote:
Originally Posted by Stanford
Посмотреть сообщение
For example:

Under ongamemodeinit you put the object like this:

pawn Код:
new nana = CreateObject(1318, 3214.0, 2412.3, 13.24, 0.0, 0.0, 0.0, 90.0);
and the command to destroy it should be like this:

pawn Код:
CMD:destroyobjects(playerid, params[])
{
    if(IsPlayerConnected(playerid))
    {
        if(IsPlayerAdmin(playerid)) // remove this if you want (rcon administrator)
        {
            DestroyObject(nana);
        }
    }
    return 1;
}
I've used ZCMD, so if you're going to use it make sure you have
pawn Код:
#include <zcmd>
by Zeex in the top of your script!.
and if I these objects were doing on the car suppose!

EXample:
Код HTML:
CreateVehicleObject(1116, GetPlayerVehicleID(playerid),0.000000,3.159999,-0.239999,0.000000,0.000000,0.000000,100.0);
Reply
#6

Pretty much the same, I guess
I hope that I helped you.
Reply
#7

Quote:
Originally Posted by Stanford
Посмотреть сообщение
Pretty much the same, I guess
I hope that I helped you.
write in atrai line which I sent, for more information please, and I'm on it I will do the rest!
Reply
#8

pawn Код:
new nana[MAX_PLAYERS];

pawn Код:
new nana[playerid] = CreateVehicleObject(1116, GetPlayerVehicleID(playerid),0.000000,3.159999,-0.239999,0.000000,0.000000,0.000000,100.0);
pawn Код:
DestroyObject(nana[playerid])
Reply
#9

Quote:
Originally Posted by Stanford
Посмотреть сообщение
pawn Код:
new nana[MAX_PLAYERS];

pawn Код:
new nana[playerid] = CreateVehicleObject(1116, GetPlayerVehicleID(playerid),0.000000,3.159999,-0.239999,0.000000,0.000000,0.000000,100.0);
pawn Код:
DestroyObject(nana[playerid])
Код HTML:
F:\GTA\ÑÅÐÂ\samp03e_svr_r2_win3\filterscripts\22.pwn(39) : warning 219: local variable "nana" shadows a variable at a preceding level
F:\GTA\ÑÅÐÂ\samp03e_svr_r2_win3\filterscripts\22.pwn(39) : error 008: must be a constant expression; assumed zero
F:\GTA\ÑÅÐÂ\samp03e_svr_r2_win3\filterscripts\22.pwn(39) : error 008: must be a constant expression; assumed zero
F:\GTA\ÑÅÐÂ\samp03e_svr_r2_win3\filterscripts\22.pwn(39) : error 036: empty statement
F:\GTA\ÑÅÐÂ\samp03e_svr_r2_win3\filterscripts\22.pwn(39) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


4 Errors.
Reply
#10

Ohh...

pawn Код:
nana[playerid] = CreateVehicleObject(1116, GetPlayerVehicleID(playerid),0.000000,3.159999,-0.239999,0.000000,0.000000,0.000000,100.0);
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)