08.08.2013, 13:44
Well I liked this FIlter Script can be use in many Ways ;o
It's indeed not possible with the plugin. If you want to attach certain objects to a player, I suggest you use CreateObject and AttachObjectToPlayer for those specific objects. An AttachDynamicObjectToPlayer function doesn't exist, unfortunately.
|
stock _DestroyDynamicCP(&cpid)
{
DestroyDynamicCP(cpid);
cpid = -1;
}
#define DestroyDynamicCP _DestroyDynamicCP
When using SelectObject (playerid), and we pass the mouse over the items, information is (objectid, ModelID, X, Y, Z ....).
I would like to know how to get the IDs of objects in script. For example: I create an object ID: 147 I create an object ID: 148 I create an object ID: 149 I delete the object ID: 148 Object ID: 149 becomes the object ID: 148 |
new tempVariable[3];
tempVariable[0] = CreateDynamicObject(.......
tempVariable[1] = CreateDynamicObject(.......
tempVariable[2] = CreateDynamicObject(.......
if(tempVariable[1] == objectid) { DestroyDynamicObject(tempVariable[1]) }
printf("%d", tempVariable[1]);
new object[440]; public OnGameModeInit() { object[1] = CreateDynamicObject object[2] = CreateDynamicObject object[3] = CreateDynamicObject object[4] = CreateDynamicObject } public OnPlayerEditDynamicObject(playerid, objectid, modelid,X, Y, Z) { DestroyDynamicObject(object[3]); // Here, the object ID 4 becomes the object ID 3. There is indeed an auto increment After in-game by another player: DestroyDynamicObject(object[4]); It removes the effect variable script, but the real object In Game // Hop confusion !! }
I currently have a variable for each object as you said.
My server uses all dynamic objects (global object, object placed, distributor object, vehicle object, object retarder object work ...) The coefficient according confused objects is huge with over 3500 items. Exemple: Код:
new object[440]; public OnGameModeInit() { object[1] = CreateDynamicObject object[2] = CreateDynamicObject object[3] = CreateDynamicObject object[4] = CreateDynamicObject } public OnPlayerEditDynamicObject(playerid, objectid, modelid,X, Y, Z) { DestroyDynamicObject(object[3]); // Here, the object ID 4 becomes the object ID 3. There is indeed an auto increment After in-game by another player: DestroyDynamicObject(object[4]); It removes the effect variable script, but the real object In Game // Hop confusion !! } |
new HQDoor;
new HQGate;
Guys, I'm coming up to coding a teleporting feature, which I cannot test under optimal load at the moment, but only on localhost, where the problem with objects not loading quickly enough doesn't appear.
Or actually, this is the issue I have experienced: 1) The script calls UpdateEx function with new coordinates 2) Player is teleported to location, objects are visible 3) Objects disappear in the blink of an eye 4) Objects reappear, but the player has already fallen At least I think this is the issue. Also when I do: 1) Manual CreatePlayerObject to create the static object at the new location 2) Teleport player 3) The static object is there, the other objects are streamed in some time What have you guys done to overcome this issue? I have a few things on my mind (one is to use UpdateEx, then toggle off item updating using ToggleItemUpdate, and perhaps I'll get around to testing), but would love to hear some first-hand experience. My current project architecture would not appreciate having CreateObject global objects around all the time. |
What I do to prevent people from falling through the map:
I freeze the players when they are teleported, and then state "Press SPRINT_KEY to unfreeze and continue". Via this way, people who have quickly loading objects don't have to wait long and people who have problems with slow loading objects don't fall through the map. |
BusinessInfo[b][bTextLabel] = CreateDynamic3DTextLabel(string, COLOR_WHITE, BusinessInfo[b][bPosition][0], BusinessInfo[b][bPosition][1], BusinessInfo[b][bPosition][2], 20.0);