SA-MP Forums Archive
object destroy - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: object destroy (/showthread.php?tid=508214)



object destroy - hillko - 21.04.2014

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

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


Re: object destroy - rangerxxll - 21.04.2014

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.



Re: object destroy - hillko - 21.04.2014

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?


Re: object destroy - Stanford - 21.04.2014

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!.


Re: object destroy - hillko - 21.04.2014

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);



Re: object destroy - Stanford - 21.04.2014

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


Re: object destroy - hillko - 21.04.2014

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!


Re: object destroy - Stanford - 21.04.2014

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])



Re: object destroy - hillko - 21.04.2014

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.



Re: object destroy - Stanford - 21.04.2014

Ohh...

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