23.03.2015, 23:23
Quote:
I am pretty sure CancelEdit applies for player objects too. Can you confirm it not to be working?
|
EDIT:
I didn't know that... Thanks you too, good to know.
I am pretty sure CancelEdit applies for player objects too. Can you confirm it not to be working?
|
Yea nevermind what I said, tested it again here. Calling OnPlayerEditDynamicObject callback manually (with EDIT_RESPONSE_CANCEL) and then calling CancelEdit fixed my problem (If I use only CancelEdit my objects don't go back to their previous position/rotation if they are in a different world than mine (I suppose because they are not streamed since I'm in a different world in that case), that's why I'm calling the callback too). I assumed CancelEdit wouldn't work but by what you said I see dynamic objects are actually player objects, now it makes sense. But I didn't see anything saying that CancelEdit would apply to dynamic objects too... Anyways thanks for the help, Abagail.
|
stock CancelDynamicEdit(playerid, objectid)
{
CallLocalFunction("OnPlayerEditDynamicObject", playerid, objectid, EDIT_RESPONSE_CANCEL, 0, 0, 0, 0, 0, 0);
CancelEdit(playerid);
return 1;
}
Glad to hear it worked! A neat function for your case would be:
pawn Код:
|
I started to work on vehicle streamer in august, now it's in alpha state so who interested, feel free to test it. It is the latest version + vehicle streamer. There will be bugs, it's on beta stage. Trailer functions not completed yet. Who have an idea how to write the best trailer streaming, help me
pawn Код:
|
new data[2] data[0] = 2 data[1] = "abc" // on this index i need a string for exemple, how i can sore it? Streamer_SetArrayData(STREAMER_TYPE_VEHICLE, vehicleid, E_STREAMER_EXTRA_ID, data);
new data[2] data[0] = 2; data[1] = 'a'; data[2] = 'b'; data[3] = 'c'; Streamer_SetArrayData(STREAMER_TYPE_VEHICLE, vehicleid, E_STREAMER_EXTRA_ID, data);
OnPlayerShootDynamicObject |
#define GetDynamicObjectModel(%0) Streamer_GetIntData(STREAMER_TYPE_OBJECT, %0, E_STREAMER_MODEL_ID)
@Tamer: Streamer_SetRadiusMultiplier was added in v2.7.5. But I found its behaviour pretty weird, I will test it again when I will be able to. It was looking pretty buggy to me, or I didn't know how to use it. I think that the default radius multiplier is 1.00. Correct me if I am wrong.
|
By default, the streaming radius multiplier is 1.0 for all players. This can be adjusted with Streamer_SetRadiusMultiplier. For example, a radius multiplier of 0.5 will reduce the streaming radius of all items of the type specified by half. This will require the player to be twice as close as normal before the item will begin to stream. |
---------- Loaded log file: "server_log.txt". ---------- SA-MP Dedicated Server ---------------------- v0.3z-R4, ©2005-2014 SA-MP Team [2015/04/01 00:17:42] filterscripts = "" (string) [2015/04/01 00:17:42] [2015/04/01 00:17:42] Server Plugins [2015/04/01 00:17:42] -------------- [2015/04/01 00:17:42] Loading plugin: mysql.so [2015/04/01 00:17:42] >> plugin.mysql: R39-3 successfully loaded. [2015/04/01 00:17:42] Loaded. [2015/04/01 00:17:42] Loading plugin: streamer.so [2015/04/01 00:17:42] *** Streamer Plugin v2.7.5.2 by Incognito loaded *** [2015/04/01 00:17:42] Loaded. [2015/04/01 00:17:42] Loading plugin: sscanf.so [2015/04/01 00:17:42] [2015/04/01 00:17:42] =============================== [2015/04/01 00:17:42] sscanf plugin loaded. [2015/04/01 00:17:42] Version: 2.8.1 [2015/04/01 00:17:42] © 2012 Alex "******" Cole [2015/04/01 00:17:42] =============================== [2015/04/01 00:17:42] Loaded. [2015/04/01 00:17:42] Loaded 3 plugins. [2015/04/01 00:17:42] [2015/04/01 00:17:42] Filterscripts [2015/04/01 00:17:42] --------------- [2015/04/01 00:17:42] Loaded 0 filterscripts.
public OnPlayerWeaponShot(playerid, weaponid, hittype, hitid, Float: fX, Float: fY, Float: fZ) {
if(IsPlayerConnected(playerid)) {
if(hittype == BULLET_HIT_TYPE_PLAYER_OBJECT && IsValidDynamicObject(hitid)) {
CallLocalFunction("OnPlayerShootDynamicObject", "ddfff", playerid, weaponid, fX, fY, fZ);
}
}
CallLocalFunction("A_OnPlayerWeaponShot", "ddddfff", playerid, weaponid, hittype, hitid, fX, fY, fZ);
if(funcidx("OnPlayerWeaponShot")) {
return OnPlayerWeaponShot(playerid, weaponid, hittype, hitid, fX, fY, fZ);
}
else return 1;
}
#if defined _ALS_OnPlayerWeaponShot
#undef OnPlayerWeaponShot
#else
#define _ALS_OnPlayerWeaponShot
#endif
#define OnPlayerWeaponShot A_OnPlayerWeaponShot
forward A_OnPlayerWeaponShot(playerid, weaponid, hittype, hitid, Float: fX, Float: fY, Float: fZ);
if(IsPlayerConnected(playerid))
{
if(hittype == BULLET_HIT_TYPE_PLAYER_OBJECT)
{
new streamerid = Streamer_GetItemStreamerID(playerid, STREAMER_TYPE_OBJECT, hitid);
if(IsValidDynamicObject(streamerid))
{
CallLocalFunction("OnPlayerShootDynamicObject", "dddfff", playerid, weaponid, streamerid, fX, fY, fZ);
}
}
}