06.02.2014, 15:47
Is it possible to make an OnDynamicObjectStreamIn and OnDynamicObjectStreamOut?
With script or somehow?
With script or somehow?
E_PTEMP[i][pHurtIcon] = CreateDynamicMapIconEx(x, y, z, 22, 0, MAPICON_GLOBAL, .streamdistance = 6000.0, .players = Medics_List, .maxplayers = 50);
new players[] = { 0, 1 };
CreateDynamicMapIconEx(x, y, z, type, color, style, .players = players);
// We can just assume MAX_PLAYERS is 500.
new players[MAX_PLAYERS];
players[0] = 1;
players[1] = 4;
players[2] = 7;
// Result: { 1, 4, 7, 0, ... }
// However, we only want the first 3 values, so we'll just set "maxplayers" to 3.
CreateDynamicObjectEx(..., .players = players, .maxplayers = 3);
for(new i = 0; i < sizeof Medics_List; i++) { //OnPlayerDisconnect
if(Medics_List[i] == playerid) {
Medics_Counter --;
Medics_List[i] = INVALID_PLAYER_ID;
break;
}
}
if(Medics_Counter == 0) { //Login code
Medics_List[0] = playerid;
Medics_Counter ++;
}
else if(Medics_Counter > 0) {
for(new i = 0; i < sizeof Medics_List; i++) {
if(Medics_List[i] == INVALID_PLAYER_ID) {
Medics_List[i] = playerid;
Medics_Counter ++;
break;
}
}
}
Im just letting know that random object disappearing issue was in my script, I had random house fires, and I was reseting fire objects ( destroying ) them before creating new fire, but as I already destroyed them when firefighters cleared out the fire, variables with assigned IDs still had dynamic object IDs, so I was destroying other objects which had the same ids as fire object IDs, I hope it made a sense.
Video, just for a reference: http://www.youtube.com/watch?v=AJI-Rpp4QwI Anyhow, sleep well by knowing that there isn't an issue in the plugin PS. It took me only 3 years to find this out, that I have a bug in the script |
new Obj = -1;
// Somewhere
Obj = CreateDynamicObject( ... );
// Somewhere else
if( Obj != -1 )
{
DestroyDynamicObject( Obj );
Obj = -1;
}
streamer.inc(487) : warning 219: local variable "hitid" shadows a variable at a preceding level |
/////
#define BULLET_HIT_TYPE_NONE 0
#define BULLET_HIT_TYPE_PLAYER 1
#define BULLET_HIT_TYPE_VEHICLE 2
#define BULLET_HIT_TYPE_OBJECT 3
#define BULLET_HIT_TYPE_PLAYER_OBJECT 4
forward OnPlayerWeaponShot(playerid, weaponid, hittype, hitid, Float:fX, Float:fY, Float:fZ);
/////
#include <streamer>