[Plugin] Streamer Plugin

Can someone please write a basic stock for GetPlayerArea or something? This is too complicated for me to understand.
My script doesn't have overlapping areas so returning multiple results is not an issue.
Reply

Quote:
Originally Posted by Garavel
Посмотреть сообщение
Can someone please write a basic stock for GetPlayerArea or something? This is too complicated for me to understand.
My script doesn't have overlapping areas so returning multiple results is not an issue.
Код:
new playerarea[MAX_PLAYERS];

GetPlayerArea(playerid) return IsPlayerConnected(playerid) ? playerarea[playerid] : -1;

public OnPlayerConnect(playerid)
{
    playerarea[playerid] = -1;

    return 1;
}

public OnPlayerEnterDynamicArea(playerid, areaid)
{
    playerarea[playerid] = areaid;

    return 1;
}

public OnPlayerLeaveDynamicArea(playerid, areaid)
{
    playerarea[playerid] = -1;

    return 1;
}
Reply

the best plugin thanks for this
Reply

What I do is assume a reasonable upper limit, like 3 or 4 overlapping areas, and create an array that can store that many for each player. If they are in less than that, no problem. If they are somehow in more than that at once, I resort to PVars (yes, they DO have uses sometimes), since having 5+ overlapping areas is such an (IMHO) extremely unlikely case that the savings in memory outweigh extra costs from PVars.
Reply

Why not just store all areas in a string?
Reply

After last update EditDynamicObject is not working immediately after object is created like in previous versions.
Reply

Can I use the latest version of this plugin on a server with 1000 slots? I know that in the past there was a 1000p version of the plugin.
Reply

Quote:
Originally Posted by im
Посмотреть сообщение
Can I use the latest version of this plugin on a server with 1000 slots? I know that in the past there was a 1000p version of the plugin.
I've tested the plugin locally with 0.3.7 (Windows) + 1000 slots in server.cfg and it runs fine.
Obviously I can't reach 1000 players, so I don't know what happens with real players.
Reply

I have updated this plugin on to my windows servers and for some reason it won't load i config it perfectly fine its whenever i update it wont load.
Reply

Quote:
Originally Posted by DarkSlyder
Посмотреть сообщение
I've tested the plugin locally with 0.3.7 (Windows) + 1000 slots in server.cfg and it runs fine.
Obviously I can't reach 1000 players, so I don't know what happens with real players.
You can't run a 1000p server on windows. It'll default to 500 slots.
Reply

0.3.7 RC2 has this
Quote:

- The server will only come in a 1000 player variation from now on since there should be no performance difference between a 500 player server and 1000 player server.

Reply

Quote:
Originally Posted by DarkSlyder
Посмотреть сообщение
0.3.7 RC2 has this
I didn't see that; sorry! Well I guess now window users can have 1000p servers too; that's kinda cool I guess.
Reply

why this version of streamer is very takes long time to load... ?
Reply

How to check whether a point/coordinate is in an area and return it in text? I don't have overlapping areas
I played around with IsPointInDynamicArea a little but not sure how to return the result
Reply

What about adding

pawn Код:
SetDynamicObjectNoCameraCol(objectid);
Reply

Quote:
Originally Posted by Garavel
Посмотреть сообщение
How to check whether a point/coordinate is in an area and return it in text? I don't have overlapping areas
I played around with IsPointInDynamicArea a little but not sure how to return the result
pawn Код:
stock IsPointInDynamicAreaEx(areaid, Float: x, Float: y, Float: z)
{
    new string[64];
    if(IsPointInDynamicArea(areaid, x, y, z)) // In Area
   {
       format(string, sizeof(string), "%s", stringhere);
           return string; // Strings cannot be returned directly due to a bug in the compiler
   }
   else // Not in area
   {
           format(string, sizeof(string), "%s", stringhere);
           return string;
   }
}
Just replace stringhere with whatever string you wish to return. Since you can't return strings directly(due to a compiler bug) you have to format it and return the formatted string.
Reply

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 Код:
#define STREAMER_VEHICLE_TYPE_STATIC (0)
#define STREAMER_VEHICLE_TYPE_DYNAMIC (1)

native AttachDynamicObjectToVehicle(objectid, vehicleid, Float:offsetx, Float:offsety, Float:offsetz, Float:rx, Float:ry, Float:rz, vehicletype = STREAMER_VEHICLE_TYPE_DYNAMIC);

forward OnDynamicVehicleSpawn(vehicleid);
forward OnDynamicVehicleDeath(vehicleid, killerid);
forward OnPlayerEnterDynamicVehicle(playerid, vehicleid, ispassenger);
forward OnPlayerExitDynamicVehicle(playerid, vehicleid);
forward OnDynamicVehicleMod(playerid, vehicleid, componentid);
forward OnDynamicVehiclePaintjob(playerid, vehicleid, paintjobid);
forward OnDynamicVehicleRespray(playerid, vehicleid, color1, color2);
forward OnDynamicVehDamageStatusUpdate(vehicleid, playerid);
forward OnUnoccupiedDynamicVehUpdate(vehicleid, playerid, passenger_seat, Float:new_x, Float:new_y, Float:new_z, Float:vel_x, Float:vel_y, Float:vel_z);
forward OnDynamicVehicleStreamIn(vehicleid, forplayerid);
forward OnDynamicVehicleStreamOut(vehicleid, forplayerid);

