29.03.2014, 10:44
Hi so i want to make command when i write it i create object and when i write it again it destroy it, i made that but i dont know how to make that object destroy
Code:
COMMAND:troll(playerid,params[]) { if( ADMIN[playerid] == 4 ) { if( GTMODE[ GetPlayerVehicleID( playerid ) ] == false ) { GTMODE[ GetPlayerVehicleID( playerid ) ] = true; SendClientMessage( playerid, COLOR_LIGHTBLUE,"Create."); new objectOne, objectTwo; objectOne = CreateObject(19327, 0, 0, 0, 0, 0, 0); objectTwo = CreateObject(19327, 0, 0, 0, 0, 0, 0); AttachObjectToVehicle(objectOne, GetPlayerVehicleID( playerid ), -1.129999, -0.334999, 0.000000, -1.004999, 0.000000, -90.449951); //Object Model: 19327 | AttachObjectToVehicle(objectTwo, GetPlayerVehicleID( playerid ), 1.149999, -0.339999, 0.000000, 0.000000, 0.000000, 90.449951); //Object Model: 19327 | SetObjectMaterialText(objectOne, "Text", 0, OBJECT_MATERIAL_SIZE_256x128,"Arial", 42, 1, 0xFFFFFFFF, 0, OBJECT_MATERIAL_TEXT_ALIGN_CENTER); SetObjectMaterialText(objectTwo, "Text", 0, OBJECT_MATERIAL_SIZE_256x128,"Arial", 42, 1, 0xFFFFFFFF, 0, OBJECT_MATERIAL_TEXT_ALIGN_CENTER); return 1; } else { GTMODE[ GetPlayerVehicleID( playerid ) ] = false; SendClientMessage( playerid, COLOR_RED,"Destroy"); } } return 1; }