native CreateDynamicVehicle(modelid, Float:fX, Float:fY, Float:fZ, Float:fRot, color1, color2, respawndelay, worldid = -1, interiorid = -1, playerid = -1, Float:streamdistance = 300.0);
native DestroyDynamicVehicle(vehicleid);
native IsValidDynamicVehicle(vehicleid);
native IsDynamicVehicleStreamedIn(vehicleid, forplayerid);
native GetDynamicVehiclePos(vehicleid, &Float:x, &Float:y, &Float:z);
native SetDynamicVehiclePos(vehicleid, Float:x, Float:y, Float:z);
native GetDynamicVehicleZAngle(vehicleid, &Float:z_angle);
native GetDynamicVehicleRotationQuat(vehicleid, &Float:w, &Float:x, &Float:y, &Float:z);
native SetDynamicVehicleZAngle(vehicleid, Float:z_angle);
native SetDynamicVehParamsForPlayer(vehicleid,playerid,objective,doorslocked);
native SetDynamicVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
native GetDynamicVehicleParamsEx(vehicleid, &engine, &lights, &alarm, &doors, &bonnet, &boot, &objective);
native SetDynamicVehicleToRespawn(vehicleid);
native LinkDynamicVehicleToInterior(vehicleid, interiorid);
native AddDynamicVehicleComponent(vehicleid, componentid);
native RemoveDynamicVehicleComponent(vehicleid, componentid);
native ChangeDynamicVehicleColor(vehicleid, color1, color2);
native ChangeDynamicVehiclePaintjob(vehicleid, paintjobid);
native SetDynamicVehicleHealth(vehicleid, Float:health);
native GetDynamicVehicleHealth(vehicleid, &Float:health);
native AttachTrailerToDynamicVehicle(trailerid, vehicleid);
native DetachTrailerFromDynamicVeh(vehicleid);
native IsTrailerAttachedToDynamicVeh(vehicleid);
native GetDynamicVehicleTrailer(vehicleid);
native SetDynamicVehicleNumberPlate(vehicleid, plate[]);
native GetDynamicVehicleModel(vehicleid);
native RepairDynamicVehicle(vehicleid); // Repairs the damage model and resets the health
native GetDynamicVehicleVelocity(vehicleid, &Float:X, &Float:Y, &Float:Z);
native SetDynamicVehicleVelocity(vehicleid, Float:X, Float:Y, Float:Z);
native SetDynamicVehAngularVelocity(vehicleid, Float:X, Float:Y, Float:Z);
native GetDynamicVehicleDamageStatus(vehicleid, &panels, &doors, &lights, &tires);
native UpdateDynamicVehDamageStatus(vehicleid, panels, doors, lights, tires);

native GetPlayerSurfingDynamicVehID(playerid);
native PutPlayerInDynamicVehicle(playerid, vehicleid, seatid);
native GetPlayerDynamicVehicleID(playerid);
native IsPlayerInDynamicVehicle(playerid, vehicleid);
native IsPlayerInAnyDynamicVehicle(vehicleid);
native PlayerSpectateDynamicVehicle(playerid, targetvehicleid, mode = SPECTATE_MODE_NORMAL);
Reply

I know this is not really a very necessary native, but take a look:

https://sampwiki.blast.hk/wiki/CancelEdit

Could you add CancelDynamicEdit(playerid)?

I just want to cancel the object edit mode of a player without it bugging. Though I found a not-so-effective way of doing it by using CallLocalFunction to call the OnPlayerEditDynamicObject callback manually with EDIT_RESPONSE_CANCEL specified on the "response" parameter. But this way I still need to press ESC to fully cancel the object edit mode, that's why I'm asking if you could add the native above.
Reply

Quote:
Originally Posted by BCG2000
Посмотреть сообщение
I know this is not really a very necessary native, but take a look:

https://sampwiki.blast.hk/wiki/CancelEdit

Could you add CancelDynamicEdit(playerid)?

I just want to cancel the object edit mode of a player without it bugging. Though I found a not-so-effective way of doing it by using CallLocalFunction to call the OnPlayerEditDynamicObject callback manually with EDIT_RESPONSE_CANCEL specified on the "response" parameter. But this way I still need to press ESC to fully cancel the object edit mode, that's why I'm asking if you could add the native above.
I am pretty sure CancelEdit applies for player objects too. Can you confirm it not to be working?
Reply

Quote:
Originally Posted by Abagail
Посмотреть сообщение
I am pretty sure CancelEdit applies for player objects too. Can you confirm it not to be working?
CancelEdit applies for the TD mouse, objects, and player objects.
Reply


Forum Jump:


Users browsing this thread: 12 Guest(s)